Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
</body> </html> <?php $msg = ''; function gen_rando..
Decoded Output download
</body>
</html>
<?php
$msg = '';
function gen_random() {
$a = rand(1337,2600)*33;
$b = rand(2424,3543)*33;
return $a+$b;
}
function hash_func($plain) { // md5 is the best LOL
$secured_plain = check_input($plain);
return md5($secured_plain);
}
function check_input($input) { // don't trust user
$re = '/[^a-zA-Z0-9]/';
$secured_input = preg_replace($re, "", $input);
return $secured_input;
}
require_once "secret.php";
$username = check_input($_POST['username']);
$password = hash_func($_POST['password']);
$rand = gen_random();
//echo "user+rand==".$username.$rand ;
//echo "<br>";
//echo "password==".$password;
if($username != true && $password != true) {
if($username.$rand == $password) {
echo 'You have entered valid usename and password';
echo nl2br("
Well, Your flag is : " . $flag);
}
else {
$msg = 'Wrong username or password';
echo $msg;
}
}
else {
$msg = 'Check your input again ... ';
echo $msg;
}
?>
Did this file decode correctly?
Original Code
</body>
</html>
<?php
$msg = '';
function gen_random() {
$a = rand(1337,2600)*33;
$b = rand(2424,3543)*33;
return $a+$b;
}
function hash_func($plain) { // md5 is the best LOL
$secured_plain = check_input($plain);
return md5($secured_plain);
}
function check_input($input) { // don't trust user
$re = '/[^a-zA-Z0-9]/';
$secured_input = preg_replace($re, "", $input);
return $secured_input;
}
require_once "secret.php";
$username = check_input($_POST['username']);
$password = hash_func($_POST['password']);
$rand = gen_random();
//echo "user+rand==".$username.$rand ;
//echo "<br>";
//echo "password==".$password;
if($username != true && $password != true) {
if($username.$rand == $password) {
echo 'You have entered valid usename and password';
echo nl2br("\r\nWell, Your flag is : " . $flag);
}
else {
$msg = 'Wrong username or password';
echo $msg;
}
}
else {
$msg = 'Check your input again ... ';
echo $msg;
}
?>
Function Calls
None |
Stats
MD5 | 050822213231f50c581f1a2904c9fe25 |
Eval Count | 0 |
Decode Time | 45 ms |