Hello gurus!
Today i was making a script with mechanize and net rawip but when i tcpdump on my machine (a machine on my lan). As you can see i put inside a sub-routine the Mechanize module then with that im calling in the rawip the subroutine with this what im getting in tcpdump is to see only the ip that i decide to put in the script but now i am watching in the nginx log and i found funny things (and questions):
use warnings;
use strict;
use Net::RawIP;
use WWW::Mechanize;
my $source = '10.10.0.253';
my $target = '10.10.0.253';
my $url = 'http://10.10.0.253';
sub browser {
my $mech = WWW::Mechanize->new();
$mech->get($url);
}
my $packet = Net::RawIP->new;
$packet->set({
ip => {
saddr => $source,
daddr => $target,
},
tcp => {
source => 8311,
dest => 80,
psh => 0,
syn => 1,
data => browser,
},
});
$packet->send;
1.- With or without subroutine ( i tried to send directly the mechanize module in the data part), the nginx is showing that im opening the webserver index.html with the original address (10.10.0.7)
2.- Is there anyway to say to mechanize that the Get that im sending cames from another part? (i tried with "proxy" but didn't got any result)
thanks in advance