Jump to content

str_replace problem


n0isy

Recommended Posts

I am making script that will include 2 files , 1. with the cracked hashes and 2. with the usernames and hashes

1. file is like : hash:salt:password , and 2. file is like is username:hash:salt

 

I want that the script loop through the 1.. file with hash:salt:password and replace every hash:salt with the password in 2. file

I have written something but it isnt working for me :(

 

<?php
$usernames=file_get_contents('users.txt');
$cracked=file('cracked.txt');
foreach($cracked as $cracked_line){
	$hashes_explode=explode(":",$cracked_line);
	$hash_salt="$hashes_explode[0]:$hashes_explode[1]";
	$plain_password=str_replace($hash_salt,$hashes_explode[2],$usernames);
	print $plain_password;
	}
print $plain_password;

?>

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.