Raised This Month: $51 Target: $400
 12% 

Unconnected glitch - kicker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fenrix
Member
Join Date: Mar 2008
Old 05-31-2008 , 07:21   Unconnected glitch - kicker
Reply With Quote #1

Well I run a zombie panic server and recently there has been a spate of spammers making use of a glitch in the setinfo name function.

not going to explain it, if your interested in knowing how its done in order to fix it then PM me.

anyway these players connect as an UNCONNECTED player and it is impossible to ban them via use of any ingame method, only direct rcon commands can ban or kick them.

so they join and mic spam and hurl abuse across servers, I would like to request a plugin to kick, ban or stop the unconnected glitching players.

over on the ES forums they came up with one and I was wondering if we could get one for sourcemod so I don't have to get ES just to get rid of these players.
Fenrix is offline
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Old 05-31-2008 , 11:31   Re: Unconnected glitch - kicker
Reply With Quote #2

whats the link to the ES version?

Matt
__________________
MoggieX is offline
Send a message via Skype™ to MoggieX
Fenrix
Member
Join Date: Mar 2008
Old 05-31-2008 , 13:12   Re: Unconnected glitch - kicker
Reply With Quote #3

http://forums.mattie.info/cs/forums/...ht=unconnected
Fenrix is offline
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Old 05-31-2008 , 14:10   Re: Unconnected glitch - kicker
Reply With Quote #4

just looked and it appears to be possible:

http://docs.sourcemod.net/api/index....d=show&id=494&

Wrap some checking around it and a few IF staments for options (log, kick, ban, notify admins) and providing the query works, it should be easily possible.

Quite happily have a bash at this tonight/tomorrow.

Matt
__________________

Last edited by MoggieX; 05-31-2008 at 14:14.
MoggieX is offline
Send a message via Skype™ to MoggieX
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 05-31-2008 , 18:36   Re: Unconnected glitch - kicker
Reply With Quote #5

Quote:
Originally Posted by bobdole View Post
ive tried makeing a sourcemod plugin of my script for along time however i couldnt find a way. what makes it so easy with ES is that the plugin reads the name as a "0" so i could just see if their name in ES was equal to "0" however with sourcemod does exactly what CSS does and dosnt register anything as their name.
If that's the case, why not just do something like: if (strcmp(name, "\0") == 0) { // kick the guy } ?
bl4nk is offline
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Old 05-31-2008 , 19:28   Re: Unconnected glitch - kicker
Reply With Quote #6

This is what I have got so far, its not banning a player yet nor checking thier name, will add this later, but the below works as I've tested it and logs it to the log file.

Will post back when its complete

PHP Code:
/**
* Client CVar Checker by MoggieX
*
* Description:
*     
*    
*
* Usage:
*     Install and go!
*    
*    
* Thanks to:
*     
*      
*
* Version 1.0

*/
//////////////////////////////////////////////////////////////////
// Defines
//////////////////////////////////////////////////////////////////
#pragma semicolon 1
#include <sourcemod>
#define PLUGIN_VERSION "1.0"

//////////////////////////////////////////////////////////////////
// Delcare Handles
//////////////////////////////////////////////////////////////////
//new Handle:cvarCheckValue;

//////////////////////////////////////////////////////////////////
// Plugin Info
//////////////////////////////////////////////////////////////////
public Plugin:myinfo 
{
    
name "CVar Checker",
    
author "MoggieX",
    
description "Checks players CVars",
    
version PLUGIN_VERSION,
    
url "http://www.UKManDown.co.uk"
};

//////////////////////////////////////////////////////////////////
// Normal CVars + Hooking
//////////////////////////////////////////////////////////////////
public OnPluginStart()
{
    
CreateConVar("sm_cvarchecker_version"PLUGIN_VERSION"CVar Checker Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
//cvarCheckValue= CreateConVar("sm_cvarchecker_value", "sv_cheats", "CVar to check",FCVAR_PRINTABLEONLY);    //|FCVAR_REPLICATED|FCVAR_NOTIFY
    
HookEvent("player_spawn"Event_player_spawn);
}

//////////////////////////////////////////////////////////////////
// Player checking on spawn event
//////////////////////////////////////////////////////////////////
public Action:Event_player_spawn(Handle:event, const String:name[], bool:dontBroadcast)
 {
    new 
client GetClientOfUserId(GetEventInt(event"userid"));

    
// Query the client for 
    
QueryClientConVar(client"sv_cheats"ConVarQueryFinished:ClientConVarclient);
    
//QueryClientConVar(client, "cl_allowdownload", ConVarQueryFinished:ClientConVar, client);

     
return Plugin_Continue;
}

//////////////////////////////////////////////////////////////////
// Now the CVar has been retrived, process it
//////////////////////////////////////////////////////////////////
public ClientConVar(QueryCookie:cookieclientConVarQueryResult:result, const String:cvarName[], const String:cvarValue[])
 {
    
// Declarations
    
decl String:player_name[65];
    
decl String:steam_id[32];

    
// why is this like this? I have no idea!
     
steam_id[0] = '\0';

    
// Get Steam ID
    
GetClientAuthString(clientsteam_idsizeof(steam_id));

    
// Get client Details
    
GetClientName(clientplayer_namesizeof(player_name));

    
// For Interger values
    
new cvarValueNew StringToInt(cvarValue);

    if (
cvarValueNew != 0)
    {
        
LogAction(client, -1"[CHEATER FOUND] Name: %s SteamID: %s CVar: %s CVar Value: %s"player_namesteam_idcvarNamecvarValue);
        
PrintToChatAll("======== CHEATER FOUND! ========");
        
PrintToChatAll("[CHEATER FOUND!] \x04Name: %s \x04SteamID: \x03%s \x04CVar: \x03%s \x04CVar Value: \x03%s"player_namesteam_idcvarNamecvarValue);
        
PrintToChatAll("======== CHEATER FOUND! ========");
        
//PrintToServer("%s CVar %s = %s", name, cvarName, cvarValue)
    
}

    
// Log anyway for testing
    //LogAction(client, -1, "[CVar Checker] Name: %s SteamID: %s CVar: %s CVar Value: %s", player_name, steam_id, cvarName, cvarValue);


__________________
MoggieX is offline
Send a message via Skype™ to MoggieX
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 06-01-2008 , 00:54   Re: Unconnected glitch - kicker
Reply With Quote #7

I don't get the point of terminating the steam_id string, and then sticking the authstring in there. It seems pointless.
bl4nk is offline
siosios
SourceMod Donor
Join Date: Jan 2008
Old 06-01-2008 , 01:26   Re: Unconnected glitch - kicker
Reply With Quote #8

well i added a kickid string to it for now

Code:
        LogAction(client, -1, "[CHEATER FOUND] Name: %s SteamID: %s CVar: %s CVar Value: %s", player_name, steam_id, cvarName, cvarValue);
        PrintToChatAll("======== CHEATER FOUND! ========");
        PrintToChatAll("[CHEATER FOUND!] \x04Name: %s \x04SteamID: \x03%s \x04CVar: \x03%s \x04CVar Value: \x03%s", player_name, steam_id, cvarName, cvarValue);
        PrintToChatAll("======== CHEATER FOUND! ========");
        //PrintToServer("%s CVar %s = %s", name, cvarName, cvarValue)
    }
     ServerCommand("kickid %d \"sorry, your name blows get a new one!\"",GetClientUserId(client));
    // Log anyway for testing
    LogAction(client, -1, "[CVar Checker] Name: %s SteamID: %s CVar: %s CVar Value: %s", player_name, steam_id, cvarName, cvarValue);
}
to which it did kick players but they seemed to have names...

Code:

L 06/01/2008 - 00:07:54: [unconnected.smx] [CVar Checker] Name: ... SteamID: STEAM_0:0:17864234 CVar: sv_cheats CVar Value: 0
L 06/01/2008 - 00:07:57: [unconnected.smx] [CVar Checker] Name: ßҚ GodLiҚe SteamID: STEAM_0:1:4006188 CVar: sv_cheats CVar Value: 0
L 06/01/2008 - 00:08:31: [unconnected.smx] [CVar Checker] Name: ßҚ GodLiҚe SteamID: STEAM_0:1:4006188 CVar: sv_cheats CVar Value: 0
not sure if i did that right or not. could someone tell me if it worked out in somewhat a good way? ROFL

sio
siosios is offline
bobdole
SourceMod Donor
Join Date: May 2008
Location: Houston,Texas
Old 06-01-2008 , 01:34   Re: Unconnected glitch - kicker
Reply With Quote #9

you need to have it cheack the players name all you did was tell it to kick everyone when the plugin cheacks their sv_cheats value
bobdole is offline
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Old 06-01-2008 , 05:46   Re: Unconnected glitch - kicker
Reply With Quote #10

Quote:
Originally Posted by bobdole View Post
i hope you dont mind moggie but i went ahead and finished this (ill remove it if you wish)

i like this alot better than my eventscripts version seeing as eventscripts there is a chance of banning a legit player if they have their name as "0"

PHP Code:
/**
* Client CVar Checker by MoggieX
*
* Description:
*     
*    
*
* Usage:
*     Install and go!
*    
*    
* Thanks to:
*     
*      
*
* Version 1.0

*/
//////////////////////////////////////////////////////////////////
// Defines
//////////////////////////////////////////////////////////////////
#pragma semicolon 1
#include <sourcemod>
#define PLUGIN_VERSION "1.0"

//////////////////////////////////////////////////////////////////
// Delcare Handles
//////////////////////////////////////////////////////////////////
//new Handle:cvarCheckValue;

//////////////////////////////////////////////////////////////////
// Plugin Info
//////////////////////////////////////////////////////////////////
public Plugin:myinfo 
{
    
name "CVar Checker",
    
author "MoggieX",
    
description "Checks players CVars",
    
version PLUGIN_VERSION,
    
url "http://www.UKManDown.co.uk"
};

//////////////////////////////////////////////////////////////////
// Normal CVars + Hooking
//////////////////////////////////////////////////////////////////
public OnPluginStart()
{
    
CreateConVar("sm_cvarchecker_version"PLUGIN_VERSION"CVar Checker Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
//cvarCheckValue= CreateConVar("sm_cvarchecker_value", "sv_cheats", "CVar to check",FCVAR_PRINTABLEONLY);    //|FCVAR_REPLICATED|FCVAR_NOTIFY
    
HookEvent("player_spawn"Event_player_spawn);
}

//////////////////////////////////////////////////////////////////
// Player checking on spawn event
//////////////////////////////////////////////////////////////////
public Action:Event_player_spawn(Handle:event, const String:name[], bool:dontBroadcast)
 {
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
// Query the client for  sv_cheats
    
QueryClientConVar(client"sv_cheats"ConVarQueryFinished:ClientConVarclient);

    return 
Plugin_Continue;
}

//////////////////////////////////////////////////////////////////
// Now the CVar has been retrived, process it
//////////////////////////////////////////////////////////////////
public ClientConVar(QueryCookie:cookieclientConVarQueryResult:result, const String:cvarName[], const String:cvarValue[])
 {
    
// Declarations
    
decl String:player_name[65];
    
decl String:steam_id[32];

    
// why is this like this? I have no idea!
    
steam_id[0] = '\0';

    
// Get Steam ID
    
GetClientAuthString(clientsteam_idsizeof(steam_id));

    
// Get client Details
    
GetClientName(clientplayer_namesizeof(player_name));

    
// For Interger values
    
new cvarValueNew StringToInt(cvarValue);

    
//if sv_cheats is not equalto 0 then we ban the player
    
if (cvarValueNew != 0)
    {
        
PrintToChatAll("======== CHEATER FOUND! ========");
        
LogToGame("%s Was banned for Hacking"steam_id);
        
ServerCommand("banid 0 %d",GetClientUserId(client));
        
ServerCommand("writeid");
        
ServerCommand("kickid %d \"Hacks!\"",GetClientUserId(client));
        
    }
    
//this checks to see if the player is unconneted or not the player is unconnected or not
    
if (strcmp(player_name"\0") == 0
    { 
        
LogToGame("%s Was banned for being Unconnected"steam_id);
        
ServerCommand("banid 0 %d",GetClientUserId(client));
        
ServerCommand("writeid");
        
ServerCommand("kickid %d \"Unconnected!\"",GetClientUserId(client));
    }

Yup thats pretty much it, nice one! Just needs a check to confirm that sv_cheats is not enabled on the server.

Bl4nk, as for steam_id[0] = '\0'; I took this from the base banning plugins a while back, check the core SM files

I've had the original code running on our main server over night and it found no-one (luckily enough) and hasn't reported an error

Matt
__________________
MoggieX is offline
Send a message via Skype™ to MoggieX
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode