Skip to content

Commit

Permalink
add Opencanary check
Browse files Browse the repository at this point in the history
  • Loading branch information
Monyer committed Sep 26, 2020
1 parent 8a7f3ce commit 5331f67
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# AntiHoneypot - 一个拦截蜜罐XSSI的Chrome扩展
## 说明
这是一个带有学习和研究性质的Chrome扩展程序。

## 功能
1. 截获页面中发起的XSSI请求,通过域名、URI、Query黑名单特征识别阻断可疑的XSSI(Jsonp Callback、XSS等)
2. 对可疑URL进行深度检测,通过发送请求获取body内容,进行关键字匹配识别
3. 分析页面JS,攫取蜜罐固有特征,识别蜜罐并拦截所有请求(HFish、Moan、Beef)
3. 分析页面JS,攫取蜜罐固有特征,识别蜜罐并拦截所有请求(HFish、Moan、Beef、OpenCanary
4. 判断fingerprintjs库是否存在并提示
5. 判断是否有其他针对Canvas、Font、Audio、WebGL的指纹相关调用
6. 混淆Canvas、Font、Audio、WebGL的指纹,扰乱Fingerprint
Expand Down
6 changes: 6 additions & 0 deletions background/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ function onMessageCallback(request, sender, sendResponse) {
sendNotifaction(msg + sender.url);
}

if (request.msgType == "opencanary") {
let msg = "这个页面疑似OpenCanary蜜罐,请小心!";
setBlockInfo(sender.tab.id, sender.url, "OpenCanary hit", msg);
sendNotifaction(msg + sender.url);
}

sendResponse(true);
}

Expand Down
24 changes: 24 additions & 0 deletions content-script/document-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@ var injectEnd = function() {
}, '*');
}

/**
* openCanary
*/
//opencanary
(function() {
var isOpenCanary = false;
if (document.title.includes("Synology RackStation")) {
var metas = document.getElementsByTagName("meta");
isOpenCanary = Object.keys(metas).some(
idx => metas[idx].name == "application-name" && metas[idx].content.includes("DemoSite")
);
}
if (!isOpenCanary) {
var h1s = document.getElementsByTagName("h1");
isOpenCanary = h1s.length == 1 && h1s[0].innerText == "Network Storage v5.13";
}
if (isOpenCanary) {
window.top.postMessage({
msgType: "opencanary",
msgData: ""
}, '*');
}
})();

});
document.documentElement.dataset.csescriptallow = true;
};
Expand Down

0 comments on commit 5331f67

Please sign in to comment.