#!/usr/bin/env ruby
unless ARGV.length == 3
puts "USE: #{$0} <hash_list> <input> <output>"
exit
end
w = File.new(ARGV[2], 'w')
file = File.read(ARGV[1])
File.open(ARGV[0], 'r') do |f|
while line = f.gets
t = line.chomp.split(':')
file.gsub!(t[0], t[1])
end
end
w.puts file
seems to work
~ $ wget -q http://dl.dropbox.com/u/4378489/Forums/evilzone/hashes_found.txt
~ $ lynx -dump http://dl.dropbox.com/u/4378489/Forums/evilzone/phpbb_users.html > phpbb_users.txt
~ $ time ruby hash_sub.rb hashes_found.txt phpbb_users.txt new_phpbb_users.txt
real 0m0.388s
user 0m0.204s
sys 0m0.028s
~ $ diff phpbb_users.txt new_phpbb_users.txt
.... etc ....
< twocv6 eb4d6d44963cdab468008da180c51414 twocv@live.nl
< Suzette 3b0dd31021ff0d76d3e848b997c021c2 a.sinte@aol.com
---
> twocv6 vannelle twocv@live.nl
> Suzette passs1 a.sinte@aol.com
2256c2256
< Daphne36 db9679033bcfd3f57531fc696f64a0d5 daphnetv30@hotmail.com
---
> Daphne36 panty daphnetv30@hotmail.com
~ $ grep panty hashes_found.txt
db9679033bcfd3f57531fc696f64a0d5:panty
4606b268635276633039f7f833f7e85b:pantyhose
ae4b96fef1e6d5ad2e32f02744af7e38:pantys
623d871d9af3835a8d70d549334406fa:panty1
I used lynx to strip some HTML but the file still came out pretty ugly.