0
0
mirror of https://codeberg.org/crimeflare/cloudflare-tor synced 2024-12-22 23:50:31 +00:00
This commit is contained in:
Raymond Maisano 2020-11-10 08:41:22 +01:00
parent 59b805422d
commit 5c7f38c589

View File

@ -2,31 +2,7 @@ let localUse = -1,
localDB = [], localDB = [],
timr, memcache = {}, timr, memcache = {},
forcePurge = false, forcePurge = false,
apiurl = 'http://api.wodferndripvpe6ib4uz4rtngrnzichnirgn7t5x64gxcyroopbhsuqd.onion/_/ismitm.php'; apiurl = 'https://api.nnpaefp7pkadbxxkhz2agtbv2a4g5sgo2fbmv3i7czaua354334uqqad.onion/_/ismitm.php';
/*
browser.storage.local.get(['cep']).then(g => {
if (g.cep == 'y') {
apiurl = 'http://api.wodferndripvpe6ib4uz4rtngrnzichnirgn7t5x64gxcyroopbhsuqd.onion/_/ismitm.php';
} else {
if (g.cep != 'n') {
browser.storage.local.set({
'cep': 'n'
});
fetch('http://api.wodferndripvpe6ib4uz4rtngrnzichnirgn7t5x64gxcyroopbhsuqd.onion/_/ok.php', {
method: 'GET',
mode: 'cors'
}).then(r => r.text()).then(r => {
if (r == 'ok') {
apiurl = 'http://api.wodferndripvpe6ib4uz4rtngrnzichnirgn7t5x64gxcyroopbhsuqd.onion/_/ismitm.php';
browser.storage.local.set({
'cep': 'y'
});
}
}).catch(() => {});
}
}
});
*/
function get_realdomain(w) { function get_realdomain(w) {
let wa = w.split('.'); let wa = w.split('.');
let wa_l = wa.length; let wa_l = wa.length;
@ -1165,7 +1141,7 @@ function forget_cache() {
'alt': (g.alt == 'y' ? 'y' : 'n') 'alt': (g.alt == 'y' ? 'y' : 'n')
}); });
browser.storage.local.set({ browser.storage.local.set({
'cep': (g.cep == 'y' ? 'y' : 'n') 'cep': (g.cep != undefined ? g.cep : '2')
}); });
browser.storage.local.set({ browser.storage.local.set({
'mul': (g.mul != undefined ? g.mul : 'eo') 'mul': (g.mul != undefined ? g.mul : 'eo')
@ -1188,7 +1164,7 @@ function forget_cache() {
forget_cache(); forget_cache();
}, 1814400000); }, 1814400000);
} }
browser.storage.local.get(['lastU', 'lastV', 'ldb', 'opd']).then(g => { browser.storage.local.get(['lastU', 'lastV', 'ldb', 'opd', 'cep']).then(g => {
switch (g.opd) { switch (g.opd) {
case 'n': case 'n':
localUse = 1; localUse = 1;
@ -1200,6 +1176,17 @@ browser.storage.local.get(['lastU', 'lastV', 'ldb', 'opd']).then(g => {
localUse = -1; localUse = -1;
break; break;
} }
switch (g.cep) {
case '1':
apiurl = 'https://api.crimeflare.eu.org/_/ismitm.php';
break;
case '2':
apiurl = 'http://avrynpc2q7pknqa3ucf5tvjcwad5nxvxgwnzvl2b6dx6uo4f7nc7zzqd.onion/a/is_cf.php';
break;
default:
apiurl = 'https://api.nnpaefp7pkadbxxkhz2agtbv2a4g5sgo2fbmv3i7czaua354334uqqad.onion/_/ismitm.php';
break;
}
localDB = JSON.parse(g.ldb || '[]'); localDB = JSON.parse(g.ldb || '[]');
if (g.lastU) { if (g.lastU) {
if (Math.abs(Math.round((new Date()).getTime() / 1000) - g.lastU) > 1814400) { if (Math.abs(Math.round((new Date()).getTime() / 1000) - g.lastU) > 1814400) {
@ -1222,7 +1209,7 @@ browser.storage.local.get(['lastU', 'lastV', 'ldb', 'opd']).then(g => {
'alt': (g.alt == 'y' ? 'y' : 'n') 'alt': (g.alt == 'y' ? 'y' : 'n')
}); });
browser.storage.local.set({ browser.storage.local.set({
'cep': (g.cep == 'y' ? 'y' : 'n') 'cep': (g.cep != undefined ? g.cep : '2')
}); });
browser.storage.local.set({ browser.storage.local.set({
'mul': (g.mul != undefined ? g.mul : 'eo') 'mul': (g.mul != undefined ? g.mul : 'eo')
@ -1265,7 +1252,7 @@ browser.storage.local.get(['lastU', 'lastV', 'ldb', 'opd']).then(g => {
'alt': (g.alt == 'y' ? 'y' : 'n') 'alt': (g.alt == 'y' ? 'y' : 'n')
}); });
browser.storage.local.set({ browser.storage.local.set({
'cep': (g.cep == 'y' ? 'y' : 'n') 'cep': (g.cep != undefined ? g.cep : '2')
}); });
browser.storage.local.set({ browser.storage.local.set({
'mul': (g.mul != undefined ? g.mul : 'eo') 'mul': (g.mul != undefined ? g.mul : 'eo')
@ -1356,6 +1343,29 @@ browser.runtime.onMessage.addListener((requests, sender, sendResponse) => {
} }
return; return;
} }
if (requests.indexOf('urltype,') === 0) {
switch (requests) {
case 'urltype,0':
browser.storage.local.set({
'cep': '0'
});
apiurl = 'https://api.nnpaefp7pkadbxxkhz2agtbv2a4g5sgo2fbmv3i7czaua354334uqqad.onion/_/ismitm.php';
break;
case 'urltype,1':
browser.storage.local.set({
'cep': '1'
});
apiurl = 'https://api.crimeflare.eu.org/_/ismitm.php';
break;
case 'urltype,2':
browser.storage.local.set({
'cep': '2'
});
apiurl = 'http://avrynpc2q7pknqa3ucf5tvjcwad5nxvxgwnzvl2b6dx6uo4f7nc7zzqd.onion/a/is_cf.php';
break;
}
return;
}
requests.forEach(request => { requests.forEach(request => {
i_know_you(request).then((r) => { i_know_you(request).then((r) => {
if (r == 1 || r == -1) { if (r == 1 || r == -1) {