macOS Charles抓包

1. 安装Charles

https://www.charlesproxy.com/download/

官网linux macos windows都有。
1

2. 配置网络和其他

https://www.jianshu.com/p/9822e3f28f0a
我就不冷炒饭了, 这里有很多详细的教程。

主要是2步

  • 配置本地的网络代理为对应的IP和端口
  • 配置证书和添加域名

有2个需要注意的,这个开启代理后,本地的重定向开启有可能会导致这个失败。端口冲突的情况下。

3. 获取Cookie和其他必要信息

用Python wrapper一个类,这样就可以修改header里面的信息。 比如有timestamp这类字符。

self.header = {
			"User-Agent": self.user_agent,
			"Origin": "https://w.xxx.com",
			"Cookie": self.cookie,
			"Accept": "application/json",
			"Connection": "keep-alive",
			"Referer": self.referer,
			"Accept-Language": "en-us",
			"Host": "xxx.xxx.com",
			"Accept-Encoding": "gzip, deflate, br",
		}
posted @ 2021-02-06 21:22  叉叉敌  阅读(150)  评论(0编辑  收藏  举报