aussieaubs has asked for the wisdom of the Perl Monks concerning the following question:

I am testing out my webserver and am looking for a way to spoof my own IP address. I know how to get a webpage with perl but how do I spoof my own ip with a random number so that my usage statistics can be correctly tested and show IP's from different groups. I hope you can help thanks Auzzie.

Replies are listed 'Best First'.
•Re: How to mask my IP address
by merlyn (Sage) on Jan 08, 2004 at 19:06 UTC
      LOL

      Maybe I should try that.... ;-)
Re: How to mask my IP address
by liz (Monsignor) on Jan 08, 2004 at 20:10 UTC
    If you're using mod_perl, you might want to have a look at the remote_ip method: it also allows you to set the remote IP number of the request.

    Liz

Re: How to mask my IP address
by hardburn (Abbot) on Jan 08, 2004 at 18:44 UTC

    Find a public web proxy and put your browser's connection through it.

Re: How to mask my IP address
by revdiablo (Prior) on Jan 08, 2004 at 19:34 UTC

    This is not really a Perl question, and it depends on your operating system. Rather than spoofing your actual IP address, though, perhaps you could just insert some bogus entries into the log directly. Copy a real log entry, paste it, and change the IP. Easy Cheesy.

Re: How to mask my IP address
by Anonymous Monk on Jan 08, 2004 at 19:16 UTC

    In your script:

    BEGIN { $ENV{REMOTE_ADDR} = join".",map int rand 256,0..3 }

    Ok, maybe this idea sucks. Still was worth a shot.

Re: How to mask my IP address
by NetWallah (Canon) on Jan 08, 2004 at 21:23 UTC
    If you want to generate custom IP packets (Specifying source IP address), you will need something like libnet and/or winpcap (For Windows) - there is also a *nix pcap (Which Windows shamelessly copied).

    "When you are faced with a dilemma, might as well make dilemmanade. "
Re: How to mask my IP address
by Abigail-II (Bishop) on Jan 09, 2004 at 10:53 UTC
    There are thousands and thousands of IP numbers in the private ranges (i.e. 10.*.*.*). Take such an IP number, use it next to your normal address, adjust your routing table, and there you go.

    Repeat when necessary.

    Of course, this has nothing to do with Perl.

    Abigail

Re: How to mask my IP address
by jjhayes84 (Novice) on Jan 09, 2004 at 02:21 UTC
    yeah, i used libnet once to write a C program to forge packets for a similar purpose, but i don't have that program anymore. sorry!