在 Chrome 浏览网页的时候,获取浏览器发送的 HTTP/S 请求并保存起来
Chrome 扩展能否实现这个功能 如果不能,请问有别的方法能实现想要的功能
1
crab 2018-08-26 02:41:20 +08:00
Tamper Chrome 这个插件可以
|
2
imn1 2018-08-26 02:43:19 +08:00
|
5
WWd0g OP |
6
WWd0g OP chrome.tabs.executeScript(chrome.devtools.tabId, {
code: `console.clear();console.log("✅网页请求收集器已开启✅");`, }); // chrome extension 中不能使用 console.log // 所以,需要通过发送请求给后台脚本的方式来打印日志 const log = (...args) => chrome.extension.sendRequest({tabId: chrome.devtools.tabId, args,}); chrome.devtools.network.onRequestFinished.addListener( function(request) { var data = {} data['method'] = request.request.method if(data['method'] == "POST"){ data['postData'] = request.request.postData.params }else{ data['postData'] = {} } data['url'] = request.request.url data['headers'] = request.request.headers data['queryString'] = request.request.queryString data['status'] = request.response.status data['mimeType'] = request.response.content.mimeType if(data['mimeType'] == "text/html" && data['status'] != 404){ if(data['method'] == 'GET' && data['queryString'] == ''){ }else{ log(data['method'], data['status'], data['url'], data['mimeType']) var xhr = new XMLHttpRequest(); xhr.open("post", "http://127.0.0.1/", true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;"); xhr.send(JSON.stringify(data)); } } Object.keys(request).forEach(function(key){ log(key,request[key]); }); }); |
7
wooyuntest 2018-08-26 23:08:27 +08:00 via iPhone
burp
并且信任 burp 的根证书 |
8
WWd0g OP @wooyuntest 这个好解决,主要麻烦,我用 mitmproxy 实现了,不过太麻烦
|