#!/usr/bin/env ruby wordlist = [] while word = $stdin.gets wordlist.push(word) unless word.strip!.empty? end exit if wordlist.empty? File.open('passwd') do |passwd| passwd.each_line { |line| if line =~ /^([\w-]+):(..)(.*):\d+:\d+:.*:.*:.*$/ acct, seed, hash = $1, $2, $3 wordlist.each { |word| if "#{seed}#{hash}" == word.crypt(seed) puts "#{acct} : #{word}" break end } end } end