Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <pre>
- <?
- set_time_limit(0);
- /// this code made for hashcat cracked passwords, change the decrypted hashes user:hash to -> user:pass
- // coded by z3ro
- $toreplace ="www.victem.com_found10.txt";
- $fromorginal ="www.victem.com_hashes.txt";
- $replaced_clean = hash_by_line_to_replace($toreplace , $fromorginal);
- function hash_by_line_to_replace($toreplace , $fromorginal)
- {
- // geting the decoded hash value and spilt the hash and its value to array
- $fh = fopen($toreplace, "r");
- while ($row = fgets($fh))
- {
- $hash_data_row = trim($row);
- $password = trim(array_pop(explode(':', $hash_data_row)));
- $hash = trim(substr($hash_data_row, 0, strrpos( $hash_data_row, ':')));
- // geting from the orginal hash file the username and replace the hash with its value
- $content = fopen($fromorginal, "r");
- while ($row = fgets($content))
- {
- $userdata = explode(" ", $row);
- if(trim($userdata[1]) == trim($hash))
- {
- //echo "userdata 1 == hash ". $userdata[1] ."\n";
- //echo "userdata 0 == username " . $userdata[0] ."\n";
- //echo "string_to_replace == hash ". $hash ."\n";
- $user_login_info = $userdata[0] .':'. $password."\n";
- $replaced_clean = file_put_contents('clean_decoded_'.$fromorginal, $user_login_info, FILE_APPEND);
- if($replaced_clean)
- {
- echo 'insert into clean_decoded_'.$fromorginal.' values '. $user_login_info;
- }
- }
- }
- fclose($content);
- }
- fclose($fh);
- }
- ?>
Add Comment
Please, Sign In to add comment