当我从带有python3-pwntools's recv()
,sendlineafter()
...等的可伪进程序收到消息时,什么也没收到。
如果您知道解决方法。
环境
python3-pwntools 2.2.1
python3 3.5.2
Ubuntu 16.04(vagrant:ubuntu/xenial64)
目标
#include <stdio.h>
int main() {
char buffer[0x10];
printf("Hello, what's your name?: ");
fgets(buffer, 0x100, stdin);
printf("[+] buffer ==> %s\n", buffer);
return 0;
}
利用代码(草稿)
from pwn import *
from sys import argv
context(os='linux', arch='amd64', log_level='debug', terminal=['tmux', 'splitw', '-h'])
FILE_NAME = './ret2shellcode'
binary = ELF(FILE_NAME)
SHELLCODE = asm(shellcraft.sh())
r = process(FILE_NAME)
def main():
payload = b'A' * 24
payload += b'X' * 8
payload += b'B' * 0x50
print(r.recv())
r.sendlineafter("Hello, what's your name?:", payload)
print(r.recv())
if __name__ == '__main__':
main()
结果
~~~~
[+] Starting program './ret2shellcode': Done
# <== nothing come