[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 &lt;<a href="mailto:seth@animejunkie.org">seth@animejunkie.org</a>&gt; 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&#39;ve having some trouble with a script. &nbsp;I&#39;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. &nbsp;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 &#39;password&#39; for testing<br>
but it doesn&#39;t seem to be working. &nbsp;Here&#39;s the portion of the script<br>
that&#39;s not working<br>
<br>
#BEGIN<br>
<br>
open (WORDLIST, &quot;&lt;$wordlist&quot;) or die &quot;Can&#39;t open the wordlist: $!&quot;;<br>
<br>
while (my $pass = &lt;WORDLIST&gt;) {</blockquote><div><br></div><div>You might need a &quot;chomp $pass;&quot; right here.</div><div><br></div><div>My reasoning is that your match is being done against &quot;password[NEWLINE]&quot;, which is what you got from the &lt;&gt; on WORDLIST.</div>
<div><br></div><div>(I didn&#39;t test though.)</div><div><br></div><div>mike&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
 &nbsp;while ( my ($user,$password) = each (%data) ) {<br>
 &nbsp; &nbsp;print &quot;$user - $password\n&quot; if ($password =~ /$pass/);<br>
 &nbsp;}<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. &nbsp;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. &nbsp;The script just doesn&#39;t work as it looks above. &nbsp;No errors<br>
or warnings, just no output. &nbsp;I&#39;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>