Description
Piggy-Bank CTFZONE 2018 Web Challenge [100]
Hack some bank for me.
This is just a quick and dirty writeup.
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 SOAPActions.
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.
|
|
As 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 1000000, so we transferred it all to our account and then to the piggy bank with id 1338. After that, we collected that flag from the VIP area. 😊