Raised This Month: $44 Target: $400
 11% 

[EXTENSION] Rcon Hooks 1.0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Samantha
SourceMod Donor
Join Date: Feb 2010
Location: Madagascar
Old 01-07-2011 , 19:29   [EXTENSION] Rcon Hooks 1.0
Reply With Quote #1

RCON Hooks

What?
Rhooks is an extension that allows you to hook 2 major rcon functions, allowing you to change the result. I thought it would be very useful for servers in which admins get rcon access, because you can assign separate passwords per different admins based on ip, and it can also prevent brute force attacks, because you can deny access from anywhere other than your ip!

This is derived from gmsv_rcon from gmod. Contains lots of code from that project.

Compatibility
This currently works on orange box games, on windows only. However im gonna be making a Linux version as soon as i learn how to do it and eventually make versions for l4d.

Forwards
Code:
**
 * Called when an auth message is sent to the engine. 
 * Return Plugin_Continue to allow the auth to be handled by the engine.
 * Else the value in AllowAccess is used.
 *
 * Note: AllowAccess contains whether the engine wants to deny or give access
 *        to the rcon message.
 *
 * @param Password        Password sent in the query.
 * @param AllowAccess    Bool that shows whether the password is valid or invalid.
 * @param Ip            Ip Address of the origin on the message.
 * @param Port            Port of the origin on the message.
 * @return                Plugin_Continue to allow the engine to handle it, else it uses the bool 
 *                         AllowAccess to allow/deny access.
 */

forward Action:OnRconCheckPassword( String:Password[], &bool:AllowAccess, String:Ip[], Port );

/**
 * Called when a data request is sent to the server.
 * Return Plugin_Continue to allow the request to be handled by the engine.
 * Else it is blocked.
 *
 * Note: AllowAccess contains whether the engine wants to deny or give access
 *        to the rcon message.
 *
 * @param Id            Id of the rcon message.
 * @param Request        Request type of the message, ( 2 = Command ), (3 = Auth )
 * @param Data            String the contains the rcon message sent from the Ip.
 * @param Ip            Ip Address of the origin on the message.
 * @param Port            Port of the origin on the message.
 * @return                Plugin_Continue to allow the engine to proccess and preform the message
 *                        otherwise it will be denied.
 */
forward Action:OnWriteDataRequest( Id, Request, String:Data[], String:Ip[], Port );
Info
- Request is the type of rcon message. 2 or 3 are valid types, 2 is used to send commands and 3 is used for authentication. Other types are not used.
- Id is simply the order of commands sent from one source, per session.
- IP format includes the seperaters ( dont know the name of them lol ).

Why?
I've always wanted a more secure rcon method and i saw gmsv_rcon, on facepuch and i've always wanted it in sourcemod. Therefore a few days i wanted to learn C++ cause i was bored so i though why not convert it to work in sourcemod!

Credits
Long list here lol
- gmsv_rcon author chrisaster - most of this is derived from his code, how ever lots was recoded.
- asherkin for taking his time and teaching me how to fix my detour errors and learn more indepth about detours.
- psychonic for telling me to scrap the gmod detours and use the ones SM uses, and providing me with an example of how to use it.
- Drifter for helping me fix countless errors and helping me get started.
- Other people on IRC such as Matt and Kyle.

http://code.google.com/p/samanthas-work/downloads/list

Source Code
__________________
"I give sopport and knolage in making extractions"
"MASTER(D) - dun0: are you mocing me?" -Master the grate

Plugins
Godmode Until Attack | No Block Team Filter
Extensions
Rcon Hooks

Last edited by Samantha; 01-08-2011 at 01:06.
Samantha is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-07-2011 , 19:53   Re: [EXTENSION] Rcon Hooks 1.0
Reply With Quote #2

Nice job!
psychonic is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 01-07-2011 , 20:40   Re: [EXTENSION] Rcon Hooks 1.0
Reply With Quote #3

Whatever you say... JAMES!
Seta00 is offline
xomp
BANNED
Join Date: Jul 2008
Old 01-07-2011 , 20:44   Re: [EXTENSION] Rcon Hooks 1.0
Reply With Quote #4

Awesome work! <3 asherkin & psychonic for being so helpful!
xomp is offline
Send a message via Skype™ to xomp
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 01-08-2011 , 03:22   Re: [EXTENSION] Rcon Hooks 1.0
Reply With Quote #5

I can't for the life of me get this compiled on Linux.

PHP Code:
extension.cppIn function ‚netadr_sListenerIDToAddress(CServerRemoteAccess*, unsigned int):
extension.cpp:66:2errorexpected ‚(‚ before ‚{‚ token
extension
.cpp:67:3error‚PUSHAD‚ was not declared in this scope
extension
.cpp:68:3errorexpected ‚;‚ before ‚MOV‚ 
No doubt I'm doing something wrong. >.<

I hope nothing is specific to Windows.
KyleS is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-08-2011 , 03:59   Re: [EXTENSION] Rcon Hooks 1.0
Reply With Quote #6

Quote:
Originally Posted by Kyle12 View Post
I can't for the life of me get this compiled on Linux.
You can't compile this for Linux straight off, thats a block of raw ASM opcodes .
That whole function should be rewritten.
__________________
asherkin is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 01-08-2011 , 05:01   Re: [EXTENSION] Rcon Hooks 1.0
Reply With Quote #7

Quote:
Originally Posted by asherkin View Post
You can't compile this for Linux straight off, thats a block of raw ASM opcodes .
That whole function should be rewritten.
Ah, shoot.
KyleS is offline
-=Leb=-
SourceMod Donor
Join Date: Dec 2008
Location: Sweden/Stockholm
Old 11-11-2011 , 12:12   Re: [EXTENSION] Rcon Hooks 1.0
Reply With Quote #8

how do you load this extension? does it still work? i installed it and restart the server but it never loads.
-=Leb=- is offline
urban_ninja
Senior Member
Join Date: Feb 2009
Old 01-16-2015 , 12:36   Re: [EXTENSION] Rcon Hooks 1.0
Reply With Quote #10

Quote:
<FAILED> file "rconhooks.ext.dll": Could not read rconhacks.txt: Section beginning without a matching ending
Why is this file release broken?

Last edited by urban_ninja; 01-16-2015 at 12:39.
urban_ninja 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 18:02.


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