Error[8]: Undefined offset: 4, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我需要编写一小段代码来模拟来自不同源IP地址的流量,我想知道是否可以通过使用Perl欺骗地址来实现这一点? 我尝试过Net :: RAWIP,但是我需要发送一些更复杂的HTTP流量(即POST数据),但无法使用RAWIP 使用LWP我尝试使用ua> local_address,但我得到了这个回复: Can't connect to 10.x.x.x:8080LWP::Protocol::htt 我需要编写一小段代码来模拟来自不同源IP地址的流量,我想知道是否可以通过使用Perl欺骗地址来实现这一点?

我尝试过Net :: RAWIP,但是我需要发送一些更复杂的http流量(即POST数据),但无法使用RAWIP

使用LWP我尝试使用ua> local_address,但我得到了这个回复:

Can't connect to 10.x.x.x:8080LWP::Protocol::http::Socket: Cannot assign requested address at /usr/lib/perl5/site_perl/5.10.0/LWP/Protocol/http.pm line 51.

这是我正在使用的代码:

#!/usr/bin/perl -wuse 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();
解决方法 如果您从不属于您的地址发送,则无法获得回复.这意味着您所能做的就是发送请求.您已经表明可以进行发送,因此您只需要发送请求即可.这很简单.

use strict;use warnings;use http::Request::Common qw( POST );my $req = POST('http://www.example.org/','Content'      => [ userfile => [ 
POST http://www.example.org/Connection: keep-aliveContent-Length: 376Content-Type: multipart/form-data; boundary=xYzZY--xYzZYContent-disposition: form-data; name="userfile"; filename="x.pl"Content-Type: text/plainuse strict;use warnings;use http::Request::Common qw( POST );my $req = POST('http://www.example.org/',);print $req->as_string();--xYzZY--
]],'Connection' => 'keep-alive',);print $req->as_string();

输出:

[+++] 总结

以上是内存溢出为你收集整理的使用Perl LWP欺骗IP全部内容,希望文章能够帮你解决使用Perl LWP欺骗IP所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
使用Perl LWP欺骗IP_语言综合_内存溢出

使用Perl LWP欺骗IP

使用Perl LWP欺骗IP,第1张

概述我需要编写一小段代码来模拟来自不同源IP地址的流量,我想知道是否可以通过使用Perl欺骗地址来实现这一点? 我尝试过Net :: RAWIP,但是我需要发送一些更复杂的HTTP流量(即POST数据),但无法使用RAWIP 使用LWP我尝试使用ua> local_address,但我得到了这个回复: Can't connect to 10.x.x.x:8080LWP::Protocol::htt 我需要编写一小段代码来模拟来自不同源IP地址的流量,我想知道是否可以通过使用Perl欺骗地址来实现这一点?

我尝试过Net :: RAWIP,但是我需要发送一些更复杂的http流量(即POST数据),但无法使用RAWIP

使用LWP我尝试使用ua> local_address,但我得到了这个回复:

Can't connect to 10.x.x.x:8080LWP::Protocol::http::Socket: Cannot assign requested address at /usr/lib/perl5/site_perl/5.10.0/LWP/Protocol/http.pm line 51.

这是我正在使用的代码:

#!/usr/bin/perl -wuse 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();
解决方法 如果您从不属于您的地址发送,则无法获得回复.这意味着您所能做的就是发送请求.您已经表明可以进行发送,因此您只需要发送请求即可.这很简单.

use strict;use warnings;use http::Request::Common qw( POST );my $req = POST('http://www.example.org/','Content'      => [ userfile => [ 
POST http://www.example.org/Connection: keep-aliveContent-Length: 376Content-Type: multipart/form-data; boundary=xYzZY--xYzZYContent-disposition: form-data; name="userfile"; filename="x.pl"Content-Type: text/plainuse strict;use warnings;use http::Request::Common qw( POST );my $req = POST('http://www.example.org/',);print $req->as_string();--xYzZY--
]],'Connection' => 'keep-alive',);print $req->as_string();

输出:

总结

以上是内存溢出为你收集整理的使用Perl LWP欺骗IP全部内容,希望文章能够帮你解决使用Perl LWP欺骗IP所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1269990.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存