每日爬虫JS小逆之5分钟旅游网MD5一锅端

来吧骚年,每天花5分钟锻炼一下自己的JS调试也是极好的,对后期调试滑块验证码还原、拖动很有帮助,坚持下去,我们能赢。建议亲自试试哦,如果对大家有帮助的话不妨关注一下知识图谱与大数据公众号,当然不关注也无所谓,有问题随时私信。完整JS代码参考
从今天开始种树-同程MD5
从今天开始种树-驴妈妈MD5
从今天开始种树-途牛MD5
从今天开始种树-搜狐视频MD5

开始

本次涉及同程旅游、驴妈妈、途牛、还有“买三送一”的搜狐,方法重复性虽高但并不阻碍大家亲自尝试哦。

同程旅游

打开同程旅游登录界面:![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200830211245176.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)
输入错误的账号密码,找到请求url:
在这里插入图片描述
查看formdata,发现pass(即密码)被加密了:
在这里插入图片描述

选择调用栈进去:
在这里插入图片描述
在文件中搜索pass:
![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200830211549597.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)
MD5赫然映入眼帘,那就打上断点,然后跳到这个MD5里看看,最先跳到这里:
在这里插入图片描述
往下一拉发现JS代码就区区一百行:
在这里插入图片描述
抠出来即可运行。

同程运行结果

import execjs
#url = https://passport.ly.com/
with open('..//js//tongcheng.js', encoding='utf-8') as f:
    tongcheng = f.read()
js = execjs.compile(tongcheng)
logid = js.call('get_pwd', "QWERTY123456")
print(logid)

![在这里插入图片描述]( https://img-blog.csdnimg.cn/2020083022240092.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)
一模一样。

驴妈妈

![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200830212040523.jpg?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)

这么快就结束了很不爽,继续打开一个驴妈妈,套路与上面一样:

![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200830221732244.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)
输入账号密码后找到url,查看formdata:
![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200830221948399.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)
这么短的加密方式一般就是MD5,通过调用栈进入文件,搜索password,找到入口,函数名直接了当nd5(pw):
![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200830222040685.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)
打上断点进入md5函数:
![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200830222144924.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)
上下拉一下代码发现也就百十行,抠出来。

驴妈妈运行

import execjs
#url = https://login.lvmama.com/nsso/login
with open('..//js//lvmama.js', encoding='utf-8') as f:
    lvmama = f.read()
js = execjs.compile(lvmama)
logid = js.call('get_pwd', "qwer")
print(logid)

![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200830222457283.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)

途牛

还贴图么?贴吧

登录

![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200830222648688.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)
查看formdata:
在这里插入图片描述
一看发现依然MD5加密。

调用栈进入

函数名倒是变化了一下。整上断点,进入md5函数里
![在这里插入图片描述]( https://img-blog.csdnimg.cn/2020083022270755.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)
同拉,发现也是100多行。

途牛运行结果

闭着眼睛扣完使用python调用。

import execjs
#url = https://passport.tuniu.com/
with open('..//js//tuniu.js', encoding='utf-8') as f:
    tuniu = f.read()
js = execjs.compile(tuniu)
logid = js.call('get_pwd', "qwert1234")
print(logid)

![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200830223003552.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)

买三送一:搜狐视频

随便点击发现搜狐视频也是MD5加密,看一看formdata:

在这里插入图片描述

调用栈进去,搜索关键字,打上断点,一气呵成:
在这里插入图片描述
进入md5函数,同样100多行:
在这里插入图片描述
换汤不换药,直接抠出来运行。

搜狐视频运行结果

import execjs
#url = https://tv.sohu.com/
with open('..//js//souhu.js', encoding='utf-8') as f:
    souhu = f.read()
js = execjs.compile(souhu)
logid = js.call('get_pwd', "qwer1234")
print(logid)

![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200830223548451.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)
完全一致,有内味了。

结束

一口气把途牛、同程、驴妈妈、搜狐拎出来了,都很简单,建议亲自试试哦,如果对大家有帮助的话不妨关注一下知识图谱与大数据公众号,当然不关注也无所谓,有问题随时私信。
![公众号]( https://img-blog.csdnimg.cn/20200321100547328.jpg?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)
![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200927175728947.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1b2h1YTEzOTUw,size_16,color_FFFFFF,t_70#pic_center)

posted @ 2020-09-27 17:58  罗小黑的黑  阅读(623)  评论(1)    收藏  举报