snakeCTF2023个人解题报告
snakeCTF2023个人解题报告static warmup差一点三血…不开心。
发现侧信道攻击点0x401FD3,直接用Pintools插桩去打:
1234567891011121314151617181920212223242526272829303132#include <iostream>#include <fstream>#include "pin.H"using std::cerr;using std::endl;using std::string;static UINT64 icount=0;VOID docount(VOID* addr) { if ((long)addr==0x401FD3) icount++; return;};VOID Instruction(INS ins,VOID* v){ INS_InsertCall(ins,IPOINT_BEFORE,(AFUNPTR)docount,IARG_INST_PTR,IARG_END);};KN ...
PingCTF2023个人题解
PingCTF2023个人题解noodle-nightmare对文件进行拼接:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891 ...
Python代码保护技术
Python代码保护技术Oxyry Python Obfuscatorhttps://pyob.oxyry.com/
Stegosaurushttps://github.com/AngelKitty/stegosaurus
先检查最多可包含的Payload字节数:
1stegosaurus example.py -r
写入Payload:
1stegosaurus example.py -s --payload "xxx"
也可以是十六进制:
1stegosaurus example.py -s --payload "\xeb\x2a\x5e\x89\x76"
解密:
1stegosaurus example.pyc -x
pyc_obscurehttps://github.com/c10udlnk/pyc_obscure
Python字节码花指令构造:通过JUMP_ABSOLUTE跳过无意义字节,但无意义字节仍会被反汇编器处理,导致报错。
1234from pyc_obscure import Obscureobs=Obscure( ...
Python-Flask实战
Python-Flask实战部署Python部署123456789101112131415161718cat/etc/issue #查看系统版本号python --versionpython3 --versionsudo apt install python3 -pippip3 --versionsudo pip3 install virtualenvsudo mkdir /var/www/html/flask_testsudo chown -R ubuntu/var/www/html/flask_testcd /var/www/html/flask_test#虚拟环境配置virtualenv -p python3 venvsource venv/bin/activate#flask安装pip install flaskvim run.py #flask入口python run.py
Gunicorn部署法一:直接启动1234567891011121314151617181920212223242526272829pip install gunicoregunicore -w 3 ...
Python沙盒逃逸绕过方法合集
Python沙盒逃逸绕过方法合集模块删除绕过模块删除删除方法:
1del __builtin__.__dict__['eval']
reload恢复:
12import importlibreload(__builtin__)
模块修改修改方法:
1sys.modules['os']='not allowed'
恢复:
123del sys.modules['os']import osos.system('ls')
LeetCode快速入门
LeetCode快速入门C++1234567891011121314class Solution {public: vector<int> twoSum(vector<int>& nums, int target) { vector<int> ans; for(int i=0;i<nums.size();i++) for(int j=i+1;j<nums.size();j++) if(nums.at(i)+nums.at(j)==target){ ans.push_back(i); ans.push_back(j); return ans; }; return ans; };};
Java12345678910class S ...
Kali-Linux摸鱼指南
Kali-Linux摸鱼指南12345suapt install bastet #俄罗斯方块apt install nsnake #贪吃蛇apt install ninvaders #侵略者apt install nudoku #数独
PHP入门笔记
PHP入门笔记语言基础数据类型1234<?php $name="..."; echo "xxx".$name."xxx";//.为字符串连接?>
类型转换12345<?php $num='3.1415926r*r'; echo (int)num; $result=settype($num,'integer')?>
类型检测1234567891011121314<?php $boo="043112345678" if(is_numberic($boo)){ echo "xxx"; }else{ echo "xxx"; } if(is_null($boo)){ echo "xxx"; }else{ ...
Web入门-文件上传
Web入门-文件上传MIME类型12345678.html:text/html.txt:text/plain.pdf:application/pdf.word:application/msword.png:image/png.gif:image/gif.mpg .mpeg:video/mpeg.avi:video/x-msvideo
黑名单绕过123456789后缀大小写绕过:.Php空格绕过:.php 点绕过:.php.(Windows系统文件名特性会自动去掉后缀名最后.)::$DATA绕过:Windows下NTFS文件系统特性Apache解析漏洞:解析文件从右往左判断,不可解析再往左判断,例如:aa.php.owf.rar.htaccess文件:以php的方式解析,例如: <FilesMatch "as.png"> SetHandler application/x-httpd-php </FilesMatch>
白名单绕过1%00与0x00绕过:as.php%00.png
常见文件幻数:
jpg:FF D8 FF E0 00 10 ...
Pintools基本用法
Pintools基本用法安装Linux/Ubuntu下载源码,在source/tools/目录下找到文件夹MyPintools,把自己的mypintool.cpp复制过来(或用示例文件)。然后make,即:
1234cp mypintools.cpp source/tools/MyPintoolscd source/tools/MyPintoolsmake obj-ia32/mypintool.so TARGET=ia32 #32位架构make obj-intel64/mypintool.so TARGET=intel64 #64位架构
Windows下载源码,将目录添加到环境变量。Pintools区分32位和64位,目录中的为32位的。为方便使用,将原pin.exe命名为pin.bak,不使用。新建pin32.bat,内容如下:
12@echo off%~dp0\ia32\bin\pin.exe %*
再新建pin64.bat,内容如下:
12@echo off%~dp0\intel64\bin\pin.exe %*
找到source\tools\MyPinTool目 ...