Jump to content
Sonny57

[ISR] Directory / Files Disclosure PHP

Recommended Posts

Posted (edited)

Screenshot: http://i39.tinypic.com/2dvmjxl.png

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta id="e_vb_meta_bburl" name="vb_meta_bburl" content="/board" />
<base href="/board/" /><!--[if IE]></base><![endif]-->
<meta name="generator" content="vBulletin 4.0.0" />
<meta name="keywords" content="" />
<meta name="description" content="Home" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts/reset-fonts.css" />
<link rel="stylesheet" type="text/css" href="http://insecurity.ro/board/css.php?styleid=19&langid=1&d=1270943413&td=ltr&sheet=vbulletin.css,popupmenu.css,vbulletin-chrome.css,components.css,vbulletin-formcontrols.css" />

<title>Directory / Files Disclosure</title>

<!--<link rel="stylesheet" type="text/css" href="clientscript/yui/grids.css" />-->

<link rel="stylesheet" type="text/css" href="css.php?styleid=19&langid=1&d=1270943413&td=ltr&sheet=vbulletin-formcontrols.css,vbcms.css,bbcode.css,postbit-lite.css,postlist.css,editor.css,lightbox.css" />
<script type="text/javascript" src="clientscript/vbulletin_overlay.js?v=400"></script>
<script type="text/javascript" src="clientscript/vbulletin_cms.js?v=400"></script>
<script type="text/javascript" src="clientscript/vbulletin_ajax_htmlloader.js?v=400"></script>
<link rel="stylesheet" type="text/css" href="css.php?styleid=19&langid=1&d=1270943413&sheet=forumbits.css" /><script src="clientscript/gcbos.js"></script><script type="text/javascript" language="javascript" src="lytebox/lytebox.js"></script><link rel="stylesheet" type="text/css" href="css.php?styleid=19&langid=1&d=1270943413&sheet=lytebox.css" />
</head>
<body style="text-align:left">
<div id="brd_outer">
<div id="brd_in">
<div class="above_body"> <!-- closing tag is in template navbar -->
<div id="header" class="floatcontainer doc_header">
<br>
<div align="center"><a name="top" href="http://insecurity.ro/board/forum.php" class="logo-image"><img src="http://insecurity.ro/board/graphite/misc/header_logo.gif" /></a></div>
<div class="ad_global_header">
</div>
<hr />
</div><br>
<div id="navbar" class="navbar">
<ul id="navtabs" class="navtabs floatcontainer">
<li class="selected">
<a class="navtab" href="http://insecurity.ro/board/content.php">Home</a>
</li>
<li><a class="navtab" href="http://insecurity.ro/board/forum.php">Forum</a></li>
<li><a class="navtab" href="http://insecurity.ro/board/blog.php">Blogs</a></li>
<li><a class="navtab" href="#">Directory / Files Disclosure</a></li>
</ul>
<div id="nav_btm"></div>
</div>
</div><!-- closing div for above_body -->
<div class="body_wrapper">
<div id="breadcrumb" class="breadcrumb">
</div>
<div id="footer" class="floatcontainer footer">
<div class="footer_select">
<pre>
<?php

/*
* Sample function to recursively return all files within a directory.
* http://www.pgregg.com/projects/php/code/recursive_readdir.phps
* Author: Paul Gregg
* http://www.pgregg.com
*
* For a more robust and featureful recursive directory listing tool
* have a look at preg_find:
* http://www.pgregg.com/projects/php/preg_find/preg_find.phps
* Example uses: http://www.pgregg.com/forums/viewtopic.php?tid=73
*/

Function listdir($start_dir='.') {

$files = array();
if (is_dir($start_dir)) {
$fh = opendir($start_dir);
while (($file = readdir($fh)) !== false) {
# loop through the files, skipping . and .., and recursing if necessary
if (strcmp($file, '.')==0 || strcmp($file, '..')==0) continue;
$filepath = $start_dir . '/' . $file;
if ( is_dir($filepath) )
$files = array_merge($files, listdir($filepath));
else
array_push($files, $filepath);
}
closedir($fh);
} else {
# false if the function was called with an invalid non-directory argument
$files = false;
}

return $files;

}

$files = listdir('.');
print_r($files);
?>
</pre>
<br /><br /><br />
</div>
</div>
</div> <!-- closing div for body_wrapper -->
<div class="below_body">
<div id="footer_copyright" class="shade footer_copyright">
TinKode @ ISR : <a href="http://insecurity.ro">inSecurity.ro</a>
</div>
</div>
</div></div>
</body>
</html>

Save as directory.php and upload on a host, and you'll see all directories and files.

TinKode@ISR

Edited by Sonny57

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...