Bisploit - CTF 49

IHC Blog

CTF Name: Bisploit

Topic: Binary Exploitation

Flag Format: IHC_CTF{}

CTF Link: https://t.me/ctf_invisiblehc/84

Description: 

This is a simple program store. From this store, you can buy chocolate & Flag. Buy the flag and submit it.

Hint: There has a limit to buy chocolate. Exploit it.


Solution:

Open up the source, and we see that the service is a simple store. It offers us 3 options, but we're interested in is the second one.

IHC Blog

The second one offers real flag. But the real flag costs 1000 dollars, and we only start with 100. So how do we get more money?

❇️ if we choose 2, it will say Flag Price is 1000 dollars, and Insufficient Balance. Earn money for buy the flag.

❇️ if we choose 1, it will say Avaiable Chocolate 5 Every Chocolate Price is 75 How many pant do you want to buy? if we choose 1, it will say Your Balance 25

Nothing Interesting Till now . But Look at the initial value given which is 100 . It look’s like a signed integer. So let’s checkout if we create a buffer overflow here or not . chocolate cost is 75 and the max value of int in C is 2147483647

So we need to order (2147483647/75)= 28633115 chocolate for reach out the max value

We ordered 28633115 chocolate and it says Insufficient balance

Again we ordered 28633118 and now our current balance is 2147483546 We can buy Flag from this Money

IHC Blog

Flag: IHC_CTF{3XP1017_C0MP1373_501}

~ Writeup By a mum1n

Join Our CTF Channel:

https://t.me/ctf_invisiblehc