14.03.2014, 16:50
(
Последний раз редактировалось Dieguinho; 14.03.2014 в 17:41.
)
Eai pessoal, eu tava pensando se vocкs podem me dar uma forзa pra pelo menos criar um anti dos
eu uso este FS:
https://sampforum.blast.hk/showthread.php?tid=468613
o que realmente acontecer ?
Bom eu testei o cheat e aconteceu isto no server.log
Coloquei messagemlimit no meu server.cfg
apareceu isto
Bom minha duvida e simples eu estava avaliando o DoS acima e percebir que ele ver o que esta escrito no server.log sу nгo entendir porque nгo detectar e banir a pessoa que estб usando os Cheat
eu uso este FS:
pawn Код:
//Anti DDoS Attack Filterscript by Jankingston. Feel free to modify ;)
#include <a_samp>
#include <FileFunctions>
#define ATTACK_TYPE_PLAYERID 1
#define ATTACK_TYPE_IP 2
new File:ServerLogFile;
new addostimer;
main()
{
print("|----------------------------------|");
print("| Anti DDOS filterscript v0.1 |");
print("|----------------------------------|");
}
public OnFilterScriptInit()
{
ServerLogFile = fileOpen("server_log.txt", io_Read);
addostimer = SetTimer("AntiDDoS", 100, true);
return 1;
}
public OnFilterScriptExit()
{
KillTimer(addostimer);
return 1;
}
forward AntiDDoS();
public AntiDDoS()
{
if(!ServerLogFile)
{
print("Error opening server_log.txt!");
KillTimer(addostimer);
}
else
{
new string[128];
new strarr[2][20];
fileSeek(ServerLogFile, -128, seek_End);
while(fileRead(ServerLogFile, string)){}
new pos = strfind(string, "Invalid client connecting from ", true, 10);
if(pos == 11)
{
OnDDosAttackAttempt(ATTACK_TYPE_IP, INVALID_PLAYER_ID, string[pos+31]);
}
pos = strfind(string, "Warning: /rcon command exploit from: ", true, 10);
if(pos == 11){
split(string[pos+37], strarr, ':');
OnDDosAttackAttempt(ATTACK_TYPE_PLAYERID, strval(strarr[0]), strarr[1]);
}
pos = strfind(string, "Warning: PlayerDialogResponse PlayerId: ", true, 10);
if(pos == 11){
new idx = 0;
new plid = strval(strtok(string[pos+39], idx));
SetPVarInt(plid, "dialogDDosAtt", GetPVarInt(plid, "dialogDDosAtt")+1);
print("");
if(GetPVarInt(plid, "dialogDDosAtt") > 2)OnDDosAttackAttempt(ATTACK_TYPE_PLAYERID, plid, " ");
}
pos = strfind(string, "Warning: PlayerDialogResponse crash exploit from PlayerId: ", true, 10);
if(pos == 11){
new idx = 0;
OnDDosAttackAttempt(ATTACK_TYPE_PLAYERID, strval(strtok(string[pos+59], idx)), " ");
}
pos = strfind(string, "Packet was modified, sent by id: ", true, 10);
if(pos == 11){
split(string[pos+33], strarr, ',');
OnDDosAttackAttempt(ATTACK_TYPE_PLAYERID, strval(strarr[0]), " ");
}
pos = strfind(string, "Remote Port Refused for Player: ", true, 10);
if(pos == 11){
new idx = 0;
OnDDosAttackAttempt(ATTACK_TYPE_PLAYERID, strval(strtok(string[pos+32], idx)), " ");
}
if(strfind(string, " due to a 'server full' attack") != -1)
{
pos = strfind(string, "Blocking ", true, 10);
if(pos == 12)
{
new idx = 0;
OnDDosAttackAttempt(ATTACK_TYPE_IP, INVALID_PLAYER_ID, strtok(string[pos+9], idx));
}
}
}
}
forward OnDDosAttackAttempt(type, playerid, ip[]);
public OnDDosAttackAttempt(type, playerid, ip[])
{
new string[128];
if(type == ATTACK_TYPE_PLAYERID)
{//block a playerid
BanEx(playerid, "DDOS protect");
printf("Blocked attack from playerid %d", playerid);
}else if(type == ATTACK_TYPE_IP)
{//block an ip address
format(string, sizeof(string), "banip %s", ip);
SendRconCommand(string);
printf("Blocked attack from ip: %s", ip);
}
}
stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
stock split(const strsrc[], strdest[][], delimiter)
{
new i, li;
new aNum;
new len;
while(i <= strlen(strsrc)){
if(strsrc[i]==delimiter || i==strlen(strsrc)){
len = strmid(strdest[aNum], strsrc, li, i, 128);
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}
o que realmente acontecer ?
Bom eu testei o cheat e aconteceu isto no server.log
PHP код:
[BVJ-13:14:54] Incoming connection: 189.49.175.106:46227
[BVJ-13:14:54] Incoming connection: 189.49.175.106:46233
[BVJ-13:14:54] Incoming connection: 189.49.175.106:46249
[BVJ-13:14:54] Incoming connection: 189.49.175.106:46247
[BVJ-13:14:54] Incoming connection: 189.49.175.106:46245
[BVJ-13:14:54] Incoming connection: 189.49.175.106:46241
[BVJ-13:14:54] Incoming connection: 189.49.175.106:46255
[BVJ-13:14:54] Incoming connection: 189.49.175.106:46251
[BVJ-13:14:54] Incoming connection: 189.49.175.106:45841
[BVJ-13:14:54] Incoming connection: 189.49.175.106:46287
[BVJ-13:14:54] Incoming connection: 189.49.175.106:45843
[BVJ-13:14:54] Blocking 189.49.175.106 due to a 'server full' attack (1)
/////////////////////// aqui outra parte do cheat////////////////////////////////
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
[BVJ-13:44:25] Packet was modified, sent by id: 5, ip: 25.165.106.74:59321
Coloquei messagemlimit no meu server.cfg
apareceu isto
PHP код:
[BVJ-07:53:42] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6513) Limit: 1000
[BVJ-07:53:42] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6512) Limit: 1000
[BVJ-07:53:42] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6511) Limit: 1000
[BVJ-07:53:42] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6510) Limit: 1000
[BVJ-07:53:42] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6509) Limit: 1000
[BVJ-07:53:42] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6508) Limit: 1000
[BVJ-07:53:42] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6507) Limit: 1000
[BVJ-07:53:42] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6506) Limit: 1000
[BVJ-07:53:42] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6505) Limit: 1000
[BVJ-07:53:42] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6504) Limit: 1000
[BVJ-07:53:43] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6503) Limit: 1000
[BVJ-07:53:43] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6502) Limit: 1000
[BVJ-07:53:43] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6501) Limit: 1000
[BVJ-07:53:43] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6500) Limit: 1000
[BVJ-07:53:43] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6499) Limit: 1000
[BVJ-07:53:43] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6498) Limit: 1000
[BVJ-07:53:43] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6497) Limit: 1000
[BVJ-07:53:43] Warning: client exceeded 'messageholelimit' (2) 127.0.0.1:55269 (-6496) Limit: 1000