Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- body {
- font-family: monospace;
- }
- </style>
- <?php
- $mtime = microtime();
- $mtime = explode(" ",$mtime);
- $mtime = $mtime[1] + $mtime[0];
- $starttime = $mtime;
- if ( $argv[1] != NULL ) {
- $num = $argv[1];
- } else {
- if ( $_GET['amt'] != NULL ) {
- $num = $_GET['amt'];
- } else {
- $num = 1000;
- }
- }
- if ( date("G") < 9 ) {
- if ( $num > 500 ) {
- $num = 500;
- }
- }
- // initial variables
- $username = "";
- $password = "";
- $database = "";
- $hash_engine = array('md2','md4','md5','sha1','sha256','sha384','sha512');
- // conenct to the mysql server
- $connect = mysql_connect( localhost, $username, $password );
- @ mysql_select_db( $database );
- function hstr($input, $method) {
- if ( $method == "encode" ) {
- $s = str_split($input);
- for ($y=0; $y<sizeof($s); $y ++) {
- $end = $end . str_pad(dechex(ord($s[$y])), 2, "0", STR_PAD_LEFT);
- }
- return $end;
- }
- if ( $method == "decode" ) {
- for ($y=0; $y<strlen($input)/2; $y ++) {
- $end = $end . chr(hexdec( substr($input, $y*2, 2) ));
- }
- return $end;
- }
- }
- $result = mysql_query( "SELECT * FROM info" );
- $row = mysql_fetch_array( $result );
- $start = $row['last_gen'];
- echo $start;
- for ($i=1; $i<strlen($start)/2+1; $i++) {
- $myarray[$i] = hexdec(substr($start, strlen($start)-$i*2, 2));
- }
- for ( $i=0; $i<$num; $i++ ) {
- $myarray[1] += 1;
- for ($k=0; $k<sizeof($myarray)+1; $k++) {
- if ( $myarray[$k] > 255 ) {
- $myarray[$k] = 0;
- $myarray[$k+1] += 1;
- }
- }
- $final = "";
- for ($j=0; $j<sizeof($myarray); $j++) {
- $myarray2[$j] = dechex($myarray[sizeof($myarray)-$j]);
- $final = $final . str_pad($myarray2[$j], 2, "0", STR_PAD_LEFT);
- }
- // begin
- $s2 = hstr($final, "decode");
- $result = "SELECT * FROM md5 WHERE plain_text = '$final'";
- mysql_real_escape_string( $result );
- $result = mysql_query( $result );
- $row = mysql_fetch_array( $result );
- if ($row['plain_text'] == NULL) {
- mysql_query( "UPDATE info SET hashcount = hashcount+1" );
- $add_percent = true;
- }
- for ( $l = 0; $l < sizeof($hash_engine); $l++ ) {
- $hash = hash($hash_engine[$l], $s2);
- $query = "INSERT INTO $hash_engine[$l] (hash, plain_text, timestamp) VALUES ('$hash', '$final' , now() )";
- mysql_real_escape_string( $query );
- mysql_query( $query );
- if ( $add_percent == true ) {
- $mesize = strlen($final) / 2;
- // update list stats
- $result = mysql_query( "SELECT * FROM stats WHERE length = '$mesize'" );
- $row = mysql_fetch_array( $result );
- $row[$hash_engine[$l]] = $row[$hash_engine[$l]]+1;
- mysql_query( "REPLACE INTO stats (length, md2, md4, md5, sha1, sha256, sha384, sha512) VALUES ('$mesize', '$row[md2]', '$row[md4]','$row[md5]','$row[sha1]','$row[sha256]','$row[sha384]','$row[sha512]') " ) or die('a');
- }
- }
- // end
- $result = mysql_query("SELECT * FROM info");
- $row = mysql_fetch_array( $result );
- mysql_query("REPLACE INTO info (hashcount, available, searched, timestamp, last_gen) VALUES ('$row[hashcount]', '$row[available]', '$row[searched]', '$row[timestamp]', '$final')");
- $milestones = array('100', '979060', '1000000', '2500000', '5000000', '10000000', '25000000', '50000000', '100000000');
- if ($j = array_search($row['hashcount'], $milestones)) {
- mysql_query( "INSERT INTO milestones (timestamp, count) VALUES (now(), '$row[hashcount]')" );
- print("lol works\n");
- }
- usleep(100000);
- $mtime = microtime();
- $mtime = explode(" ",$mtime);
- $mtime = $mtime[1] + $mtime[0];
- $endtime = $mtime;
- $totaltime = ($endtime - $starttime);
- if ($totaltime >= 110) {
- break;
- mysql_close( $connect );
- }
- }
- print("\nGenerated $i hashes in $totaltime seconds\n");
- mysql_close( $connect );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement