forked from SirPlease/L4D2-Competitive-Rework
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06edf57
commit c0c19b2
Showing
7 changed files
with
315 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
addons/sourcemod/gamedata/SendFileExploitFix_csgo_1_2_2021.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"Games" | ||
{ | ||
"csgo" | ||
{ | ||
"Addresses" | ||
{ | ||
"CheckReceivingList" | ||
{ | ||
"windows" | ||
{ | ||
"signature" "CheckReceivingListSig" | ||
} | ||
"linux" | ||
{ | ||
"signature" "CheckReceivingListSig" | ||
} | ||
} | ||
} | ||
"Signatures" | ||
{ | ||
"CheckReceivingListSig" | ||
{ | ||
"library" "engine" | ||
"windows" "\x55\x8b\xec\x81\xec\x30\x01\x00\x00\x69\x45\x08\x30\x01\x00\x00\x53\x56\x8d\xb1\x50\x01\x00\x00" | ||
"linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\x2A\x2A\x2A\x2A\x8B\x5D\x0C\x65\xA1\x14\x00\x00\x00\x89\x45\xE4\x31\xC0\x8B\x75\x08\x69\xFB\x2A\x2A\x2A\x2A\x01\xF7" | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
29 changes: 29 additions & 0 deletions
29
addons/sourcemod/plugins/gamedata/SendFileExploitFix_csgo_1_2_2021.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"Games" | ||
{ | ||
"csgo" | ||
{ | ||
"Addresses" | ||
{ | ||
"CheckReceivingList" | ||
{ | ||
"windows" | ||
{ | ||
"signature" "CheckReceivingListSig" | ||
} | ||
"linux" | ||
{ | ||
"signature" "CheckReceivingListSig" | ||
} | ||
} | ||
} | ||
"Signatures" | ||
{ | ||
"CheckReceivingListSig" | ||
{ | ||
"library" "engine" | ||
"windows" "\x55\x8b\xec\x81\xec\x30\x01\x00\x00\x69\x45\x08\x30\x01\x00\x00\x53\x56\x8d\xb1\x50\x01\x00\x00" | ||
"linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\x2A\x2A\x2A\x2A\x8B\x5D\x0C\x65\xA1\x14\x00\x00\x00\x89\x45\xE4\x31\xC0\x8B\x75\x08\x69\xFB\x2A\x2A\x2A\x2A\x01\xF7" | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
128 changes: 128 additions & 0 deletions
128
addons/sourcemod/plugins/scripting/SendFileExploitFixV3.3.sp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
#include <sourcemod> | ||
#include <sdktools> | ||
|
||
public Plugin:myinfo = | ||
{ | ||
name = "SendFile Exploit Fix (v3.3)", | ||
author = "backwards", | ||
description = "Prevents Clients From Exploiting The Un-Patched SRCDS SendFile Command, V3 Adds ReceiveFile Support.)", | ||
version = "3.3", | ||
url = "http://www.steamcommunity.com/id/mypassword" | ||
} | ||
|
||
#define MAX_FILES_ALLOWED_WHILE_ACTIVE_PER_MAP 256 | ||
#define MAX_FILES_ALLOWED_UPLOAD 32 | ||
|
||
bool InLevel[MAXPLAYERS+1] = {false, ...}; | ||
int RequestCount[MAXPLAYERS+1] = {0, ...}; | ||
int SendCount[MAXPLAYERS+1] = {0, ...}; | ||
|
||
public OnPluginStart() | ||
{ | ||
CreateTimer(5.0, DecrementThread, _, TIMER_REPEAT); | ||
|
||
if (GetEngineVersion() != Engine_CSGO) | ||
return; | ||
|
||
Address addy = GameConfGetAddress(LoadGameConfigFile("SendFileExploitFix_csgo_1_2_2021"), "CheckReceivingList"); | ||
if(addy == Address:0)// Not Vital | ||
return; | ||
|
||
int OS = LoadFromAddress(addy + Address:1, NumberType_Int8); | ||
switch(OS) | ||
{ | ||
case 0x89: //Linux | ||
{ | ||
for(int i = 0;i<5;i++) | ||
StoreToAddress((addy + Address:0x474 + view_as<Address>(i)), 0x90, NumberType_Int8); | ||
} | ||
case 0x8B: //Windows | ||
{ | ||
for(int i = 0;i<2;i++) | ||
StoreToAddress((addy + Address:0x270 + view_as<Address>(i)), 0x90, NumberType_Int8); | ||
} | ||
default: | ||
{ | ||
return; // Not Vital | ||
} | ||
} | ||
} | ||
|
||
public Action:DecrementThread(Handle:timer, any:unused) | ||
{ | ||
for (new client = 0; client <= MaxClients; client++) | ||
{ | ||
RequestCount[client] -= 32; | ||
if(RequestCount[client] < 0) | ||
RequestCount[client] = 0; | ||
} | ||
|
||
return Plugin_Continue; | ||
} | ||
|
||
public OnMapStart() | ||
{ | ||
for (new client = 1; client <= MaxClients; client++) | ||
{ | ||
if(IsClientConnected(client)) | ||
{ | ||
if(IsClientInGame(client)) | ||
{ | ||
InLevel[client] = true; | ||
RequestCount[client] = 0; | ||
SendCount[client] = 0; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public OnMapEnd() | ||
{ | ||
for (new client = 1; client <= MaxClients; client++) | ||
{ | ||
InLevel[client] = false; | ||
RequestCount[client] = 0; | ||
SendCount[client] = 0; | ||
} | ||
} | ||
|
||
public OnClientPutInServer(client) | ||
{ | ||
InLevel[client] = true; | ||
RequestCount[client] = 0; | ||
SendCount[client] = 0; | ||
} | ||
|
||
public OnClientDisconnect(client) | ||
{ | ||
RequestCount[client] = 0; | ||
SendCount[client] = 0; | ||
} | ||
|
||
public Action OnFileSend(int client, const char[] sFile) | ||
{ | ||
if(InLevel[client]) | ||
{ | ||
RequestCount[client]++; | ||
if(RequestCount[client] > MAX_FILES_ALLOWED_WHILE_ACTIVE_PER_MAP) | ||
{ | ||
if(!IsClientInKickQueue(client)) | ||
KickClient(client, "ServerCrashExploitAttempt."); | ||
|
||
return Plugin_Stop; | ||
} | ||
} | ||
|
||
return Plugin_Continue; | ||
} | ||
|
||
public Action OnFileReceive(int client, const char[] sFile) | ||
{ | ||
SendCount[client]++; | ||
|
||
if(SendCount[client] > MAX_FILES_ALLOWED_UPLOAD) | ||
{ | ||
if(!IsClientInKickQueue(client)) | ||
KickClient(client, "ServerCrashExploitAttempt."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
#include <sourcemod> | ||
#include <sdktools> | ||
|
||
public Plugin:myinfo = | ||
{ | ||
name = "SendFile Exploit Fix (v3.3)", | ||
author = "backwards", | ||
description = "Prevents Clients From Exploiting The Un-Patched SRCDS SendFile Command, V3 Adds ReceiveFile Support.)", | ||
version = "3.3", | ||
url = "http://www.steamcommunity.com/id/mypassword" | ||
} | ||
|
||
#define MAX_FILES_ALLOWED_WHILE_ACTIVE_PER_MAP 256 | ||
#define MAX_FILES_ALLOWED_UPLOAD 32 | ||
|
||
bool InLevel[MAXPLAYERS+1] = {false, ...}; | ||
int RequestCount[MAXPLAYERS+1] = {0, ...}; | ||
int SendCount[MAXPLAYERS+1] = {0, ...}; | ||
|
||
public OnPluginStart() | ||
{ | ||
CreateTimer(5.0, DecrementThread, _, TIMER_REPEAT); | ||
|
||
if (GetEngineVersion() != Engine_CSGO) | ||
return; | ||
|
||
Address addy = GameConfGetAddress(LoadGameConfigFile("SendFileExploitFix_csgo_1_2_2021"), "CheckReceivingList"); | ||
if(addy == Address:0)// Not Vital | ||
return; | ||
|
||
int OS = LoadFromAddress(addy + Address:1, NumberType_Int8); | ||
switch(OS) | ||
{ | ||
case 0x89: //Linux | ||
{ | ||
for(int i = 0;i<5;i++) | ||
StoreToAddress((addy + Address:0x474 + view_as<Address>(i)), 0x90, NumberType_Int8); | ||
} | ||
case 0x8B: //Windows | ||
{ | ||
for(int i = 0;i<2;i++) | ||
StoreToAddress((addy + Address:0x270 + view_as<Address>(i)), 0x90, NumberType_Int8); | ||
} | ||
default: | ||
{ | ||
return; // Not Vital | ||
} | ||
} | ||
} | ||
|
||
public Action:DecrementThread(Handle:timer, any:unused) | ||
{ | ||
for (new client = 0; client <= MaxClients; client++) | ||
{ | ||
RequestCount[client] -= 32; | ||
if(RequestCount[client] < 0) | ||
RequestCount[client] = 0; | ||
} | ||
|
||
return Plugin_Continue; | ||
} | ||
|
||
public OnMapStart() | ||
{ | ||
for (new client = 1; client <= MaxClients; client++) | ||
{ | ||
if(IsClientConnected(client)) | ||
{ | ||
if(IsClientInGame(client)) | ||
{ | ||
InLevel[client] = true; | ||
RequestCount[client] = 0; | ||
SendCount[client] = 0; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public OnMapEnd() | ||
{ | ||
for (new client = 1; client <= MaxClients; client++) | ||
{ | ||
InLevel[client] = false; | ||
RequestCount[client] = 0; | ||
SendCount[client] = 0; | ||
} | ||
} | ||
|
||
public OnClientPutInServer(client) | ||
{ | ||
InLevel[client] = true; | ||
RequestCount[client] = 0; | ||
SendCount[client] = 0; | ||
} | ||
|
||
public OnClientDisconnect(client) | ||
{ | ||
RequestCount[client] = 0; | ||
SendCount[client] = 0; | ||
} | ||
|
||
public Action OnFileSend(int client, const char[] sFile) | ||
{ | ||
if(InLevel[client]) | ||
{ | ||
RequestCount[client]++; | ||
if(RequestCount[client] > MAX_FILES_ALLOWED_WHILE_ACTIVE_PER_MAP) | ||
{ | ||
if(!IsClientInKickQueue(client)) | ||
KickClient(client, "ServerCrashExploitAttempt."); | ||
|
||
return Plugin_Stop; | ||
} | ||
} | ||
|
||
return Plugin_Continue; | ||
} | ||
|
||
public Action OnFileReceive(int client, const char[] sFile) | ||
{ | ||
SendCount[client]++; | ||
|
||
if(SendCount[client] > MAX_FILES_ALLOWED_UPLOAD) | ||
{ | ||
if(!IsClientInKickQueue(client)) | ||
KickClient(client, "ServerCrashExploitAttempt."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters