Created
October 26, 2009 00:10
-
-
Save fitorec/218342 to your computer and use it in GitHub Desktop.
genera el logeo en el bruto.es
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
# filename: loginBruto.pl | |
# descripcion: este script intenta generar el logeo | |
# para correrlo basta con ejecutarlo en linea de comando | |
# recibe como parametros: | |
# 1er parametro: nicknameBruto | |
# 2do parametro: passwordBruto | |
# | |
use strict; | |
use CGI::Carp qw(fatalsToBrowser); | |
use LWP::UserAgent; | |
use HTTP::Request; | |
use HTTP::Cookies; | |
my $cookie_jar = HTTP::Cookies->new( | |
file => $ENV{'HOME'}.'/lwp_cookies.dat', | |
autosave => 1, | |
); | |
my $ua = LWP::UserAgent->new; | |
$ua->agent("Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)"); | |
$ua->cookie_jar($cookie_jar); | |
my $url = "http://".$ARGV[0].".elbruto.es/login"; | |
my $req = HTTP::Request->new(POST => $url,['pass' => $ARGV[1]]); | |
my $response = $ua->request($req); | |
my $content = $response->content(); | |
print "Content-type: text/html\n\n"; | |
print $content; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment