exploit1
1 | exploit1.bin: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=5a320c8445c424a78f554fa7c6ab33175e11e30e, for GNU/Linux 3.2.0, not stripped |
- 64位,dynamically,全开
漏洞分析
栈溢出:
1 | printf("Enter new username: "); |
有后门:
1 | else if ( key == 1337 ) |
入侵思路
利用栈溢出简单覆盖 key 值为 1337 即可
完整 exp 如下:
1 | # -*- coding:utf-8 -*- |
exploit2
1 | exploit2.bin: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=2225439fe6f084b9baea4c6a07e31d32109da59d, for GNU/Linux 3.2.0, not stripped |
- 64位,statically,Partial RELRO,Canary,NX
漏洞分析
栈溢出:
1 | puts("\nWaiting for heart beat request..."); |
入侵思路
先利用 write 泄露 canary,然后构造 sys_read 写入 /bin/sh
,接着构造 sys_execve
完整 exp 如下:
1 | # -*- coding:utf-8 -*- |
exploit3
1 | exploit3.bin: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=ee04914473e2edcc2f0cd1fcf5b8fab1590acaf2, for GNU/Linux 3.2.0, not stripped |
- 64位,dynamically,Full RELRO,PIE
漏洞分析
栈溢出:
1 | printf("Hello! What's your name?: "); |
有后门:
1 | int win() |
入侵思路
先泄露程序基地址,然后覆盖返回地址末尾2字节为 main(1/16 的爆破概率)
再次执行时覆盖返回地址为后门函数即可
完整 exp 如下:
1 | # -*- coding:utf-8 -*- |