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

[DISCLAIMER] Shell/Bash/CMD Access through HLDS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
souvikdas95
Senior Member
Join Date: Mar 2012
Old 03-21-2016 , 13:03   [DISCLAIMER] Shell/Bash/CMD Access through HLDS
Reply With Quote #1

Before I actually post the module, I wanted to see the pitiful reaction of the hosters who have been selling servers in bulk while giving users access to files only within the game folder...

You may now begin to post reviews

Embrace all you can . . . Coz the end is coming . . .

Last edited by souvikdas95; 03-21-2016 at 13:05.
souvikdas95 is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 03-21-2016 , 13:22   Re: [DISCLAIMER] Shell/Bash/CMD Access through HLDS
Reply With Quote #2

Yeah its possible if the Linux/Windows hlds_run by user's permissions are not set correctly.
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline
souvikdas95
Senior Member
Join Date: Mar 2012
Old 03-21-2016 , 13:26   Re: [DISCLAIMER] Shell/Bash/CMD Access through HLDS
Reply With Quote #3

Quote:
Originally Posted by Shooting King View Post
Yeah its possible if the Linux/Windows hlds_run by user's permissions are not set correctly.
what user's permissions? if hlds_run doesn't have basic user permissions, it won't be able to run any of its modules! At some point, it requires interaction with kernel and it's shared by all modules. Hence, the end is near
souvikdas95 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-21-2016 , 13:57   Re: [DISCLAIMER] Shell/Bash/CMD Access through HLDS
Reply With Quote #4

Quote:
Originally Posted by souvikdas95 View Post
what user's permissions? if hlds_run doesn't have basic user permissions, it won't be able to run any of its modules! At some point, it requires interaction with kernel and it's shared by all modules.
All libraries are read-only for all users because of that, take a look at your /lib folder if you are running a Linux distribution. Programs and other libraries can still read(load, open) them when they are ran by any user, but can't write to them. If a hosting company has their permissions set properly (and they deserve to be "hacked" in such a way if they don't), you won't be able to change (or even read) any files other than libraries and binaries outside your server's directory.

Last edited by klippy; 03-21-2016 at 13:58.
klippy is offline
souvikdas95
Senior Member
Join Date: Mar 2012
Old 03-21-2016 , 14:15   Re: [DISCLAIMER] Shell/Bash/CMD Access through HLDS
Reply With Quote #5

Quote:
Originally Posted by KliPPy View Post
All libraries are read-only for all users because of that, take a look at your /lib folder if you are running a Linux distribution. Programs and other libraries can still read(load, open) them when they are ran by any user, but can't write to them. If a hosting company has their permissions set properly (and they deserve to be "hacked" in such a way if they don't), you won't be able to change (or even read) any files other than libraries and binaries outside your server's directory.
I presume that you are thinking about writing to libraries. I don't understand it. Why would you want to write into a built-in library?
Also, correction: "any files other than libraries and binaries inside your server's directory."
Well till now I have worked on windows and I assure you it's not the case here.
Assuming that in linux, you can actually isolate a directory by virtualizing it entirely in a container, it would still require the fundamental libraries to run ( atleast if you want to run hlds ). All I would need to do is link them dynamically since they are available to read. In case, if they are not, I would statically link them. In that way, I won't need to worry about guest os dependencies.
In any case, the binaries available for use ( commands or env vars or path-to-binaries ) would be entirely limited to guest user or the user running hlds. Nothing can be done about that ( atleast not in linux and to even achieve such level of isolation is not easy since you would need to practically determine the minimum library dependencies of hlds alone alongside the commands or env vars that it is dependent on and whether those are user specific or global! ).
Thanks to metamod for enabling us to ruin HLDS xD

Last edited by souvikdas95; 03-21-2016 at 14:37.
souvikdas95 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-21-2016 , 14:37   Re: [DISCLAIMER] Shell/Bash/CMD Access through HLDS
Reply With Quote #6

I still have no idea what "ruining" are you talking about. Changing files outside of your provided server's directory? Tell me what do you want to "ruin"?

Last edited by klippy; 03-21-2016 at 14:38.
klippy is offline
souvikdas95
Senior Member
Join Date: Mar 2012
Old 03-21-2016 , 15:15   Re: [DISCLAIMER] Shell/Bash/CMD Access through HLDS
Reply With Quote #7

