[CTF] CSAW Reversing 2013 2 200

in #recersing5 years ago (edited)

CTF 문제 중 2013 CSAW Reversing 2 200point 문제를 풀어봤습니다.
문제 출제 설명에 We got a little lazy so we just tweaked an old one a bit 라고 13년도나 14년도나 문제는 많이 다르지 않은 것 같습니다.

오랜만에 한 리버싱이라 느낌을 찾는다는 생각으로 해보았습니다.


문제파일인 csaw2013reversing2.exe 을 직접 실행시키면 에러가 발생하거나 아무것도 출력되지 않고 창이 종료됩니다.

ollydbg Searchfor - All referenced text Strings를 보면 Flag 관련 문자열이 보입니다.

해당주소로 따라갑니다.

Imgur

바로 메인함수가 나오고 BP(F2)를 걸어준 후 실행(F9)해봅니다.

Imgur

알 수 없는 문자들의 팝업이 나오고 버튼을 누르면 프로그램이 종료됩니다.

다시 실행시켜서(Ctrl + F2) 코드를 봅니다.

Imgur

EAX와 EBX를 비교하는 분기문이 있고 인터럽트를 발생시키는 명령어인 INT3도 있습니다.
아래쪽에는 Flag를 XOR연산하는 코드도 보입니다.
EAX를 0으로 같게 해서 다시 실행해 봅니다.
INT3 또한 NOP으로 어셈블 해줍니다.
Imgur

Imgur

이번엔 빈 대화상자가 나옵니다.

Imgur

ESI 에 저장된 값을 불러오고 있는데 그 주소(030505C8)로 찾아가 보면(Ctrl + G) 시작값이 '00'인 flag 값을 찾을 수 있다.

MessageBoxA에서 ESI에 저장된 값이 '00'으로 시작했기 때문에 문자열로 인식하지 못하고 빈 박스가 출력된 것이다.

flag : number2isalittlebitharder:p


Sponsored ( Powered by dclick )
DCLICK: An Incentivized Ad platform by Proof of Click - 스팀 기반 애드센스를 소개합니다.

안녕하세요 스티미언 여러분. 오늘 여러분께 스팀 블록체인 기반 광고 플랫폼 DCLICK을 소개...

Sort:  

Hello @gomguk777! This is a friendly reminder that you have 3000 Partiko Points unclaimed in your Partiko account!

Partiko is a fast and beautiful mobile app for Steem, and it’s the most popular Steem mobile app out there! Download Partiko using the link below and login using SteemConnect to claim your 3000 Partiko points! You can easily convert them into Steem token!

https://partiko.app/referral/partiko

Congratulations @gomguk777! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.18
TRX 0.14
JST 0.030
BTC 59708.78
ETH 3185.76
USDT 1.00
SBD 2.45