Показать сообщение отдельно

  #3  
Старый 04.09.2011, 17:05
xek
Новичок
Регистрация: 10.07.2011
Сообщений: 28
Провел на форуме:
8246

Репутация: 0
По умолчанию

Решение на PHP

Код:
admins_filename, 'r');
		$content = fread($handle, filesize($this->admins_filename));
		fclose($handle);

		if (!empty($content)) {
			preg_match_all('/(.*?)\r\n/s', $content, $match);
			foreach ($match[1] as $dir) {
				$this->admin_dirs[] = $dir;
			}
		}
	}
	
	public function getURL($url)
	{
		preg_match_all('/(?Phttp:\/\/.*?\/)/s', $url, $match);
		$this->links[] = $match['url'][0];
	}
	
	public function getLinks()
	{
		$handle = fopen($this->links_filename, 'r');
		$content = fread($handle, filesize($this->links_filename));
		fclose($handle);

		if (!empty($content)) {
			preg_match_all('/(http:\/\/.*?\/)/s', $content, $match);
			foreach ($match[1] as $link) {
				$this->links[] = $link;
			}
		}
	}
	
	public function getContent($domain, $query) 
	{
		$content = '';

		$fp = fsockopen($domain, 80, $errno, $errstr, 30);
		
		if ($fp != false) {
			$header  = "GET " . $query . " HTTP/1.1\r\n";
			$header .= "User-Agent: Opera/9.80 (Windows NT 5.1; U;) Version/11.11\r\n";
			$header .= "Host: " . $domain . "\r\n";
			$header .= "Connection: Close\r\n\r\n";
		
			fwrite($fp, $header);
			while (!feof($fp)) {
				$content .= fgets($fp);
			}
			fclose($fp);

			return $content;
		} 
		return false;
	}
	
	public function writeToFile($str = '', $option) 
	{
		$handle = fopen($this->found_filename, $option);
		fwrite($handle, $str);
		fclose($handle);
	}
	
	public function brutting()
	{
		foreach ($this->links as $link)
		{
			preg_match('/http:\/\/(?P.*)\//s', $link, $match);
			
			$domain = $match['domain'];
			
			foreach ($this->admin_dirs as $dir) {
				$content = $this->getContent($domain, '/' . $dir . '/');

				if (!empty($content)) {
					if (preg_match('/HTTP\/1.[01] (?:200 OK|302 Found|401 Authorization Required)/s', $content)) {
						echo 'http://' . $domain . '/' . $dir . '/' . "\r\n";
						$this->writeToFile('http://' . $domain . '/' . $dir . '/' . "\r\n", 'a');
					}
				}
			}
		}
	}
	
	public function __construct($argv)
	{
		$this->showInfo();
		$this->getAdminDirs();
		
		if (count($argv == 2)) {
			$this->getURL($argv[1]);
		} else {
			$this->getLinks();
		}
		$this->brutting();
	}
}

$BrutAdminPanels = new BrutAdminPanels($argv);
?>
directories.txt:

Код:
admin
-admin
admin-
_admin
admin_
Admin
_Admin
Admin_
ADMIN
_adm
adm
adm_
a
ad
ads
admins
admincp
admincms
cmsadmin
webadmin
sysadmin
camadmin
admin1
admin2
adminlogin
administrator
_administrator
administrator_
Administrator
_Administrator
Administrator_
administration
administrations
_administrations
administrations_
Administrations
_Administrations
Administrations_
adminpanel
_adminpanel
adminpanel_
AdminPanel
_AdminPanel
AdminPanel_
admindir
Admindir
admin_dir
db-admin
dbadmin
wp-admin
fileadmin
myadmin
panel
Panel
site
login
Login
logins
account
Account
accounting
acct
website
dev
webaccess
user
users
members
access
Access
cms
_cms
CMS
_CMS
controlpanel
ControlPanel
cp
CP
secret
privacy
root
_root
auth
_auth
Auth
authorization
Authorization
secure
webmaster
my
hidden
mng
manage
manager
private
В файл sites.txt ложишь список сайтов которые хочешь просканить.

Результат будет в файле found.txt.
 
Ответить с цитированием