当前位置: 首页 > news >正文

中国移动飞信WAP登陆分析及脚本

中国移动飞信WAP网页版 http://f.10086.cn/im5/

用WAP飞信登录并向好友发送信息,同时用wireshark抓包。

1.过滤POST表单提交数据包(wireshark规则: http.request.method == POST),查找分析登陆数据

从上图可知:

登陆URL:http://f.10086.cn/im5/login/loginHtml5.action?t=1393041438687

POST数据:m=手机号&pass=密码&captchaCode=&checkCodeKey=nullReferer:http://f.10086.cn/im5/login/login.action?mnative=0&t=1393041438687

Cookie:UUID=...; JSESSIONID=...; infoversion=2[部分省略]

 

2.根据这个数据包向前寻找Cookie等参数的来源

(wireshark规则: http and ip.addr = 221.130.45.197

从上图可知:

登陆数据包前,有2个前置页面,可获取Cookie等参数

红色框中的参数根据其数值变化情况,可推测出是距1970年1月1日之间的毫秒数


3.根据以上信息即可成功登陆WAP飞信,下面寻找向好友发送消息的数据包

从上图可知:

登陆URL:http://f.10086.cn/im5/chat/sendNewMsg.action

POST数据:touserid=用户ID&msg=消息内容Referer:http://f.10086.cn/im5/login/login.action?mnative=0&t=1393041417548

Cookie:UUID=...; JSESSIONID=...; infoversion=2; cell_cookie=...; loginstatusCookie=400; MarkTips=2014-02-22[部分省略]发送消息POST数据包含用户ID及消息内容红色框请求可查询用户ID

 

4.请求查询用户ID页面

从上图可知:

登陆URL:http://f.10086.cn/im5/index/searchFriendsByQueryKey.action

POST数据:queryKey=消息接受者手机号Referer:http://f.10086.cn/im5/login/login.action?mnative=0&t=1393041417548

Cookie:UUID=...; JSESSIONID=...; infoversion=2; cell_cookie=...; loginstatusCookie=400; MarkTips=2014-02-22[部分省略]通过手机号可以查询用户ID

 


实现流程

1.通过前置页面获取Cookie等参数

2.提交账号、密码表单登陆

3.查询消息接受者用户ID

4.发送消息

各个页面携带Referer、Cookie等参数(必须时需要user_agent参数)


Shell脚本如下:

 1 #!/bin/bash
 2 
 3 if [ $# -eq 0 ]; then
 4     echo "Usage: fetion [-u name|tel] -m Message"
 5     exit 1
 6 fi
 7 
 8 while [ $# -gt 0 ]
 9 do
10     case $1 in
11     -u)    destination=$2
12     shift
13         ;;
14     -m) message=$2
15     shift
16         ;;
17     -*) echo "Usage: fetion [-u name|tel] -m Message"
18         exit 1
19         ;;
20     *)    break
21         ;;
22     esac
23     shift
24 done
25 
26 user_id="用户ID"
27 password="密码"
28 
29 ##############################################################
30 #get cookie
31 curl -c cookie.txt http://f.10086.cn/im5/ &> /dev/null
32 
33 #login
34 post_data="m=$user_id&pass=$password&captchaCode=&checkCodeKey=null"
35 timestamp=$((`date +%s`+3600))
36 url="http://f.10086.cn/im5/login/loginHtml5.action?t=$timestamp"
37 curl -b cookie.txt -c cookie.txt -d $post_data $url &> /dev/null
38 
39 ###################################################################
40 #name->userid tel->userid
41 
42 url="http://f.10086.cn/im5/index/searchFriendsByQueryKey.action"
43 post_data="queryKey=$destination"
44 head_referer="Referer: http://f.10086.cn/im5/login/login.action?mnative=0&t=$timestamp"
45 result=`curl -s -b cookie.txt -H $head_referer -d $post_data  $url`
46 #echo $result > temp
47 result=`echo $result | grep -o -E 'idContact":[0-9]+' | sed 's/.*://g'`
48 if [ -n "$result" ]; then
49     userid=$result
50     echo "Id: $userid"
51 else
52     userid="用户ID" #自己的ID,可通过添加上面注释行在temp中找到
53     echo "User ID does not exist!"
54     echo "\_[This message will be sent to your moblie phone]"
55 fi
56 #######################################################################
57 #seny message to myself
58 
59 message=${message// /%20}   #replace spaces
60 echo "Message: $message"
61 msg_post_data="msg=$message&touserid=$userid"
62 send_url="http://f.10086.cn/im5/chat/sendNewGroupShortMsg.action"
63 head_referer="Referer: http://f.10086.cn/im5/login/login.action?mnative=0&t=$timestamp"
64 result=`curl -s -b cookie.txt -c cookie.txt -H $head_referer -d $msg_post_data $send_url`
65 
66 result=`echo $result | grep -o -E 'sendCode":"[0-9]{1,3}' | sed 's/.*"//g'`
67 
68 if [ $result -eq 200 ]; then
69     echo "send message success![$result]"
70 else
71     echo "send message failure![$result]"
72 fi

 

转载于:https://www.cnblogs.com/rainmote/p/4160544.html

http://www.xdnf.cn/news/855199.html

相关文章:

  • android2.3.7刷机包,【新蜂】联想A789 刷机包 V3.2 (Android 4.0.4) 稳定流畅 纯净省电 完整ROOT...
  • WIN32 MENU
  • 浏览器设置代理教程
  • 计算机中滚动轴可以取消么,减少电脑开机滚动条怎么操作呢?
  • 红帽linux中文系统下载iso,红帽子9.0版下载-redhat linux 9.0 iso下载 简体中文正式版-IT猫扑网...
  • 搜索引擎(包括图片搜索)
  • 计算机中丢失conf,dll,win7英雄联盟丢失riotlauncher.dll无法进入游戏怎么办
  • 短址(short URL)原理及其实现
  • GroupOn
  • 崩坏学园3里离摄像机近距离的头发透明效果在unity里的实现方法
  • Eclipse3.6 正式版下载地址
  • java学习网站
  • 骗子!-淘宝网上的奇热网络
  • 手把手构建基于 GBase8s 的 Flink connector
  • 《互联网周刊》封面报道:P2P——新媒体革命
  • 权力的游戏中文字幕词云图
  • WINCE 6.0 补丁下载地址
  • 如何用一张照片证明你是老网民?
  • 推荐开源项目:彩虹外链网盘 - PHP打造的全能型文件共享平台
  • 为何陆涛不爱米莱
  • iPad2 4.3.3完美越狱 超详细图文教程!
  • gdb调试之--read by other session 等待事件的重现
  • 招式繁多机关重重——实战卡巴斯基2010全功能安全软件
  • c#版本视频在线播放(通用播放器调用),支持avi,wmv,asf,mov,rm,ra,ram等
  • 使用nmap绕过防火墙进行扫描
  • 手机QQ空间装逼代码收集
  • 【生活点滴】-- 英语如何学?
  • 数据分析-SQL练习
  • 玩家开发、出售《劲舞团》外挂获刑一年半