Description
Piggy-Bank CTFZONE 2018 Web Challenge [100]
Hack some bank for me.
This is just a quick and dirty write-up.
First, we created an account, logged in, and looked for interesting stuff. There was a VIP section: “This section is available only to privileged pigs with money in pockets. Transfer to the piggy-bank 1 000 000 coins and become important.” So we assumed this is what we had to do. For that, we needed more money, so we assumed that there was a bug in the transfer page.

Then we found that under home/for_developers.php, a WSDL file was leaked in an HTML comment. We imported the WSDL into Burp using the Wsdler extension and played around with the two SOAP actions.
The first one, urn:requestBalanceAction, would give the balance of any account and the second one, SOAPAction: urn:internalTransferAction, allowed you to send transactions from one account to another.
| |
Since the token was unknown, we were not able to use this service. But as it turned out, the transfer page was using this service in the background.
Solution
We were able to inject sender_wallet_num by crafting a transfer POST request like this:
| |
This would result in this valid XML on the server-side:
| |
Next, we had to find an account with a lot of money so we used the urn:requestBalanceAction to iterate over the user IDs. We found a few that had over 1,000,000, so we transferred it all to our account and then to the piggy bank with ID 1338. After that, we collected the flag from the VIP area. 😊