Quote:
Originally Posted by KliPPy View Post
I still have no idea what "ruining" are you talking about. Changing files outside of your provided server's directory? Tell me what do you want to "ruin"?
well, in linux not much if everything has already been taken care of for the user and the env for running hlds but in windows, a lot since the files outside the directory are not isolated but rather hidden i.e. the structure remains the same unlike highly isolated container concepts of linux. one may confuse this scenario with that of web servers in windows wherein you don't allow clients to access files outside the working directory but that is the case in which client doesn't have access to program's internal working block, bound to kernel. In HLDS, you get to actually modify that and hence whatever rights go to HLDS, also go to the modules it runs. So far, I have only tested running apps within the bounds of Windows through HLDS but only as the same user. I can change the user as well if either I have the info about the user I want to run as ( duh?! ) or if I have been given the admin rights ( lol I am personifying hlds xD )
In case of linux, assuming that neither terminal access nor env vars or binaries for implementing bash is not given, then anything that a user wants to execute would have to be an independent process, compiled within the bounds of dependencies of hlds itself but explicitly linked through a module. So, I believe I would have to give the rights to execute any process and not just bash/cmd/shell/terminal only if I want to give complete access ( within the grants of the user running hlds ).
As far as importing modules is concerned, there's a huge flaw in metamod which enables us to do anything as long as we are given minimal rights to upload files in an hlds server:
1. change the name of module to anything that you are allowed to upload
2. simply write it down in plugins.ini and it would be loaded in next map change
3. in case, if after reading this, the metamod makers plan to fix this bug, then provided you already have amxmodx ready, you can use the build-in functions ( natives ) to rename the file to appropriate extensions and then write in plugins.ini
4. in case neither of these cases apply, upload your own or old metamod binary by renaming to suitable uploadable extension and change the contents of "liblist.gam" file to point to that binary.
5. if even that is not applicable due to liblist.gam being hidden, then change the command line argument of hlds if the game hoster provides it in GUI by adding "-dll <name.dll> - Specifies which game DLL to use"
All in all, there are plenty of ways of intruding through an HLDS server. Adding its ability of opening itself to kernel, you can literally beat the shit out of any machine!

Last edited by souvikdas95; 03-21-2016 at 15:24.
souvikdas95 is offline
souvikdas95
Senior Member
Join Date: Mar 2012
Old 03-21-2016 , 15:41   Re: [DISCLAIMER] Shell/Bash/CMD Access through HLDS
Reply With Quote #8

Now when I think about isolation in linux, nothing can hide from kernel unless you use an entirely different distribution of linux. Hence, HLDS can break down a system even with minimal rights.
eg. A Simple script to create thread with highest priority or processes with an infinite loop can block all system calls! eventually leading to a system in "hung" state irrespective of process attributes of calling process!

Last edited by souvikdas95; 03-21-2016 at 15:42.
souvikdas95 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-21-2016 , 22:34   Re: [DISCLAIMER] Shell/Bash/CMD Access through HLDS
Reply With Quote #9

tl;dr

You are assuming a lot about the permission settings of your host's OS and users (i.e. that they don't konw how to run a commercial server). You can't gain access to stuff to which you don't have access.
__________________
fysiks is offline
souvikdas95
Senior Member
Join Date: Mar 2012
Old 03-22-2016 , 04:26   Re: [DISCLAIMER] Shell/Bash/CMD Access through HLDS
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
tl;dr

You are assuming a lot about the permission settings of your host's OS and users (i.e. that they don't konw how to run a commercial server). You can't gain access to stuff to which you don't have access.
That's definitely true... It all depends on the user the hlds runs as... In Windows by default the permissions are not too strict but in linux they are... If i give the access to a process's internal block, atleast the process of intervening would not be limited to amx or in built hlds structures and commands. I don't think any hoster who gives in bulk can deny this... Only way to block such an intervention would be to secure the game dll in all ways which may not be feasible due to above mentioned... A hacker knows how to intervene... I would only need to provide a platform with known language which metamod clearly does give.
I don't really care about the host OS restrictions but atleast by doing this it would help bring out the true specs of environment hlds runs in...
Think about mmtimer module... It literally hacks into kernel to provide increased fps by adjusting the timer specs related to hlds... But then most hosters prefer such kind of hacks without even realizing how open they have kept their environment for a single process! Notice that it doesnt even require admin privilleges!
souvikdas95 is offline
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 15:48.


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