반응형

후하..첨보는게 또 나왔다.

우선 아래와 같이 나온다.

문제를 한번 받아보자

wget으로~~~~~~~~~~~

 

실행권한을 주고 실행시켜보면?

결국은 strcpy로 복사해온다는거 같은디.... 까봐야지 알거같다.

 

음...아무것도 안보인다.

ida로 확인해보아도 뭘 볼수 없다ㅠ

readelf나 file 명령으로도 뭔가를 얻을 순 없었다.

호옥시나 뭔가 있나해서 HxD로 한번 까봤다.

음? 뭔가 한번씩 까보던 ELF파일과는 다르다.

 

UPK로 패킹(?)된 파일이었다 ㄷㄷ

그리하여 검색해보니 아래와 같이 나왔다.

https://reverseengineering.stackexchange.com/questions/11486/how-to-unpack-manually-an-upx-packed-elf-file

 

How to unpack manually an upx packed elf file

I am trying to learn to manually unpack an upx packed elf file. The examples I have found are for Windows, mostly with Ollydbg, and as I see the first step is to look for pushad and popad instructi...

reverseengineering.stackexchange.com

해보자

sudo apt install upx

upx -d -o un_flag flag

이제 다시 gdb로 ㄱㄱ

packing이 풀리니 주르르르를륵 나온다 ㅋㅋ

 

disas main을 수행해보면, main+32에서 flag가 rdx에 담기는 것을 볼 수 있다.

그렇다면! main+39즈음에 bp를 걸고 확인하자!

 

 

flag가 보인다!

반응형

'System Hacking' 카테고리의 다른 글

basic_rop_x64  (0) 2023.09.29
computer structure  (0) 2023.09.10
basic_heap_overflow  (0) 2023.08.22
oneshot  (0) 2023.08.05
Mitigation  (0) 2023.01.17

+ Recent posts