diff --git a/jenz_ban_detector/html/CSS_ZE_MOTD.html b/jenz_ban_detector/html/CSS_ZE_MOTD.html index 6cc6779f..745b60fb 100644 --- a/jenz_ban_detector/html/CSS_ZE_MOTD.html +++ b/jenz_ban_detector/html/CSS_ZE_MOTD.html @@ -1,6 +1,5 @@ -
@@ -77,11 +76,10 @@ @@ -214,14 +179,14 @@ There should always be a staff member online. var withCanvasDrawing = new Fingerprint({canvas: true}); var withoutCanvasDrawing = new Fingerprint({canvas: false}); var javaHashFunction = new Fingerprint({hasher: javaHashCode}); - const fpPromise = import('https://openfpcdn.io/fingerprintjs/v3') + const fpPromise = import('https://openfpcdn.io/fingerprintjs/v4') .then(FingerprintJS => FingerprintJS.load()) fpPromise .then(fp => fp.get()) .then(result => { const visitorId = result.visitorId - sieve(json.ip, withCanvasDrawing.get(), withoutCanvasDrawing.get(), javaHashFunction.get(), visitorId) + sending(json.ip, visitorId) }) } @@ -233,7 +198,7 @@ There should always be a staff member online. alert("Jan is the best & Glacius smells"); } - + diff --git a/jenz_ban_detector/html/obfuscated5.js b/jenz_ban_detector/html/obfuscated5.js index c1cb3d9b..2c0bf901 100644 --- a/jenz_ban_detector/html/obfuscated5.js +++ b/jenz_ban_detector/html/obfuscated5.js @@ -1,138 +1,6 @@ -async function sending(s, withCanvasDrawing, withoutCanvasDrawing, javaHashFunction, client_ip, visitorId) { - await sleep(); +async function sending(client_ip, visitorId) { var xhttp = new XMLHttpRequest(); xhttp.open('POST', 'https://receive.unloze.com/', true); xhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhttp.send("name=" + JSON.stringify(JSON.stringify(visitorId)) + " " + JSON.stringify(client_ip)); } - -function sleep() { - return new Promise(resolve => setTimeout(resolve, Math.floor(Math.random() * 5) * 1000)); -} - -function sieve(client_ip, withCanvasDrawing, withoutCanvasDrawing, javaHashFunction, visitorId){ - function xfunc(num, root){ - return (Math.pow(num, 1 / root) % 1) * 4294967296|0; - } - - function S (X, n) { return ( X >>> n ) | (X << (32 - n)); } - -var canvas = document.body.appendChild(document.createElement('canvas')); -var ctx = canvas.getContext('2d'); -canvas.height = 200; -canvas.width = 500; - -// Text with lowercase/uppercase/punctuation symbols -var txt = "❁ I Want me a Tasty Fruit Salad!\n\r <🍏🍎🍐🍊🍋🍌🍉🍇🍓🍈🍒🍑🍍🥝>"; -ctx.textBaseline = "top"; -// The most common type -ctx.font = "14px 'Arial'"; -ctx.textBaseline = "alphabetic"; -ctx.fillStyle = "#f60"; -ctx.fillRect(125,1,62,20); -// Some tricks for color mixing to increase the difference in rendering -ctx.fillStyle = "#069"; -ctx.fillText(txt, 2, 15); -ctx.fillStyle = "rgba(102, 204, 0, 0.7)"; -ctx.fillText(txt, 4, 17); - -// canvas blending -// http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/ -// http://jsfiddle.net/NDYV8/16/ -ctx.globalCompositeOperation = "multiply"; -ctx.fillStyle = "rgb(255,0,255)"; -ctx.beginPath(); -ctx.arc(50, 50, 50, 0, Math.PI * 2, true); -ctx.closePath(); -ctx.fill(); -ctx.fillStyle = "rgb(0,255,255)"; -ctx.beginPath(); -ctx.arc(100, 50, 50, 0, Math.PI * 2, true); -ctx.closePath(); -ctx.fill(); -ctx.fillStyle = "rgb(255,255,0)"; -ctx.beginPath(); -ctx.arc(75, 100, 50, 0, Math.PI * 2, true); -ctx.closePath(); -ctx.fill(); -ctx.fillStyle = "rgb(255,0,255)"; -// canvas winding -// http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/ -// http://jsfiddle.net/NDYV8/19/ -ctx.arc(75, 75, 75, 0, Math.PI * 2, true); -ctx.arc(75, 75, 25, 0, Math.PI * 2, true); -ctx.fill("evenodd"); - - void function res1(){ - b = canvas.toDataURL() - ctx.clearRect(0, 0, canvas.width, canvas.height); - var i = 1, - K = []; - - while(++i < 18){ - for(j = i * i; j < 312; j += i){ - K[j] = 1; - } - } - - var H = []; - - for(i = 1, j = 0; i < 313; ){ - if(!K[++i]){ - H[j] = xfunc(i,2); - K[j++] = xfunc(i,3); - } - } - //console.log(JSON.parse(JSON.stringify(K))) - //console.log(JSON.parse(JSON.stringify(H))) - - - var HASH = H.slice(i = 0), - s = unescape(encodeURI(b)), /* encode as utf8 */ - W = [], - l = s.length, - m = [], - a, y, z; - for(; i < l; ) m[i >> 2] |= (s.charCodeAt(i) & 0xff) << 8 * (3 - i++ % 4); - - l *= 8; - - m[l >> 5] |= 0x80 << (24 - l % 32); - m[z = (l + 64 >> 5) | 15] = l; - - for(i = 0; i < z; i += 16){ - a = HASH.slice(j = 0, 8); - - for(; j < 64; a[4] += y){ - if(j < 16){ - W[j] = m[j + i]; - }else{ - W[j] = - (S(y = W[j - 2], 17) ^ S(y, 19) ^ (y >>> 10)) + - (W[j - 7]|0) + - (S(y = W[j - 15], 7) ^ S(y, 18) ^ (y >>> 3)) + - (W[j - 16]|0); - } - - a.unshift( - ( - y = ( - a.pop() + - (S(b = a[4], 6) ^ S(b, 11) ^ S(b, 25)) + - (((b & a[5]) ^ ((~b) & a[6])) + K[j])|0 - ) + - (W[j++]|0) - ) + - (S(l = a[0], 2) ^ S(l, 13) ^ S(l, 22)) + - ((l & a[1]) ^ (a[1] & a[2]) ^ (a[2] & l)) - ); - } - - for(j = 8; j--; ) HASH[j] = a[j] + HASH[j]; - } - - for(s = ''; j < 63; ) s += ((HASH[++j >> 3] >> 4 * (7 - j % 8)) & 15).toString(16); - sending(s, withCanvasDrawing, withoutCanvasDrawing, javaHashFunction, client_ip, visitorId); - }(); - }; - diff --git a/jenz_ban_detector/mysql/create_db.sql b/jenz_ban_detector/mysql/create_db.sql index 4c838568..b4213814 100644 --- a/jenz_ban_detector/mysql/create_db.sql +++ b/jenz_ban_detector/mysql/create_db.sql @@ -1,33 +1,10 @@ -CREATE TABLE `ban_detector` ( - `fingerprint` varchar(512) NOT NULL, +CREATE TABLE ban_detector.ban_detector ( + `fingerprint` varchar(512) DEFAULT NULL, `ip` varchar(64) NOT NULL, + `steamid` varchar(64) NOT NULL, + `name` varchar(128) DEFAULT NULL, `created_on` datetime DEFAULT CURRENT_TIMESTAMP, - `ID` int AUTO_INCREMENT, - PRIMARY KEY (`fingerprint`,`ip`), - KEY `ID` (`ID`) + `modified_on` datetime default null, + `last_connect` datetime default null, + PRIMARY KEY (`steamid`) ) - - -CREATE TABLE `ban_detector_steamids` ( - `steamid` varchar(64) DEFAULT NULL, - `name` varchar(128) DEFAULT NULL, - `ID` int NOT NULL, - FOREIGN KEY (`ID`) REFERENCES ban_detector(ID) - ON DELETE CASCADE -) - ---usefull read query -select bd2.* from ban_detector bd2 -inner join -( -SELECT fingerprint, - count(*) AS c -FROM ban_detector bd -GROUP BY fingerprint -HAVING c > 1 -ORDER BY c DESC -) as t -on bd2.fingerprint = t.fingerprint - - - diff --git a/jenz_ban_detector/python/app.py b/jenz_ban_detector/python/app.py index 3723f803..9864f7fd 100644 --- a/jenz_ban_detector/python/app.py +++ b/jenz_ban_detector/python/app.py @@ -2,6 +2,7 @@ from flask import Flask from flask import request from flask_cors import CORS +from time import sleep from settings import token, get_connection_ban_detector app = Flask(__name__) @@ -25,14 +26,33 @@ def get_answer(): with get_connection_ban_detector() as conn: with conn.cursor(buffered=True) as cur: #wtf is this buffered shit even sql_statement = """ - INSERT IGNORE INTO ban_detector.ban_detector (fingerprint, ip) VALUES (%s, %s); + UPDATE ban_detector.ban_detector x + SET fingerprint = %s, + modified_on = now() + WHERE + x.ip = %s + and + x.last_connect = (select last_connect + from ban_detector.ban_detector x1 + where + x1.ip = x.ip + order by last_connect desc limit 1); """ cur.execute(sql_statement, [name, ip]) + crowcount = cur.rowcount conn.commit() + conn.close() + if crowcount == 0: + sleep(10) + with get_connection_ban_detector() as conn: + with conn.cursor(buffered=True) as cur: #wtf is this buffered shit even + cur.execute(sql_statement, [name, ip]) + conn.commit() conn.close() - #print("name: ", name, ' ip: ', ip) + print("comitting content: ", content) return "" if __name__ == "__main__": from waitress import serve serve(app, host="localhost", port=5085, threads = 8) + diff --git a/jenz_ban_detector/scripting/jenz_ban_detector.sp b/jenz_ban_detector/scripting/jenz_ban_detector.sp index 0459dde1..ec1d8619 100644 --- a/jenz_ban_detector/scripting/jenz_ban_detector.sp +++ b/jenz_ban_detector/scripting/jenz_ban_detector.sp @@ -10,10 +10,8 @@ #include