模拟微信登录
来源:互联网 发布:全知之眼纹身手腕 编辑:程序博客网 时间:2024/06/12 01:40
use LWP::UserAgent; use File::Temp qw/tempfile/;use AE;my $api = 'https://login.weixin.qq.com/jslogin';my $now= time(); my @query_string = ( appid => 'wx782c26e4c19acffb', redirect_uri => 'https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxnewloginpage', fun => 'new', lang => 'zh_CN', _ => $now, );my $ua = LWP::UserAgent->new;$ua->timeout(10);$ua->env_proxy;$ua->agent("Mozilla/8.0");$host = "https://login.weixin.qq.com/jslogin?appid=wx782c26e4c19acffb&redirect_uri=https%3A%2F%2Fwx.qq.com%2Fcgi-bin%2Fmmwebwx-bin%2Fwebwxnewloginpage&fun=new&lang=zh_CN&_=$now";my $response = $ua->get($host); $ua->default_headers;if ($response->is_success) { print $response->decoded_content; # or whatever$r=$response->decoded_content;print "\n";}else { die $response->status_line;};print "\$r is $r\n";if ( $r =~ /window\.QRLogin\.code = 200; window\.QRLogin\.uuid = "(.*?)"/g){$uuid=$1;print "\$uuid is $uuid\n";};my $api="https://login.weixin.qq.com/qrcode/$uuid";my $response = $ua->get($api); $ua->default_headers;if ($response->is_success) { $r= $response->decoded_content; # or whatever$r=$response->decoded_content;print "\n";}else { die $response->status_line;}; my ($fh, $filename) = tempfile("weixin_qrcode_XXXX",SUFFIX =>".jpg",DIR => '/tmp'); binmode $fh; print $fh $r; close $fh; print "登录二维码已经下载到本地 [ $filename ] \n";#https://login.weixin.qq.com/cgi-bin/mmwebwx-bin/login?loginicon=true&uuid=YaZ1MmzJ3Q==&tip=0&r=-1661116850&_=1453360034431 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=-1661116850&_=$now";my $response = $ua->get($api); $ua->default_headers;if ($response->is_success) {$r=$response->decoded_content;print "222222222222222222222222\n";print "\$r is $r\n";print "3333333333333333333333333333333\n";next unless defined $r; my %data = $r=~/window\.(.+?)=(.+?);/g;if ($data{code} ==201){ print "手机微信扫码成功,请在手机微信上点击 [登录] 按钮...\n"; my $show_tip = 0; next; }elsif ($data{code} == 200){ print "正在进行登录...\n"; foreach ($r){ if ($_ =~/window.redirect_uri="(.*?)"/){ my $api=$1; print "\$api is $api\n"; my $response = $ua->get($api); $ua->default_headers; return 1; }}}else { die $response->status_line;};} }};&login();sleep(5);sub RUN{ print "启动全局事件循环...\n"; AE::cv->recv;}&RUN();
0 0
- 模拟微信登录
- 模拟微信登录
- 微信的模拟登录
- 微信公众平台之模拟登录
- 飞信模拟登录
- 微信公众平台模拟登录,获取账号信息
- curl 模拟登录微信公众平台带验证码
- PHP微信公众号扫码模拟登录功能
- 使用java进行web微信登录模拟
- Android模拟信科教务登录
- 微信登录
- 微信扫描登录
- 友盟 微信登录
- 微信登录授权
- android 微信登录
- ios 微信登录
- 微信登录原理
- ios微信登录
- SpringMVC学习笔记
- MyBatis的foreach语句详解
- Java 编程要点之并发(Concurrency)详解
- NSIndex简单练习
- 获取HTML5视频时长的方法
- 模拟微信登录
- 一览HTML5新特性
- 编译目前最新的lua5.3.2到Android平台
- [日志处理]log4j配置详解
- MSP430x2xx的时钟配置
- HTML5预加载功能
- ABAP 选择屏幕选择条件带出信息
- java多线程并发概览
- ubuntu15安装ceph碰到的问题