title: Form submission for logging in with perl
body: <p>I installed DVWA and got on to try the challenges (all the database/configs are done correctly) and the login creds on localhost are admin:password. these work when I am trying to login manually.</p>
  
  <p>I would like to write a perl script to bruteforce the bruteforce login challenge, however I cannot get to that page.</p>
  
  <p>I use the following code to login in login.php, but it doesn't work. I am using Mechanize (previously used UserAgent pm but failed, so moved to this one after endless google searches)</p>
  
  <pre><code>1 #! /usr/bin/perl
  2 
  3 use WWW::Mechanize ;
  4 
  5 my $mech = WWW::Mechanize-&gt;new(autocheck =&gt;1);
  6 $mech-&gt;credentials('admin'=&gt;'password');
  7 $mech-&gt;get('http://localhost/dvwa/login.php');
  8 print $mech-&gt;content();
  </code></pre>
  
  <p>the 8th line prints the contents of the login page. What is wrong with my code and what should I do to access the main page? Should I manually redirect to it after logging in ??</p>