Let’s get started with the tutorial.
First of all I am going to create a form where you’ll have to input the URL of the website.
Create a basic HTML platform in a new text file with HTML, BODY, TITLE tag etc.
Creating a form:
PHP Code:
<form action=”adminsearch.php” method=”post”>
<p><input type=”text” size=”120″ value=”http://www.website.com/”/>
<input value=”find” type=”submit”><br />
</form>
What we are going to do in PHP magic is to search the specified directory. Many websites usually keeps the administrator page separately on the folder with specific name given.
What we are going to do is execute the following code and find the administrator page folder.
Trying out and guessing different form might be tedious job therefore, we’ll create a new text file named folders.txt with the list of our guessed directory.
PHP Code:
<?php
/** Let’s ensure that the page does not timeout unexpectedly hampering our search job**/
set_time_limit(0);
$Target = $_POST['targetSite'];
//this function will only execute if the target is provided.
if ($Target <> “”) {
echo ‘<br /> Starting <br />’;
$url = $_POST['targetSite'];
echo “<br />Targeting: “.$Target.” <br /><br />”;
//This function will check for the file named folders.txt which contains the list of suspected administrator folders.
$MasterList = ‘folders.txt’;
// This function will clear the cache to ensure that the status of the file is checked
clearstatcache();
if (file_exists($MasterList)) {
echo “Retrieving List <br />”;
} else {
echo “The file $MasterList does not exist”;
}
//Open the file and assign each line to a new element in the array
//Once completed, close the file
$fHandler = fopen($MasterList, “r”);
while (! feof($fHandler)) {
$thisline = fgets($fHandler);
$adminfolder = file($MasterList);
}
fclose($fHandler);
//This function will try to access each URL and returns the list of URLs that do not respond with 404 error(Page not found error)
foreach ($adminfolder as $adminurl){
$headers = get_headers(“$Target$adminurl”);
if (eregi(‘Not Found’, $headers[0])) {
echo “$Target$adminurl NO!<br />”;
}
else {
echo “<a href=’$Target$adminurl’>$Target$adminurl</a> Here is the URL of ADMIN Page!<br />”;
}
}
}
?>
Now finally lets arrange the whole thing that we’ve created in one place.
Create new text file or use dreamweaver and copy the form and paste below the form paste the PHP code. Finally rename it as adminsearch.php
Place both adminsearch.php and folders.txt in one separate folder and upload it to your web host or local host. Go to the URL that have adminsearch.php and hunt for the administrator’s page for the target website.
Now since you got the location of administrator page, you can play something further to hack in to administrator’s page.
The tutorial is not mine! Copyrighted by Suraj Kayastha






