Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8517039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:35:28+00:00 2026-06-11T05:35:28+00:00

I need to write a little piece of code to simulate traffic from different

  • 0

I need to write a little piece of code to simulate traffic from different source IP addresses and I’m wondering if that can be done by spoofing the addresses with Perl?

I tried Net::RAWIP and that worked, but I need to send some more complex HTTP traffic (namely POST data) and was unable to do so with RAWIP

With LWP I tried using ua->local_address but I get this response:

Can't connect to 10.x.x.x:8080

LWP::Protocol::http::Socket: Cannot assign requested address at /usr/lib/perl5/site_perl/5.10.0/LWP/Protocol/http.pm line 51.

This is the code I’m using:

#!/usr/bin/perl -w

use strict ;
use warnings ;
use LWP::UserAgent ;
use URI::URL ;

my $path = 'http://142.133.114.130:8080' ;
my $url = new URI::URL $path;
my $ua       = LWP::UserAgent->new();

$ua->local_address('10.121.132.112');
$ua->env_proxy ;
my $effing = 'blaj.jpg' ;
my $response = $ua->post( $url,
                        'Content-Type' => "multipart/form-data",
                        'Content' => [ userfile => ["$effing" ]],
                        'Connection' => 'keep-alive' ) ;
print $response->decoded_content();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:35:30+00:00Added an answer on June 11, 2026 at 5:35 am

    You can’t get a response if you send from an address that’s not yours. That means all you can do is send the request. You’ve indicated you can do the sending, so all you need is the request to send. That’s easy.

    use strict;
    use warnings;
    
    use HTTP::Request::Common qw( POST );
    
    my $req = POST('http://www.example.org/',
       'Content-Type' => "multipart/form-data",
       'Content'      => [ userfile => [ $0 ]],
       'Connection'   => 'keep-alive',
    );
    
    print $req->as_string();
    

    Output:

    POST http://www.example.org/
    Connection: keep-alive
    Content-Length: 376
    Content-Type: multipart/form-data; boundary=xYzZY
    
    --xYzZY
    Content-Disposition: form-data; name="userfile"; filename="x.pl"
    Content-Type: text/plain
    
    use strict;
    use warnings;
    
    use HTTP::Request::Common qw( POST );
    
    my $req = POST('http://www.example.org/',
       'Content-Type' => "multipart/form-data",
       'Content'      => [ userfile => [ $0 ]],
       'Connection'   => 'keep-alive',
    );
    
    print $req->as_string();
    
    --xYzZY--
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write out a piece of code that can reduce the LENGTH
I need to write a little ruby function that does word wrapping. I have
I need to write a little program in C that parses a string. I
I need to write a C++ code coverage program that takes in another C++
I want to write a little app that interacts with Photoshop. I need only
I need to write a program that retrieves information from a database and creates
I want to write a little Linux Kernel Module that can show me the
I need to write custom ord and chr functions. I'm writing a little program
I need to write a script in Matlab, which will read some data from
I need to write a program that prints 0.(03) for input 1 and 33.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.