Re: Duda con módulo HTTP::Proxy
Publicado: 2013-04-04 11:38 @526
¡Qué raro!, ahora de repente funciona, ayer no funcionó. Ahora sí funciona con el mismo código
Ahora estoy subiendo un archivo y necesito mostrar el "content" que volqué acá:
El código no cambió mucho:
El problema es que no aparece nada.
¿ Qué hay que hacer en este caso ?
Ahora estoy subiendo un archivo y necesito mostrar el "content" que volqué acá:
Using text Syntax Highlighting
[+] Proxy server Online in port 8080
soy el agente : Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.
0
$VAR1 = bless( {
'_protocol' => 'HTTP/1.1',
'_content' => '-----------------------------8283483225031
Content-Disposition: form-data; name="archivo"; filename="GFWLIVESetupLog.txt"
Content-Type: text/plain
l i v e R e d i s t : 0
G F W L C l i e n t : 0
-----------------------------8283483225031
Content-Disposition: form-data; name="destino"
C:/perl/test.txt
-----------------------------8283483225031--
',
'_uri' => bless( do{\(my $o = 'http://localhost/shell.php?uploa
d=')}, 'URI::http' ),
'_headers' => bless( {
'user-agent' => 'Mozilla/5.0 (Windows NT
5.1; rv:19.0) Gecko/20100101 Firefox/19.0',
'accept' => 'text/html,application/xhtml
+xml,application/xml;q=0.9,*/*;q=0.8',
'accept-language' => 'es-ar,es;q=0.8,en-
us;q=0.5,en;q=0.3',
'cookie' => 'PHPSESSID=a8bkktvsripf6agpi
fnma61qq4',
'content-length' => '378',
'host' => 'localhost',
'via' => '1.1 doddy-701c8cb49 (HTTP::Pro
xy/0.20)',
'content-type' => 'multipart/form-data;
boundary=---------------------------8283483225031',
'x-forwarded-for' => '127.0.0.1',
'referer' => 'http://localhost/shell.php
?upload='
}, 'HTTP::Headers' ),
'_method' => 'POST'
}, 'HTTP::Request' );
soy el agente : Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.
0
$VAR1 = bless( {
'_protocol' => 'HTTP/1.1',
'_content' => '-----------------------------8283483225031
Content-Disposition: form-data; name="archivo"; filename="GFWLIVESetupLog.txt"
Content-Type: text/plain
l i v e R e d i s t : 0
G F W L C l i e n t : 0
-----------------------------8283483225031
Content-Disposition: form-data; name="destino"
C:/perl/test.txt
-----------------------------8283483225031--
',
'_uri' => bless( do{\(my $o = 'http://localhost/shell.php?uploa
d=')}, 'URI::http' ),
'_headers' => bless( {
'user-agent' => 'Mozilla/5.0 (Windows NT
5.1; rv:19.0) Gecko/20100101 Firefox/19.0',
'accept' => 'text/html,application/xhtml
+xml,application/xml;q=0.9,*/*;q=0.8',
'accept-language' => 'es-ar,es;q=0.8,en-
us;q=0.5,en;q=0.3',
'cookie' => 'PHPSESSID=a8bkktvsripf6agpi
fnma61qq4',
'content-length' => '378',
'host' => 'localhost',
'via' => '1.1 doddy-701c8cb49 (HTTP::Pro
xy/0.20)',
'content-type' => 'multipart/form-data;
boundary=---------------------------8283483225031',
'x-forwarded-for' => '127.0.0.1',
'referer' => 'http://localhost/shell.php
?upload='
}, 'HTTP::Headers' ),
'_method' => 'POST'
}, 'HTTP::Request' );
Coloreado en 0.000 segundos, usando GeSHi 1.0.8.4
El código no cambió mucho:
Using perl Syntax Highlighting
- #!usr/bin/perl
- #A simple Proxy Server
- #Coded By Doddy H
- #ppm install http://theoryx5.uwinnipeg.ca/ppms/HTTP-Proxy.ppd
- use HTTP::Proxy;
- use HTTP::Proxy::BodyFilter::simple;
- use HTTP::Proxy::BodyFilter::complete;
- use Data::Dumper;
- my $port = "8080";
- my $logs = "logs.txt";
- print "\n\n[+] Proxy server Online in port $port\n\n";
- my $server = HTTP::Proxy->new(port=>$port);
- $server->host();
- $server->push_filter(mime=>undef,response => HTTP::Proxy::BodyFilter::complete->new());
- $server->push_filter(
- mime=>undef,
- request=>HTTP::Proxy::BodyFilter::simple->new(\&enable),
- response => HTTP::Proxy::BodyFilter::simple->new(\&enable2));
- $server->start();
- sub enable {
- my @logs;
- my($a,$b,$c,$d,$e) = @_;
- my ($f,$g)=($c->header("cookie"),$c->header("x-requested-with"));
- my ($h,$i)=($c->header("content-type"),$c->header("content"));
- print "soy el agente : ".$c->header("user-agent")."\n";
- print Dumper $c;
- savefile($logs,"\n[Peticion] : ".$c->method." ".$c->uri);
- savefile($logs,"[Cookie] : ".$f) if $f;
- savefile($logs,"[x-requested-with] : ".$g) if $g;
- savefile($logs,"[Content Type] : ".$h) if $h;
- savefile($logs,"[Content] : ".$i) if $i;
- savefile($logs,"");
- }
- sub enable2 {
- my ($j,$k,$l,$m,$n) = @_;
- savefile($logs,"\n\n[START]\n\n".$$k."\n\n[END]\n") if $$k ne "";
- }
- sub savefile {
- open (SAVE,">>".$_[0]);
- print SAVE $_[1]."\n";
- close SAVE;
- }
- # ¿ The End ?
Coloreado en 0.005 segundos, usando GeSHi 1.0.8.4
El problema es que no aparece nada.
¿ Qué hay que hacer en este caso ?