Directory uitlezen
Dit script kan worden gebruik voor het uilezen van een directory als er al bevoorbeeld een index.php bestand is.
Alles kan worden ingesteld op de eerste lijntjes
Script kan je hier downloaden:
http://www.dark.uwhost2.net/scripts/explorer/explorer.zip
Gesponsorde koppelingen
PHP script bestanden
18 reacties op 'Directory uitlezen'
Gesponsorde koppelingen
Mooi script, alleen als je naar http://www.dark.uwhost2.net/scripts/explorer/ gaat dan zie ik ook al je VTI mappen, ik weet niet of je dat erg vindt, want zodra ik dan ergens op klik en weer terug ga zijn ze weg...
Misschien een beveiligings lek...
Misschien een beveiligings lek...
http://www.dark.uwhost2.net/scripts/explorer/?dir=../../../
Niet erg veilig...
Voor de rest een goed script :).
Niet erg veilig...
Voor de rest een goed script :).
Ben al een tijdje bezig met het script om een directory uit te lezen, maar omdat de scandir(PHP5 verzie) veranderd moest worden heb ik hem verandert naar opendir,readir en glob, maar hij werkt niet echt meer. Glob werkt gedeeltelijk, maar met readdir en opendir werkt het niet meer. Waar nu het mapje upload staat zouden eigenlijk nog veel meer directories en bestanden moeten staan, maar hij gaat niet verder dat alleen het mapje upload:(
Dit is de link dan kun je zien wat er gebeurt.
http://www.longhornstars.nl/index.php
Er zit ergens geen loop in volgens mij. En als je op het mapje klikt krijg ik een foutmelding. Nu ben ik er al een tijd mee bezig om het goed te krijgen, maar ik zie wat over het hoofd!
Kan iemand mij helpen hiermee?
hier het aangepaste script:
<html>
<head>
<title></title>
<style type="text/css">
body{
background: #F7F7F7;
}
body,td{
color: #000000;
margin: 0px;
font-family: Tahoma;
font-size: 11px;
}
A:link {
color : #000000;
text-decoration: none;
}
A:visited {
color : #000000;
text-decoration: none;
}
A:hover {
color : #000000;
text-decoration: none;
}
A:active {
color : #000000;
text-decoration: none;
}
img{
border: 0px;
}
td.title{
border: 1px solid #F7F7F7;
}
</style>
</head>
<body>
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td bgcolor="#F3F3F3" style="height: 40px;padding-left: 5px;" valign="middle">
<a href="javascript:history.back()" title="Vorige"><img src="img/vorige.png" alt="Vorige"></a>  
<a href="javascript:history.next()" title="Volgende"><img src="img/volgende.png" alt="Volgende"></a>  
</td></tr>
</table>
Dit is de link dan kun je zien wat er gebeurt.
http://www.longhornstars.nl/index.php
Er zit ergens geen loop in volgens mij. En als je op het mapje klikt krijg ik een foutmelding. Nu ben ik er al een tijd mee bezig om het goed te krijgen, maar ik zie wat over het hoofd!
Kan iemand mij helpen hiermee?
hier het aangepaste script:
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
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
<?php
error_reporting(E_ALL);
set_time_limit(0);
ob_implicit_flush();
/*
Config variabelen
*/
$cfg['plugins']='plugins/'; //plugins directory
$cfg['root']='upload'; // De begin directory
$cfg['dir_t']='';
$cfg['dir']=$cfg['root'];
$cfg['notshow']=array();
$cfg['length_file']=40; //De uitleg van een bestand word afgekapt achter
/*
Plugins laden
*/
$plugins=glob($cfg['plugins']);
$c_plugins=count($plugins);
for($a=0;$a<$c_plugins;$a++){
if($plugins[$a] != '.' && $plugins[$a] != '..' && is_file($cfg['plugins'].$plugins[$a])){
include($cfg['plugins'].$plugins[$a]);
}
}
/*
?dir behandelen
*/
include("plugins/handlesize.php");
include("plugins/handlefile.php");
include("plugins/handleicon.php");
include("plugins/handlelength.php");
If(isset($_GET['dir'])){
$parts=explode('.', $_GET['dir']);
$ext=strtolower($parts[count($parts)-1]);
if(is_dir($cfg['root'].'/'.$_GET['dir']) && substr_count($_GET['dir'], '../') == 0 ){
$cfg['dir']=$cfg['root'].'/'.$_GET['dir'];
$cfg['dir']=str_replace('//', '/', $cfg['dir']);
$cfg['dir_t']=$_GET['dir'];
$cfg['dir_t']=str_replace('//', '/', $cfg['dir_t']);
}
elseif(is_file($cfg['root'].'/'.$_GET['dir']) && substr_count($_GET['dir'], '../') == 0){
header('Location: /'.$_GET['dir']);
}
else{
$canthandle=$_GET['dir'];
}
}
/*
Directory ophalen
*/
$files=glob($cfg['dir']);
$count=count($files);
$b=0;
if($count == 2){
unset($files);
$files[]='..';
$files[]='';
$count = 2;
}
for($a=0;$a<$count;$a++){
if($files[$a] == '..'){
$higher_level=TRUE;
}
elseif($files[$a] != '.' && !in_array($cfg['dir'].'/'.$files[$a], $cfg['notshow'])){
$files_g[]=$files[$a];
$b++;
}
}
natcasesort($files_g);
unset($files);
foreach($files_g as $file){
if($file != ''){
if(is_dir($cfg['dir'].'/'.$file)){
$dirs[]=array($file, handlesize($cfg['dir'].'/'.$file), 'Map', date('d/m/Y H:i', filemtime($cfg['dir'].'/'.$file)));
}
else{
$files[]=array($file, handlesize($cfg['dir'].'/'.$file, 1), handlelength(handledescriptrion($file), $cfg['length_file']), date('d/m/Y H:i', filemtime($cfg['dir'].'/'.$file)));
}
}
}
/*
Html headers
*/
?>
error_reporting(E_ALL);
set_time_limit(0);
ob_implicit_flush();
/*
Config variabelen
*/
$cfg['plugins']='plugins/'; //plugins directory
$cfg['root']='upload'; // De begin directory
$cfg['dir_t']='';
$cfg['dir']=$cfg['root'];
$cfg['notshow']=array();
$cfg['length_file']=40; //De uitleg van een bestand word afgekapt achter
/*
Plugins laden
*/
$plugins=glob($cfg['plugins']);
$c_plugins=count($plugins);
for($a=0;$a<$c_plugins;$a++){
if($plugins[$a] != '.' && $plugins[$a] != '..' && is_file($cfg['plugins'].$plugins[$a])){
include($cfg['plugins'].$plugins[$a]);
}
}
/*
?dir behandelen
*/
include("plugins/handlesize.php");
include("plugins/handlefile.php");
include("plugins/handleicon.php");
include("plugins/handlelength.php");
If(isset($_GET['dir'])){
$parts=explode('.', $_GET['dir']);
$ext=strtolower($parts[count($parts)-1]);
if(is_dir($cfg['root'].'/'.$_GET['dir']) && substr_count($_GET['dir'], '../') == 0 ){
$cfg['dir']=$cfg['root'].'/'.$_GET['dir'];
$cfg['dir']=str_replace('//', '/', $cfg['dir']);
$cfg['dir_t']=$_GET['dir'];
$cfg['dir_t']=str_replace('//', '/', $cfg['dir_t']);
}
elseif(is_file($cfg['root'].'/'.$_GET['dir']) && substr_count($_GET['dir'], '../') == 0){
header('Location: /'.$_GET['dir']);
}
else{
$canthandle=$_GET['dir'];
}
}
/*
Directory ophalen
*/
$files=glob($cfg['dir']);
$count=count($files);
$b=0;
if($count == 2){
unset($files);
$files[]='..';
$files[]='';
$count = 2;
}
for($a=0;$a<$count;$a++){
if($files[$a] == '..'){
$higher_level=TRUE;
}
elseif($files[$a] != '.' && !in_array($cfg['dir'].'/'.$files[$a], $cfg['notshow'])){
$files_g[]=$files[$a];
$b++;
}
}
natcasesort($files_g);
unset($files);
foreach($files_g as $file){
if($file != ''){
if(is_dir($cfg['dir'].'/'.$file)){
$dirs[]=array($file, handlesize($cfg['dir'].'/'.$file), 'Map', date('d/m/Y H:i', filemtime($cfg['dir'].'/'.$file)));
}
else{
$files[]=array($file, handlesize($cfg['dir'].'/'.$file, 1), handlelength(handledescriptrion($file), $cfg['length_file']), date('d/m/Y H:i', filemtime($cfg['dir'].'/'.$file)));
}
}
}
/*
Html headers
*/
?>
<html>
<head>
<title></title>
<style type="text/css">
body{
background: #F7F7F7;
}
body,td{
color: #000000;
margin: 0px;
font-family: Tahoma;
font-size: 11px;
}
A:link {
color : #000000;
text-decoration: none;
}
A:visited {
color : #000000;
text-decoration: none;
}
A:hover {
color : #000000;
text-decoration: none;
}
A:active {
color : #000000;
text-decoration: none;
}
img{
border: 0px;
}
td.title{
border: 1px solid #F7F7F7;
}
</style>
</head>
<body>
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td bgcolor="#F3F3F3" style="height: 40px;padding-left: 5px;" valign="middle">
<a href="javascript:history.back()" title="Vorige"><img src="img/vorige.png" alt="Vorige"></a>  
<a href="javascript:history.next()" title="Volgende"><img src="img/volgende.png" alt="Volgende"></a>  
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
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
<?php
if(isset($higher_level)){
$parts=explode('/', $cfg['dir']);
$to='';
for($a=0;$a<count($parts)-1;$a++){
$to.='/'.$parts[$a];
}
$to=str_replace('//', '/', $to);
$to=str_replace($cfg['root'].'/', '', $to);
if(empty($_GET['dir']))$_GET['dir']='';
if($to != '/' && $_GET['dir'] != '' && $to != ''){
if($to == $cfg['root']){
$to='';
}
echo '<a href="?dir='.$to.'" title="omhoog"><img src="img/omhoog.png" alt="omhoog"></a>';
}
else{
echo '<img src="img/omhoog_dark.png" alt="omhoog">';
}
}
else{
echo '<img src="img/omhoog_dark.png" alt="omhoog">';
}
if(isset($canthandle)){
echo '<br>Er is een fout opgetreden bij het openen van '.$canthandle;
}
?>
if(isset($higher_level)){
$parts=explode('/', $cfg['dir']);
$to='';
for($a=0;$a<count($parts)-1;$a++){
$to.='/'.$parts[$a];
}
$to=str_replace('//', '/', $to);
$to=str_replace($cfg['root'].'/', '', $to);
if(empty($_GET['dir']))$_GET['dir']='';
if($to != '/' && $_GET['dir'] != '' && $to != ''){
if($to == $cfg['root']){
$to='';
}
echo '<a href="?dir='.$to.'" title="omhoog"><img src="img/omhoog.png" alt="omhoog"></a>';
}
else{
echo '<img src="img/omhoog_dark.png" alt="omhoog">';
}
}
else{
echo '<img src="img/omhoog_dark.png" alt="omhoog">';
}
if(isset($canthandle)){
echo '<br>Er is een fout opgetreden bij het openen van '.$canthandle;
}
?>
</td></tr>
</table>
Om te reageren heb je een account nodig en je moet ingelogd zijn.
- Details
Door:
Bram Z- 8 jaar geleden
- 598 x bekeken
- Labels
- Geen tags toegevoegd.
- PHP scripts opties
- Overig
- Nieuwste PHP scripts
- PHP script toevoegen


PHP hulp
0 seconden vanaf nu