Attacco SPAM
This commit is contained in:
@@ -26,6 +26,7 @@ const FILELOG = 'filelog.txt';
|
||||
const FILEEVENTS = 'logevents.txt';
|
||||
const FILEMANAGERS = 'logmanagers.txt';
|
||||
const FILESOSTITUZIONI = 'log_sostituzioni.txt';
|
||||
const FILEIP_TO_BAN = 'log_iptoban.txt';
|
||||
const FILENAVE = 'logNave.txt';
|
||||
const subject = process.env.URLBASE_APP1;
|
||||
const publicVapidKey = process.env.PUBLIC_VAPI_KEY;
|
||||
@@ -1164,6 +1165,14 @@ module.exports = {
|
||||
return mydate
|
||||
},
|
||||
|
||||
isdiffSecDateLess(mydatediffstr, secs) {
|
||||
let mydate = new Date();
|
||||
// console.log('mydate', mydate);
|
||||
let mydata2 = new Date(mydatediffstr);
|
||||
let ris = ((mydate.getTime() - mydata2.getTime()) / 1000);
|
||||
return (ris < secs);
|
||||
},
|
||||
|
||||
AddDate(mydate, days) {
|
||||
let date = new Date(mydate);
|
||||
date.setTime(date.getTime() + days * 86400000);
|
||||
@@ -1483,6 +1492,10 @@ module.exports = {
|
||||
this.writelogfile(mystr, FILESOSTITUZIONI);
|
||||
},
|
||||
|
||||
writeIPToBan(mystr) {
|
||||
this.writelogfile(mystr, FILEIP_TO_BAN);
|
||||
},
|
||||
|
||||
writeFlottaLog(idapp, mystr, riga, col) {
|
||||
this.mkdirpath(idapp + '/');
|
||||
this.writelogfile(mystr, idapp + '/' + riga + '_' + col + '.txt');
|
||||
@@ -1724,7 +1737,27 @@ module.exports = {
|
||||
return '🇬🇧';
|
||||
else if (lang === 'fr')
|
||||
return '🇫🇷';
|
||||
},
|
||||
|
||||
blockwords(mystr) {
|
||||
if (mystr.includes('ttp')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
isAlphaNumeric(str) {
|
||||
let code, i, len;
|
||||
|
||||
for (i = 0, len = str.length; i < len; i++) {
|
||||
code = str.charCodeAt(i);
|
||||
if (!(code > 47 && code < 58) && // numeric (0-9)
|
||||
!(code > 64 && code < 91) && // upper alpha (A-Z)
|
||||
!(code > 96 && code < 123)) { // lower alpha (a-z)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user