• How to disable console commands? Or detect them?
    19 replies, posted
Hey guys, I've been messing around a bit and I was wanting to detect a console command and then do something. E.g when a player types a certain console command it then prints what they typed, but more specifically just a console command like +attack I've tried modules and all sorts but I can't figure it out, thank you very much for your help.
To your specific example, there are several ways you could detect this depending on your needs. [url]http://wiki.garrysmod.com/page/GM/PlayerBindPress[/url] [url]http://wiki.garrysmod.com/page/GM/KeyPress[/url] [url]http://wiki.garrysmod.com/page/GM/CreateMove[/url]
[QUOTE=scottd564;44429030]A movement command? There's several ways you could detect this depending on your needs. [url]http://wiki.garrysmod.com/page/GM/PlayerBindPress[/url] [url]http://wiki.garrysmod.com/page/GM/KeyPress[/url] [url]http://wiki.garrysmod.com/page/GM/CreateMove[/url][/QUOTE] Thanks for you reply, but not necessarily movement. Commands in general, like if GetConvar(string. blah blah) etc, like an actual way to detect a sole console command.
You cannot detect someone opening the console and typing a cvar like +attack You can do cvar.addchangecallback to see when a value is changed, but if the value isnt changed, you wont know
Interesting. So as another example there's no way to detect someone using lua_openscript_cl? Something that can have any value? Or is that different?
[QUOTE=Noi;44429122]Except that you can[/QUOTE] Then, how? O.e
Detect when the console is open, monitor keypresses to know what command is being entered. There must be a module to make it easier; I wonder if cvar3 would do it.. Anyways, if Killburn should add anything that would help against cheats, this would be it. An EASY way to detect what's being typed into console. We can already grab binds / bound to key stuff, so ...
How does some server knowing what one types in his console help against cheaters? It's an infringement of one's privacy and it won't stop anyone from cheating.
[QUOTE=Acecool;44429326]Detect when the console is open, monitor keypresses to know what command is being entered.[/QUOTE] Wouldn't that be a little too intrusive? A simple hook along the lines of [lua] GM:ConInputSubmitted( string userInput ) [/lua] that gets called whenever something is submitted in console is more than enough, you don't need a full blown keylogger to achieve the desired effect. [editline]ur gay[/editline] [QUOTE=LennyPenny;44429478]How does some server knowing what one types in his console help against cheaters? It's an infringement of one's privacy and it won't stop anyone from cheating.[/QUOTE] The same way the information about the contents of a process' memory does: being able to check for suspicious stuff. I'm all for respecting people's privacy and all that but let's be honest here, it's not like you'll be putting your credit card details or any other sensitive information in your console at any given point. Besides, render.Capture is a bigger offender in terms of "privacy" than a simple console input callback.
[QUOTE=LennyPenny;44429478]How does some server knowing what one types in his console help against cheaters? It's an infringement of one's privacy and it won't stop anyone from cheating.[/QUOTE] Are you always dumb or are you dumb when you want to be? Thanks npypntz I'll check it out.
[QUOTE=GregNorman;44429544]Thanks npypntz I'll check it out.[/QUOTE] FYI that's not an actual hook, just a simplified version of an idea that Acecool proposed.
[QUOTE=npypntz;44429601]FYI that's not an actual hook, just a simplified version of an idea that Acecool proposed.[/QUOTE] Yeah, my friend suggested detouring concommand.Add via creating a list so I'm not sure how affective that could be
[QUOTE=GregNorman;44429544]Are you always dumb or are you dumb when you want to be? [/QUOTE] [t]http://i.imgur.com/scM3K1U.png[/t]
[QUOTE=LennyPenny;44429763][t]http://i.imgur.com/scM3K1U.png[/t][/QUOTE] The person that labelled you as a winner clearly needs to be checked. I sent them to a few people, how does that affect what I said? EDIT: Judging by your first reply and this one I guess you're unable to comprehend simple motor skills and understand basic English [highlight](User was banned for this post ("Flaming / Being rude" - Swebonny))[/highlight]
[QUOTE=LennyPenny;44429763][t]http://i.imgur.com/scM3K1U.png[/t][/QUOTE] I got the same message. He's fucking about.
[QUOTE=GregNorman;44430373]The person that labelled you as a winner clearly needs to be checked. I sent them to a few people, how does that affect what I said? EDIT: Judging by your first reply and this one I guess you're unable to comprehend simple motor skills and understand basic English[/QUOTE] Ad hominem gets you nowhere.
[QUOTE=GregNorman;44430373]I sent them to a few people, how does that affect what I said? EDIT: Judging by your first reply and this one I guess you're unable to comprehend simple motor skills and understand basic English[/QUOTE] [QUOTE=GregNorman;44429544]Are you always dumb or are you dumb when you want to be?[/QUOTE]
[QUOTE=LennyPenny;44429478]How does some server knowing what one types in his console help against cheaters? It's an infringement of one's privacy and it won't stop anyone from cheating.[/QUOTE] Well, for example if they type in console aimbot 1, or something like that it's easy to see how it could help. We can see when they're binding keys to hack-commands, or when we see unknown commands ( which has nothing to do with gmod ) then there's a good chance something is fishy. It could help prevent false positives in certain detection methods. It'd be another tool which would be easier than the current method. Currently, if you want this feature, you need to monitor when console is open ( easy ), and track each key typed until it forms a string / concommand and they press enter. ( tedious ).
Yes that's obvious, but it doesn't help against cheaters in any way shape or form. There are even public "hacks" right now that totally circumvent usage of the console. (Most bad anti-cheats just scan for console stuff) Something like this would do effectively nothing against cheaters and only encourage servers logging what one types into ones console which is non of their business tbh.
Sorry, you need to Log In to post a reply to this thread.