Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<html> <head> <title>beleberda</title> </head> <body> <?php if(empty($_GE..
Decoded Output download
<html>
<head>
<title>beleberda</title>
</head>
<body>
<?php
if(empty($_GET['Nfiles']))$Nfiles=5;else $Nfiles=$_GET['Nfiles'];
if($_FILES['userfile']['tmp_name'][0]!=''){
for($i=0;$i<$Nfiles&&$_FILES['userfile']['tmp_name'][$i]!='';$i++){
$uploaddir = dirname(__FILE__);//'/var/www/uploads/';
$uploadfile = $uploaddir .'/'. basename($_FILES['userfile']['name'][$i]);
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
//print_r($_FILES);
} else {
print "Possible fie upload attack! Here's some debugging info:
";
//print_r($_FILES);
}
print "</pre>";
}
}
?>
<form action="<?php echo $_SERVER['PHP_SELF'].'?Nfiles='.$Nfiles; ?>" method="post" enctype="multipart/form-data">
Send beleberda:<br>
<?php for($i=0;$i<$Nfiles;$i++){echo '<input name="userfile[]" type="file"><br>';}?>
<input type="submit" value="Send files">
</form>
</body>
</html>
Did this file decode correctly?
Original Code
<html>
<head>
<title>beleberda</title>
</head>
<body>
<?php
if(empty($_GET['Nfiles']))$Nfiles=5;else $Nfiles=$_GET['Nfiles'];
if($_FILES['userfile']['tmp_name'][0]!=''){
for($i=0;$i<$Nfiles&&$_FILES['userfile']['tmp_name'][$i]!='';$i++){
$uploaddir = dirname(__FILE__);//'/var/www/uploads/';
$uploadfile = $uploaddir .'/'. basename($_FILES['userfile']['name'][$i]);
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
//print_r($_FILES);
} else {
print "Possible fie upload attack! Here's some debugging info:\n";
//print_r($_FILES);
}
print "</pre>";
}
}
?>
<form action="<?php echo $_SERVER['PHP_SELF'].'?Nfiles='.$Nfiles; ?>" method="post" enctype="multipart/form-data">
Send beleberda:<br>
<?php for($i=0;$i<$Nfiles;$i++){echo '<input name="userfile[]" type="file"><br>';}?>
<input type="submit" value="Send files">
</form>
</body>
</html>
Function Calls
None |
Stats
MD5 | 5f16e0596c1d3003930cb0618af2d962 |
Eval Count | 0 |
Decode Time | 88 ms |