Loading... ## 声明 1. 仅供技术讨论,不用于任何盈利或者商业目的 2. 如有侵权,请发送邮件到博主邮箱,将在收到邮件的第一时间删除相关内容 ## 分析过程 首先抓包看一下注册时提交了那些参数,账号密码随便填一下就行:  找到一个 join 的请求,发现时登录请求:  查看一下数据,发现有填写的账号密码,以及几个其他的数据:  这种情况下,可以找找抓包的上面一些链接是不是有返回的,看了以后可以发现 Github 的明显不是的,那么可以去网页源码里面找找。打开网页源码以后,搜索一下 hidden ,发现了关键参数:  所以只需要获取到首页源码,然后找到就几个参数提取以下就可以了 ## 代码实现 ```python # -*- coding: utf-8 -*- __version_ = 'python 3.7' __author__ = 'Json·G' __date__ = '2020/7/9 13:34' import requests def getMiddle(stringOrg, stringLeft, stringRight): indexLeft = stringOrg.find(stringLeft) + len(stringLeft) indexRight = stringOrg.find(stringRight, indexLeft) return stringOrg[indexLeft:indexRight] def handleFun(): sessionReq = requests.Session() respToken = sessionReq.get("https://github.com/").text token = getMiddle(respToken,'<input type="hidden" data-csrf="true" name="authenticity_token" value="', '" />') timestamp= getMiddle(respToken, '<input class="form-control" type="hidden" name="timestamp" value="', '" />') timestamp_secret = getMiddle(respToken, '<input class="form-control" type="hidden" name="timestamp_secret" value="', '" />') print("{}\n{}\n{}".format(token, timestamp, timestamp_secret)) if __name__ == '__main__': handleFun() ``` <hr class="content-copyright" style="margin-top:50px" /><blockquote class="content-copyright" style="font-style:normal"><p class="content-copyright">版权属于:JsOnGmAX</p><p class="content-copyright">本文链接:<a class="content-copyright" href="https://jsong.cn/archives/308.html" target="_blank" >https://jsong.cn/archives/308.html</a></p><p class="content-copyright">博客内容遵循 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议 如有侵权 请联系本人删除</p></blockquote> 最后修改:2020 年 07 月 30 日 11 : 08 AM © 允许规范转载 赞赏 如果觉得我的文章对你有用,请随意赞赏 ×Close 赞赏作者 扫一扫支付 支付宝支付 微信支付