0
0
mirror of https://codeberg.org/crimeflare/cloudflare-tor synced 2024-11-10 03:12:49 +00:00

v1.0.8 FX

This commit is contained in:
IHateCaptcha 2019-06-14 07:03:57 +00:00
parent 7f2507b0ac
commit a4ccdcdb87
4 changed files with 37 additions and 18 deletions

View File

@ -1,3 +1,5 @@
* License
The MIT License The MIT License
Copyright (c) 2019 Maslin Bossé Copyright (c) 2019 Maslin Bossé
@ -19,3 +21,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
* Icon file (icons/32.png) by Patricia Clausnitzer <pc.de>

View File

@ -1,12 +1,11 @@
let apiurl = 'https://searxes.eu.org/collab/open/ismitm.php'; let apiurl = 'https://searxes.eu.org/collab/open/ismitm.php';
let TORapiurl = 'http://searxes.nmqnkngye4ct7bgss4bmv5ca3wpa55yugvxen5kz2bbq67lwy6ps54yd.onion/collab/open/ismitm.php';
fetch('http://xxf4en4djo7hhvatax2g3lvj2qgvbwi4yeyyzwpo25zcog4ewhsbrdyd.onion/ok.php', { fetch('http://xxf4en4djo7hhvatax2g3lvj2qgvbwi4yeyyzwpo25zcog4ewhsbrdyd.onion/ok.php', {
method: 'GET', method: 'GET',
mode: 'cors' mode: 'cors'
}).then(r => r.text()).then(r => { }).then(r => r.text()).then(r => {
if (r == 'ok') { if (r == 'ok') {
apiurl = TORapiurl; apiurl = 'http://searxes.nmqnkngye4ct7bgss4bmv5ca3wpa55yugvxen5kz2bbq67lwy6ps54yd.onion/collab/open/ismitm.php';
} }
}).catch(() => {}); }).catch(() => {});
@ -50,20 +49,33 @@ function i_already_know_you(f) {
}); });
} }
function i_remember_you(f, t) { function clear_cache_2w() {
browser.storage.local.set({
[f]: ((t) ? 'y' : 'n')
});
}
function clear_cache_week() {
browser.storage.local.clear(); browser.storage.local.clear();
browser.storage.local.set({
'lastU': Math.round((new Date()).getTime() / 1000)
});
setTimeout(function () { setTimeout(function () {
clear_cache_week(); clear_cache_2w();
}, 604800000); }, 1209600000);
} }
clear_cache_week(); browser.storage.local.get('lastxU').then(g => {
if (g.lastU) {
if (Math.abs(Math.round((new Date()).getTime() / 1000) - g.lastU) > 1209600) {
browser.storage.local.clear();
browser.storage.local.set({
'lastU': Math.round((new Date()).getTime() / 1000)
});
}
} else {
browser.storage.local.set({
'lastU': Math.round((new Date()).getTime() / 1000)
});
}
setTimeout(function () {
clear_cache_2w();
}, 1209600000);
});
browser.runtime.onMessage.addListener((request, sender, sendResponse) => { browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request && sender) { if (request && sender) {
@ -73,7 +85,9 @@ browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
} }
if (r == 0) { if (r == 0) {
is_infected(request).then((a) => { is_infected(request).then((a) => {
i_remember_you(request, a); browser.storage.local.set({
[request]: ((a) ? 'y' : 'n')
});
browser.tabs.sendMessage(sender.tab.id, [request, a]); browser.tabs.sendMessage(sender.tab.id, [request, a]);
}, () => { }, () => {
browser.tabs.sendMessage(sender.tab.id, [request, false]); browser.tabs.sendMessage(sender.tab.id, [request, false]);

View File

@ -1,19 +1,19 @@
if (document.body && !['searxes.nmqnkngye4ct7bgss4bmv5ca3wpa55yugvxen5kz2bbq67lwy6ps54yd.onion', 'searxes.eu.org', 'searxes.danwin1210.me'].includes(location.hostname)) { if (document.body && !['searxes.nmqnkngye4ct7bgss4bmv5ca3wpa55yugvxen5kz2bbq67lwy6ps54yd.onion', 'searxes.eu.org'].includes(location.hostname)) {
let cs = (function () { let cs = (function () {
let s = document.createElement('style'); let s = document.createElement('style');
document.head.appendChild(s); document.head.appendChild(s);
return s.sheet; return s.sheet;
})(); })();
if (cs) { if (cs) {
cs.insertRule("a[data-mitm]{text-decoration-line:line-through !important;text-decoration-color:red !important;text-decoration-style:double !important}", 0); cs.insertRule("a[data-mitm]{cursor:not-allowed !important;text-decoration-line:line-through !important;text-decoration-color:red !important;text-decoration-style:double !important}", 0);
cs.insertRule("a[data-mitm]::before{content:'[\\26A0]';font-weight:bold !important;color:red !important;display:inline-block !important}", 1); cs.insertRule("a[data-mitm]::before{content:'[\\26A0]';font-weight:bold !important;color:red !important;display:inline-block !important}", 1);
cs.insertRule("a[data-mitm]:hover::before{content:'[\\26A1]'}", 2); cs.insertRule("a[data-mitm]:hover::before{content:'[\\26A1]'}", 2);
cs.insertRule("a[data-mitm]:hover{color:red !important}", 3); cs.insertRule("a[data-mitm]:hover{color:red !important}", 3);
} }
let asked = ['searxes.danwin1210.me', 'searxes.nmqnkngye4ct7bgss4bmv5ca3wpa55yugvxen5kz2bbq67lwy6ps54yd.onion', 'searxes.eu.org', 'addons.mozilla.org']; let asked = ['searxes.nmqnkngye4ct7bgss4bmv5ca3wpa55yugvxen5kz2bbq67lwy6ps54yd.onion', 'searxes.eu.org', 'addons.mozilla.org', 'web.archive.org'];
document.querySelectorAll("a[href^='http://']:not([data-mitm]),a[href^='https://']:not([data-mitm]),a[href^='//']:not([data-mitm])").forEach(a => { document.querySelectorAll("a[href^='http://']:not([data-mitm]),a[href^='https://']:not([data-mitm]),a[href^='//']:not([data-mitm])").forEach(a => {
let aF = (new URL(a.href)).hostname; let aF = (new URL(a.href)).hostname;
if (!/^(.*)\.(onion|i2p|invalid|test|local|localhost|([0-9]{1,3})|bbs|chan|cyb|dyn|geek|gopher|indy|libre|neo|null|o|oss|oz|parody|pirate|bit|lib|coin|emc|bazar|fur)$/.test(aF) && !asked.includes(aF)) { if (!/^(.*)\.(danwin1210\.me|onion|i2p|invalid|test|local|localhost|([0-9]{1,3})|bbs|chan|cyb|dyn|geek|gopher|indy|libre|neo|null|o|oss|oz|parody|pirate|bit|lib|coin|emc|bazar|fur)$/.test(aF) && !asked.includes(aF)) {
asked.push(aF); asked.push(aF);
browser.runtime.sendMessage(aF); browser.runtime.sendMessage(aF);
} }

View File

@ -2,7 +2,7 @@
"manifest_version": 2, "manifest_version": 2,
"name": "Are links vulnerable to MITM attack?", "name": "Are links vulnerable to MITM attack?",
"description": "Scan FQDN using Searxes' API", "description": "Scan FQDN using Searxes' API",
"version": "1.0.7", "version": "1.0.8",
"homepage_url": "https://notabug.org/crimeflare/cloudflare-tor", "homepage_url": "https://notabug.org/crimeflare/cloudflare-tor",
"author": "Maslin Bossé", "author": "Maslin Bossé",
"permissions": [ "permissions": [