Raised This Month: $ Target: $400
 0% 

intercept the cmd command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kaboomkazoom
Junior Member
Join Date: Dec 2004
Old 02-13-2005 , 17:26   intercept the cmd command
Reply With Quote #1

Is it possible to see which client executed the "cmd" command from his console ? I want to trace the command
Code:
cmd name "whatever you want"
which when executed from any client on a CS 1.5 server, changes the name of the sever to "whatever you want", which is very irritating.

I tried "register_concmd" & "register_clcmd" but they don't work for "cmd". I also tried "client_command" this also works for other commands like "say" or "kill" but don't works for "cmd"

the code that i wrote is as follows:
Code:
#include <amxmodx> #include <amxmisc> public client_command(id) {     new comm[10], name[20]     get_user_name (id, name, 19)     read_argv (0,comm,9)     if (contain(comm,"cmd")!=-1)         client_print(0,print_chat,"cmd command was run by : %s",name)     return PLUGIN_CONTINUE } public plugin_init() {     register_plugin("Disable cmd command","1.0","Smoke")        return PLUGIN_CONTINUE }
I have not used "return PLUGIN_HANDLED" coz then no command is able to execute on the client as the plugin stops them all. This can be handled though but thats not the main concern. the main thing is how to catch "cmd".
kaboomkazoom is offline
BlueRaja
Senior Member
Join Date: Nov 2004
Old 02-13-2005 , 20:24  
Reply With Quote #2

I've never heard of the cmd command.
What's it do? Sounds like rcon, from the way you describe it..
No one should be able to change the name of the server, btw, unless you give them the rcon password (or the rcon flag in amxx).
__________________
STEPS IN TROUBLESHOOTING <insert anything here>:
1. Narrow down the problem to a specific condition or conditions.
2. Fix it.
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 02-13-2005 , 20:27  
Reply With Quote #3

Its an exploit that is fixed on steam servers, but not WON ones. You could download files from the server with it, and execute some commands. Not sure how to catch it though, might not even be possible
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
BlueRaja
Senior Member
Join Date: Nov 2004
Old 02-13-2005 , 23:33  
Reply With Quote #4

Oh..
Well in that case, I've got a fix: use steam.
__________________
STEPS IN TROUBLESHOOTING <insert anything here>:
1. Narrow down the problem to a specific condition or conditions.
2. Fix it.
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
kaboomkazoom
Junior Member
Join Date: Dec 2004
Old 02-14-2005 , 05:06  
Reply With Quote #5

from the function list i came across a function as dllfunc. there its wrritten that clientcommand function can be called as follows
Quote:
DLLFunc_ClientCommand, // void ) ( edict_t *pEntity );
and the detail of this function is given at metamod.org as
Quote:
ClientCommand
from dlls/client.cpp:

void ClientCommand(edict_t *pEntity);

Called each time a player uses a "cmd" command. Use CMD_ARGS, CMD_ARGV, and CMD_ARGC to get pointers to the character string command.
but i dont know how to use this function. please if anyone could help me use this function ???
kaboomkazoom is offline
Reply


Thread Tools
Display Modes

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 19:22.


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