博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
while +next 循环 回到循环顶端
阅读量:5243 次
发布时间:2019-06-14

本文共 5262 字,大约阅读时间需要 17 分钟。

my $show_tip = 1;sub login {    while (1) {        my $api ="https://login.weixin.qq.com/cgi-bin/mmwebwx-bin/login?loginicon=true&uuid=$uuid&tip=$show_tip&r=-$now&_=$now";        my $response = $ua->get($api);		print "1--\$show_tip is $show_tip\n";		print "2--\$api is $api\n";		sleep (2);        $ua->default_headers;        if ( $response->is_success ) {            $r = $response->decoded_content;            print "\$r is $r\n";            next unless defined $r;            my %data = $r =~ /window\.(.+?)=(.+?);/g;            if ( $data{code} == 201 ) {                print"手机微信扫码成功,请在手机微信上点击 [登录] 按钮...\n";                $show_tip = 0;				##回到循环顶部,此时请求的url是"https://login.weixin.qq.com/cgi-bin/mmwebwx-bin/login?loginicon=true&uuid=$uuid&tip=$show_tip&r=-$now&_=$now";				                next;            }            elsif ( $data{code} == 200 ) {                print "正在进行登录...\n";                foreach ($r) {                    if ( $_ =~ /window.redirect_uri="(.*?)"/ ) 					   {                        $api = $1;                        print "\$api is $api\n";                        my $response = $ua->get($api);                        $ua->default_headers;                      }                }				};                                  if ( $api =~ /https\:\/\/wx\.qq\.com\/cgi\-bin\/mmwebwx-bin\/webwxnewloginpage\?ticket=(.*?)\&uuid=(.*?)\&lang=(.*?)\&scan=(.*)/                      )                    {                        print "\$1 is $1\n";                        print "\$2 is $2\n";                        print "\$3 is $3\n";                        print "\$4 is $4\n";                        $ticket=$1;                        $user = $4;                        print "\$user is $user\n";                        return 1;                    }					}            else {                die $response->status_line;            }        }	};centos6.5:/root/mojo#perl scan.pl window.QRLogin.code = 200; window.QRLogin.uuid = "gduih3Nyww==";$uuid is gduih3Nyww==登录二维码已经下载到本地 [ /tmp/weixin_qrcode_bYwp.jpg ] 1--$show_tip is 12--$api is https://login.weixin.qq.com/cgi-bin/mmwebwx-bin/login?loginicon=true&uuid=gduih3Nyww==&tip=1&r=-1479440494&_=1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dujo6eOCWPJFbVOltbMU8kVPzJccE65tmPRz8eeq1rHHVONqkqps0qVoo2weaU49GWpoX/HG22rLDcIF0RDqbsbf6lNkoCybTi+exXYsgpoCywEtrsAGVdhkwAqBFeRsAATsJJWr7oAAR5Zvi39xoXKXLYAdOqztvrZBbUkixABybMnwRuYAAxHQAKgl2ITtJMAIqVygAAP/Z';手机微信扫码成功,请在手机微信上点击 [登录] 按钮...1--$show_tip is 02--$api is https://login.weixin.qq.com/cgi-bin/mmwebwx-bin/login?loginicon=true&uuid=gduih3Nyww==&tip=0&r=-1479440494&_=1479440494$r is window.code=200;window.redirect_uri="https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxnewloginpage?ticket=AQV3nhqeStaayKkSthVOuQXu@qrticket_0&uuid=gduih3Nyww==&lang=zh_CN&scan=1479440653";正在进行登录...$api is https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxnewloginpage?ticket=AQV3nhqeStaayKkSthVOuQXu@qrticket_0&uuid=gduih3Nyww==&lang=zh_CN&scan=1479440653$1 is AQV3nhqeStaayKkSthVOuQXu@qrticket_0$2 is gduih3Nyww==$3 is zh_CN$4 is 1479440653$user is 1479440653

转载于:https://www.cnblogs.com/zhaoyangjian724/p/6198980.html

你可能感兴趣的文章
httpd_Vhosts文件的配置
查看>>
php学习笔记
查看>>
普通求素数和线性筛素数
查看>>
React Router 4.0 基本使用
查看>>
PHP截取中英文混合字符
查看>>
【洛谷P1816 忠诚】线段树
查看>>
CDN 学习笔记
查看>>
电子眼抓拍大解密
查看>>
多线程---线程间的通信
查看>>
poj 1331 Multiply
查看>>
严重: 文档无效: 找不到语法。 at (null:2:19)
查看>>
tomcat7的数据库连接池tomcatjdbc的25个优势
查看>>
Html 小插件5 百度搜索代码2
查看>>
nodejs-Path模块
查看>>
P1107 最大整数
查看>>
EasyDarwin开源手机直播方案:EasyPusher手机直播推送,EasyDarwin流媒体服务器,EasyPlayer手机播放器...
查看>>
监控CPU和内存的使用
查看>>
Ubuntu14.04设置开机自启动程序
查看>>
ios app 单元测试 自动化测试
查看>>
强连通tarjan模版
查看>>