perl lwp关闭ssl校验
use LWP::UserAgent;
use HTTP::Cookies;
use HTTP::Headers;
use HTTP::Response;
use Encode;
use File::Temp qw/tempfile/;
my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 }, );;
$ua->timeout(10);
$ua->env_proxy;
my $now = time();
$ua->agent("Mozilla/8.0");
my $cookie_jar = HTTP::Cookies->new( file => 'lwp_cookies.txt',
autosave => 1,
ignore_discard => 1
);
$ua->cookie_jar($cookie_jar);
my $str=(rand(1));
#system ("del/f/s/q c:\wj_qrcod*.jpg");
my $response = $ua->get("https://www.zjtest2.com/validcode/generate-validcode.do?$str"); print "\$str is $str\n";
if ($response->is_success) {
$r = $response->decoded_content;
# print $response->decoded_content; # or whatever
}
else {
print $response->decoded_content;
die $response->status_line;
}; my ( $fh, $filename ) =
tempfile( "wj_qrcode_XXXX", SUFFIX => ".jpg", DIR => 'c:\\' );
binmode $fh;
print $fh $r;
close $fh;
print "登录二维码已经下载到本地 [ $filename ] \n"; ##打开图片
system("start $filename "); my $validCode = <STDIN>;
chomp $validCode ;
print "\$validCode is $validCode\n"; #my $url="https://www.zjtest2.com/business/dispatch_post.do"; my $login_url = 'https://www.zjtest2.com/business/dispatch_post.do'; my $res = $ua->post($login_url,{
'action'=>'doLogin',
'userName'=>'kevin',
'followId'=>'',
'userPass'=>'3d24b838770ee90773804e8599e549ff',
'validCode'=> "$validCode"
});
print "---------------\n"; my $head =$res->header('Location');
print $res->header('Location');
print "\n"; print $res->status_line."\n";
print $res->as_string();#获取的是原始内容,包括响应头,响应正文 my $content=$res->content();
print $res->content(); #获取的是响应正文 my $spool = encode("gbk",decode("utf8","$content"));
print "\$spool is $spool\n";
print "\n"; my $response = $ua->get("$head");
if ($response->is_success) {
print $response->content;
$r = $response->content; $str=encode("gbk",decode("utf8","$r"));
print "\$str is $str\n"; }else{ $r = $response->content;
print $response->content; }; my $url="https://www.zjtest2.com/business/dispatch_get.do?action=doDeposit";
my $response = $ua->get("$url");
if ($response->is_success) {
print $response->content;
$r = $response->content; $str=encode("gbk",decode("utf8","$r"));
print "\$str is $str\n"; }else{ $r = $response->content;
print $response->content; }; while(1==1){ ##转入2级市场现金现金
##https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fin&amount=1&tradePassword=79e8fe923f031f46221a9283d0c9263a&_=1460426257542
##1460426541
my $now = time();
my $url="https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fin&amount=2&tradePassword=3d24b838770ee90773804e8599e549ff&_=$now";
my $response = $ua->get("$url");
if ($response->is_success) {
print $response->content;
$r = $response->content; $str=encode("gbk",decode("utf8","$r"));
print "\$str is $str\n"; }else{ $r = $response->content;
print $response->content; }; ###转出到1级市场现金
##https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fin&amount=2&tradePassword=3d24b838770ee90773804e8599e549ff&_=1460441529452
###https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fout&amount=2&tradePassword=79e8fe923f031f46221a9283d0c9263a&_=$now my $url="https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fout&amount=2&tradePassword=3d24b838770ee90773804e8599e549ff&_=$now";
my $response = $ua->get("$url");
if ($response->is_success) {
print $response->content;
$r = $response->content; $str=encode("gbk",decode("utf8","$r"));
print "\$str is $str\n"; }else{ $r = $response->content;
print $response->content; }; };
perl lwp关闭ssl校验的更多相关文章
- haproxy 关闭ssl 3.0 加密
global log 127.0.0.1 local3 maxconn 65535 chroot /usr/local/haproxy uid 500 gid 500 daemon ssl-defau ...
- 关闭SSL证书验证
转载 Python3之关闭SSL证书验证 转载 Python requests 移除SSL认证,控制台输出InsecureRequestWarning取消方法 报错信息: Traceback (mos ...
- vue项目关闭eslint校验
[前言] eslint是一个JavaScript的校验插件,通常用来校验语法或代码的书写风格.这篇文章主要介绍了vue项目关闭eslint校验,需要的朋友可以参考下 [主体] 简介eslint esl ...
- 用vue ui创建的项目怎么关闭eslint校验
在Vue Cli的控制面板找到配置-ESLint configuration,然后关闭保存时检查就可以了
- perl lwp 超时问题
lwp 超时问题: jrhmpt01:/root/async# cat a1.pl use LWP::UserAgent; use utf8; use DBI; use POSIX; use Data ...
- perl lwp 默认的请求头
</pre><pre name="code" class="html">[root@dr-mysql01 ~]# cat getx.pl ...
- perl lwp 获取请求头
<pre name="code" class="html">[root@dr-mysql01 ~]# cat getx.pl use LWP::Us ...
- perl LWP::UserAgent获取源码与响应
#!/usr/bin/perl -w use strict; use LWP::UserAgent; my $useragent = new LWP::UserAgent; my $url = 'ht ...
- 关闭SSL服务[iRedMail]
相信有很多朋友接触并使用地iRedMail这个软件了, 其强大的邮件收发功能, 垃圾及病毒检索能力自不用说了. 其自身携带的dovecot组件提供的SSL也足以使人们对这个软件侧目, 但是正是由于这个 ...
随机推荐
- javascript封装自定义滚动条方法,可自定义四个边框滚动条
还是根据我的个人习惯封装了一个方法 setScroll({ box :父盒子DOM对象, content : 内容盒子DOM对象, scrollall : 滚动条大盒子DOM对象, scroll : ...
- UUID 生成(源代码编译)
根据定义,UUID(Universally Unique IDentifier,也称GUID)在时间和空间都是唯一的.为保证空间的唯一性,每个UUID使用了一个48位的值来记录,一般是计算机的网卡地址 ...
- STL模板_容器概念
一.STL(Standard Template Library,标准模板库)概述1.容器:基于泛型的数据结构.2.算法:基于泛型的常用算法.3.迭代器:以泛型的方式访问容器中的元素,是泛型的算法可以应 ...
- BZOJ 1876: [SDOI2009]SuperGCD( 更相减损 + 高精度 )
更相减损,要用高精度.... --------------------------------------------------------------- #include<cstdio> ...
- memcached look status
$ STAT pid STAT STAT STAT version STAT pointer_size STAT rusage_user 7.054927 STAT rusage_system 14. ...
- Asp.Net请求处理机制中IsApiRuntime解析
今天看了web请求的生命周期,看完了还有些不懂,就是用反编译工具,查看封装内库的内部实现. 从计算机内部查到web.dll,使用反编译工具打开 打开后 public int ProcessReques ...
- SnappyDB—Android上的NoSQL数据库简介
参考:http://www.open-open.com/lib/view/open1420816891937.html 参考:http://android-arsenal.com/details/1/ ...
- C#学习日志 day 4 ------ 类相关---this指针以及相关关键字
c#中的类和java中的类没什么太大区别.但是c#有些特有的关键字以及属性使得c#具有一些特性. 首先就是this关键字,this在c++和java中都有,可以表示当前对象,以及变量所属对象等.例如 ...
- POSIX扩展正则表达式函数
1.ereg()函数和eregi()函数 函数语法: bool ereg/eregi ( string pattern, string string [, array regs] ) 函数功能: 在字 ...
- Spring-AOP实践
Spring-AOP实践 公司的项目有的页面超级慢,20s以上,不知道用户会不会疯掉,于是老大说这个页面要性能优化.于是,首先就要搞清楚究竟是哪一步耗时太多. 我采用spring aop来统计各个阶段 ...