-
-
Save MrMugiwara/c74933a095b5e4ad414652dac7750f58 to your computer and use it in GitHub Desktop.
Revisions
-
faidamine created this gist
Sep 17, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,56 @@ 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>"; }