-
-
Save MrMugiwara/c74933a095b5e4ad414652dac7750f58 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Extracting Files (16 Go) | |
Using FTK Imager and go to (var/www/) | |
You will find login.pl & index.pl & username.txt & password.txt | |
login ( admin : iforgotaboutthemathtest ) | |
flag : flag{but_I_f0rgot_my_my_math_test_and_pants} | |
#!/usr/bin/perl | |
if ($ENV{'REQUEST_METHOD'} eq "POST") { | |
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); | |
@pairs = split(/&/, $buffer); | |
foreach $pair (@pairs) { | |
($name, $value) = split(/=/, $pair); | |
$value =~ tr/+/ /; | |
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; | |
$FORM{$name} = $value; | |
} | |
} | |
open(FH,"username.txt") or &dienice("Can't open username.txt: $!"); | |
$username = <FH>; | |
close(FH); | |
open(FH,"password.txt") or &dienice("Can't open password.txt: $!"); | |
$password = <FH>; | |
close(FH); | |
open(FH,"flag.txt") or &dienice("Can't open flag.txt: $!"); | |
$flag = <FH>; | |
close(FH); | |
print "Content-type:text/html\r\n\r\n"; | |
if ($FORM{"username"} ne $username && $FORM{"password"} ne $password){ | |
print "<html>"; | |
print "<head>"; | |
print "<title>[ BEST ROUTER ]</title>"; | |
print "</head>"; | |
print "<body>"; | |
print "<center><p>Sorry, your credentials are wrong</p></center>"; | |
print "</body>"; | |
print "</html>"; | |
exit 0; | |
} else { | |
print "<html>"; | |
print "<head>"; | |
print "<title>[ BEST ROUTER ]</title>"; | |
print "</head>"; | |
print "<body>"; | |
print "<p>Authenticated</p>"; | |
print "<pre>$flag</pre>"; | |
print "</body>"; | |
print "</html>"; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment