Hallo ,
Ich bastel grade an einem ubload script für bilder allerdings habe ich einen fehler drin den ich nicht finde
Das ganze in Action xss.kilu.de/imag
Ich bastel grade an einem ubload script für bilder allerdings habe ich einen fehler drin den ich nicht finde
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body background="background.gif" bgcolor="#272f80">
";
echo "
<center>";
echo "<br>
";
if ($_GET['id'])
{
$id = $_GET['id'];
}
else
{
die ("no id selected");
}
echo "";
echo "";
echo "";
echo "<br>
";
echo "
<table bgcolor="white" border="0">
<tbody>
<tr>
<td>";
echo "<a href="./index.php"><img src="./$path%22%20.%20$id%20.%20%22" border="0"></a>";
echo "</td>
</tr>
<tr>
<td>
<center><a href="./index.php">zurück</a></center>
</td>
</tr>
</tbody>
</table>
";
?></center>
</body>
</html>
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>EasyImageHoster - www.xss.kilu.de/imag</title>
<link rel="STYLESHEET" type="text/css" href="style.css">
</head>
<body background="background.gif" bgcolor="#272f80">
$max_size)
{
echo "<font arial="" helvetica="" sans-serif="" color="#003330" face="\"Geneva,">Datei zu groß !</font><br>
\n"; exit; }
if (($_FILES['userfile']['type']=="image/gif") ||
($_FILES['userfile']['type']=="image/pjpeg") ||
($_FILES['userfile']['type']=="image/jpeg") ||
($_FILES['userfile']['type']=="image/png")) {
// generate random signs
$zufall = rand(1,9);
$zufall2 = rand(1,26);
$buchstaben = array( "1" => "arx", "2" => "opt", "3" => "bwy",
"4" => "cqs", "5" => "viu", "6" => "rgh", "7" => "jdv", "8"
=> "klz", "9" => "bfi", );
$buchstaben2 = array( "1" => "a", "2" => "b", "3" => "c", "4"
=> "d", "5" => "e", "6" => "f", "7" => "g", "8" => "h",
"9" => "i", "10" => "j", "11" => "k", "12" => "l", "13"
=> "m", "14" => "n", "15" => "o", "16" => "p", "17" =>
"q", "18" => "r", "19" => "s", "20" => "t", "21" => "u",
"22" => "v", "23" => "w", "24" => "x", "25" => "y", "26"
=> "z", );
$unikat = $buchstaben[$zufall] . time() . $buchstaben2[$zufall2];
// upload progress
$file = $_FILES['userfile']['name'];
$new_bild = $unikat.substr($file, strrpos($file, "."));
$res = move_uploaded_file($_FILES['userfile']['tmp_name'], "./" . $path
. $new_bild);
if (!$res) { echo "<font arial="" helvetica="" sans-serif="" color="#003330" face="\"Geneva,">Fehler , probieren sie es erneut !</font><br>
\n"; exit;
}
else
{
?>
<br>
$old_y)
{
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y)
{
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y)
{
$thumb_w=$new_w;
$thumb_h=$new_h;
}
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
if (preg_match("/png/",$system[1]))
{
imagepng($dst_img,$filename);
}
if (preg_match("/gif/",$system[1]))
{
imagegif($dst_img,$filename);
}
else
{
imagejpeg($dst_img,$filename);
}
imagedestroy($dst_img);
imagedestroy($src_img);
}
createthumb($path.$imgf,$tpath.$imgf,$tsize,$tsize);
?>
<script type="text/javascript">
<!--
function highlight(field)
{
field.focus();
field.select();
}
//-->
</script>
<center>
<center>
</center>
You selected a wrong filetype!<br>
\n"; exit;
}
}
if ($tsize <= 380)
{
echo "
<table bgcolor="white" border="0">
<form action="nowhere" method="post"></form>
<tbody>
<tr>
<td>URL:</td>
<td><input name="thetext" onclick="highlight(this);" size="60" value="<? echo 'http://' .$domain .'/' ?>viewer.php?id=<? echo $imgf; ?>" type="text"></td>
</tr>
<tr>
<td>DIRECT URL:</td>
<td><input name="thetext" onclick="highlight(this);" size="60" value="<? echo $urlf; ?>" type="text"></td>
</tr>
<tr>
<td>HTML:</td>
<td><input name="thetext" onclick="highlight(this);" size="60" value="<a href="<? echo " http="" .$domain="" .="" ?="" type="text">viewer.php?id="><img src="%3C?%20echo%20%27http://%27%20.$domain.%27/%27.$tpath.$imgf;%20?%3E" border="0">'></td>
</tr>
<tr>
<td>BBCode:</td>
<td><input name="thetext" onclick="highlight(this);" size="60" value="[URL=<? echo 'http://' .$domain .'/'; ?>viewer.php?id=<? echo $imgf; ?>][IMG]<? echo 'http://' .$domain.'/'.$tpath.$imgf; ?>[/IMG][/URL]" type="text"></td>
</tr>
<tr>
<td>IMAGE:</td>
<td><a href="viewer.php?id=%3C?%20echo%20$imgf;%20?%3E"><img src="%3C?%20echo%20$thbf%20?%3E"></a></td>
</tr>
</tbody>
</table>
";
echo "";
echo "";
echo "
<table bgcolor="white" border="0" width="457">
<tbody>
<tr>
<td>
<center><a href="./index.php">zurück</a></center>
</td>
</tr>
</tbody>
</table>
";
echo "<br>
<br>
";
echo "";
}
?></center>
</body>
</html>
Das ganze in Action xss.kilu.de/imag
Zuletzt bearbeitet: