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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.