[Seth, sorry for the repeat, meant to replyall in the first place]<br><br><div class="gmail_quote">On Tue, Apr 15, 2008 at 4:36 PM, Seth Miller <<a href="mailto:seth@animejunkie.org">seth@animejunkie.org</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello all,<br>
<br>
I've having some trouble with a script. I'm trying to grab a complete<br>
list of email accounts on the server and check the password against a<br>
word list to find weak passwords. The hash %data has the email<br>
address in the key and the account password in the value.<br>
<br>
The word list file currently just has the word 'password' for testing<br>
but it doesn't seem to be working. Here's the portion of the script<br>
that's not working<br>
<br>
#BEGIN<br>
<br>
open (WORDLIST, "<$wordlist") or die "Can't open the wordlist: $!";<br>
<br>
while (my $pass = <WORDLIST>) {</blockquote><div><br></div><div>You might need a "chomp $pass;" right here.</div><div><br></div><div>My reasoning is that your match is being done against "password[NEWLINE]", which is what you got from the <> on WORDLIST.</div>
<div><br></div><div>(I didn't test though.)</div><div><br></div><div>mike </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
while ( my ($user,$password) = each (%data) ) {<br>
print "$user - $password\n" if ($password =~ /$pass/);<br>
}<br>
}<br>
<br>
close WORDLIST;<br>
<br>
#END<br>
<br>
The while loop that iterates through the word list is working because<br>
if write a die to spit out the value of $pass, it prints the word<br>
password as expected. If I change the if statement to if ($value =~<br>
/password/) it works too.<br>
<br>
Also if I set the value of $pass manually just before the print line,<br>
it works. The script just doesn't work as it looks above. No errors<br>
or warnings, just no output. I'm assuming it has something to do with<br>
the scope of the $pass variable.<br>
<br>
Any ideas?<br>
<br>
--seth<br>
_______________________________________________<br>
Austin mailing list<br>
<a href="mailto:Austin@pm.org">Austin@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/austin" target="_blank">http://mail.pm.org/mailman/listinfo/austin</a><br>
</blockquote></div><br>