I would like to write a script to enter the web application, and then move on to other parts of the application:
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use Data::Dumper;
$ua = LWP::UserAgent->new(keep_alive=>1);
my $req = POST "http://example.com:5002/index.php",
[ user_name => 'username',
user_password => "password",
module => 'Users',
action => 'Authenticate',
return_module => 'Users',
return_action => 'Login',
];
my $res = $ua->request($req);
print Dumper(\$res);
if ( $res->is_success ) {
print $res->as_string;
}
When I try to execute this code, I cannot enter the application. The returned HTTP status code is 302, which was found, but without data.
If I send a username / password with all the necessary things, it should return the application home page and maintain a real-time connection to move other parts of the application.
source
share