Created
January 7, 2013 06:18
-
-
Save evandrix/4472891 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
<!DOCTYPE HTML> | |
<html lang = "en"> | |
<head> | |
<title>HackThis!! - Capture the Flag</title> | |
<meta charset = "UTF-8" /> | |
<link href='https://fonts.googleapis.com/css?family=Ubuntu|Orbitron' rel='stylesheet' type='text/css'> | |
<link rel="stylesheet" href="/ctf/css/main.css"> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
</head> | |
<body> | |
<div class='level_title'> | |
Level 6 </div> | |
<div class='nav'> | |
<a href='/ctf/leaderboard'>Leaderboard</a> | <a href='/ctf/irc'>IRC</a> | <a href='/'>Normal Site</a> | <a href='?logout'>Logout</a> | |
</div> | |
<div class='level_container'> | |
<div class='msg_error'> | |
Invalid login | |
</div> | |
<form autocomplete="off" method="POST"> | |
<input type="text" name="user" data-holder="Username"/><br/> | |
<input type="password" name="pass" data-holder="Password"/><br/> | |
<input type="submit" class="submit" value="Login"/> | |
</form> | |
<a href='#' class='view'>View Details</a> | |
</div> | |
<div class='level_code'> | |
<a href='#' class='close'>[X]</a> | |
<div class='code'> | |
<code><span style="color: #000000"> | |
<span style="color: #0000BB"><?php<br /> $pass_file </span><span style="color: #007700">= </span><span style="color: #DD0000">"password.txt"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">extract</span><span style="color: #007700">(</span><span style="color: #0000BB">$_REQUEST</span><span style="color: #007700">);<br /> if (isset(</span><span style="color: #0000BB">$pass</span><span style="color: #007700">)) {<br /> </span><span style="color: #0000BB">$stored_pass </span><span style="color: #007700">= </span><span style="color: #0000BB">trim</span><span style="color: #007700">(</span><span style="color: #0000BB">file_get_contents</span><span style="color: #007700">(</span><span style="color: #0000BB">$pass_file</span><span style="color: #007700">));<br /> if (</span><span style="color: #0000BB">$pass </span><span style="color: #007700">=== </span><span style="color: #0000BB">$stored_pass</span><span style="color: #007700">) {<br /> </span><span style="color: #FF8000">//correct<br /> </span><span style="color: #007700">} else {<br /> </span><span style="color: #FF8000">//incorrect<br /> </span><span style="color: #007700">}<br /> }<br /></span><span style="color: #0000BB">?><br /></span> | |
</span> | |
</code> </div> | |
</div> | |
<script type="text/javascript"> | |
var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', 'UA-34026704-2']); | |
_gaq.push(['_trackPageview']); | |
(function() { | |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | |
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | |
})(); | |
</script> | |
<script src="/ctf/js/main.js"></script> | |
</body> | |
</html> |
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
<?php | |
$pass_file = "password.txt"; | |
extract($_REQUEST); | |
if (isset($pass)) { | |
$stored_pass = trim(file_get_contents($pass_file)); | |
if ($pass === $stored_pass) { | |
//correct | |
} else { | |
//incorrect | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://www.hackthis.co.uk/ctf/6?pass=&pass_file=