强网杯2023个人解题报告
强网杯2023个人解题报告BabyreTls回调式反调机制,找到检测函数,并更改跳转条件绕过。得基础TEA解密:
12345678910111213141516171819#include <cstdio>using namespace std;const unsigned int key[4]={0x62,0x6F,0x6D,0x62},delta=0x77BF7F99;unsigned int enc[8]={0x9523F2E0, 0x8ED8C293, 0x8668C393, 0xDDF250BC, 0x510E4499, 0x8C60BD44, 0x34DCABF2, 0xC10FD260};void TEA_decrypt(unsigned int enc1,unsigned int enc2){ unsigned int v0=enc1,v1=enc2,sum=0x90508D47-0x77BF7F99*33*4; for(int i=0;i<33*4;i++){ su ...
流量分析做题1
流量分析做题11.[陇剑杯 2021]jwt(问1)找到:8 110.318928 192.168.2.197 192.168.2.197 HTTP 610 HTTP/1.1 200 OK (text/html)
有HTTP响应头:Set-Cookie: token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTAwODYsIk1hcENsYWltcyI6eyJhdWQiOiJhZG1pbiIsInVzZXJuYW1lIjoiYWRtaW4ifX0.dJArtwXjas3_Cg9a3tr8COXF7DRsuX8UjmbC1nKf8fc; Path=/; Max-Age=3600; HttpOnly\r\n
即为JWT认证方式。
2.[陇剑杯 2021]webshell(问1)登录成功状态码为200,方式为POST,一般为login.php。
找到:101 11.239111 192.168.2.197 192.168.2.197 HTTP 753 POST /index.php?m=Home&c=Members&a=lo ...
SYCTF2023-Reverse官方题解
SYCTF2023-Reverse官方题解01程序逻辑:将flag异或“随机数”后得到正确flag,再直接与输入比较。
只要srand的参数确定了,一系列rand()返回值都能确定。其中flag原值可通过IDA Pro的LazyIDA一键导出(需要另行安装)。
exp:
12345678910#include <cstdlib>#include <cstdio>using namespace std;char flag[]={0xa1,0x7c,0x7a,0xb2,0x13,0x68,0x28,0xe5,0x25,0x5,0xca,0x8c,0xce,0x7f,0xf3,0xaa,0x50,0x5a,0x50,0x63,0x17,0x5b,0x18,0xd7,0x51,0xae,0x14,0x87,0x7f,0x7f,0x79,0xa4,0xc4,0x24,0xa7,0x89,0xa4,0xab,0x4b,0xae,0xb8,0x06,0xdf};int main(void){ srand(0xDEADC0DE); fo ...
古剑山2023个人解题报告
古剑山2023个人解题报告Father&Son打开main程序,发现解密后dump文件。
直接运行后取文件,发现flag输出乱码,但是直接运行会出现前半flag。
仔细看main程序,发现有pokedata行为,但不知道修改内存地址在哪里。
想到TEA加密处密钥有两个都是0,有些奇怪,更改第四个发现flag。
i have the flag打开html输入FAKE-TOKEN失败,审计代码ck函数发现非常可疑,使用exp:
123enc=[118, 108, 112, 115, 111, 104, 104, 103, 120, 52, 53, 54]for i in range(len(enc)): print(chr(enc[i]-3),end='')
得simpleedu123,得:flag{muWn9NU0H6erBN/w+C7HVg}
字节码12345#由fjU1MmYyNWcyNmcyOTgyYjY4MTc5NWMzZjc0ZzllNzMyfGhibWc=解密得s='~552f25g26g2982b681795c3f74 ...
Python-Django实战
Python-Django实战部署安装1pip install Django
创建项目12django-admin startproject blog #blog为项目名python manage.py runserver
创建应用1python manage.py startapp article #article为应用名
在blog/settings.py中INSTALLED_APPS字段中加入'article.apps.ArticalConfig'。
数据模型添加数据模型在article/models.py文件创建模型类:
1234567891011121314from django.db import modelsclass User(models.Model): id=models.IntegerField(primary_key=True) #主键 username=models.CharField(max_length=30) #...class Article(models.Model): content=models.Te ...
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')