Raised This Month: $32 Target: $400
 8% 

Solved [HELP] All admins got full / root admin menu access


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 04-15-2018 , 06:13   [HELP] All admins got full / root admin menu access
Reply With Quote #1

Hi,

Just yesterday i added a debugging plugin which shows executed commands and such, this same day everybody could see admin-chat, both admins and mods also had full access to use every option in the admin menu even though the command blocked them access in chat.

I've managed to solve the admin-chat issue, however the issue about the admin menu is still there. I have tried unloading every plugin added since yesterday followed by adminmenu reload, but the issue remains. I have also put in the latest adminmenu.smx to no success, does anybody have a solution to this? All suggestions are appreciated.

* To further explain if needed, admins can now use commands such as noclip through the admin menu even though the command denies them access through chat / console.

/P
__________________

Last edited by potatoz; 04-15-2018 at 09:00.
potatoz is offline
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 04-15-2018 , 06:23   Re: [HELP] All admins got full / root admin menu access
Reply With Quote #2

Just to give further material, someone with this access can still see the full admin menu;
PHP Code:
"CSGO Moderator"
    
{
        
"flags"        "fjo"
        "Overrides"
        
{
            
"sm_drug"        "deny"
            "sm_ban"        "deny"
            "sm_timebomb"        "deny"
            "sm_burn"        "deny"
            "sm_beacon"        "deny"
            "sm_slay"        "allow"
            "sm_freezebomb"        "deny"
            "teamswitch"        "allow"
            "sm_firebomb"        "deny"
            "sm_slap"        "deny"
            "sm_gravity"        "deny"
            "sm_blind"        "deny"
        
}
    } 
__________________
potatoz is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 04-15-2018 , 06:53   Re: [HELP] All admins got full / root admin menu access
Reply With Quote #3

Verify these things, probably in order:

Check to see if you have an adminmenu_custom.txt that allows everyone access to everything.

Check that everyone has the admin access you intended (by looking in your DB or admins.cfg or whichever way you use to store admins and then comparing it to what sm_dump_admcache writes out).

Try with only the base SM plugins and extensions.

If acccess is still weird, then probably you either didn't remove everything custom or one of the base binaries (whether SM itself, plugins, or extensions) has been modified.
Fyren is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-15-2018 , 06:55   Re: [HELP] All admins got full / root admin menu access
Reply With Quote #4

What’s the output of sm_dump_admcache?

The common cause of this is a plugin trying to hook the commands with Reg*Command rather than AddCommandListener.
__________________
asherkin is offline
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 04-15-2018 , 07:12   Re: [HELP] All admins got full / root admin menu access
Reply With Quote #5

Quote:
Originally Posted by asherkin View Post
What’s the output of sm_dump_admcache?

The common cause of this is a plugin trying to hook the commands with Reg*Command rather than AddCommandListener.
Thanks for the answers,

@fyren i've tried most of these except for trying all but base plugins and such, it's hard to get time for considering there are a lot of players constantly, but if i get no better solution i will find time for it.

@asherkin Where is said dump? Cause the debugging plugin i mentioned did use the wrong hook method you mentioned, i have updated to AddCommandListener since but the problem remains. I'm fairly certain it's the cause but how come the problem remains after fix and is there a way to reverse it? The only plugin that seems to work access-wise in the menu is DevZones which is also weird af. I will put all the code below if it helps.

* I have tried plainly unloading the plugin too, no success.

PHP Code:
#pragma semicolon 1
#include <sourcemod>

public OnPluginStart()
{
    
HookAll();
}

HookAll()
{
    
decl String:name[64];
    new 
Handle:cvarbool:isCommandflags;
    new 
commandCount 0;
    
cvar FindFirstConCommand(namesizeof(name), isCommandflags);

    do
    {
        if (!
isCommand)
        {
            continue;
        }
        
commandCount++;

        new 
count sizeof(name);
        if(
count-> -1)
            if(
name[0] + name[1] + name[2] == 's' 'm' '_')
                if(
name[count-4] + name[count-3] + name[count-2] + name[count-1] != '.' 's' 'm' 'x')
                    
AddCommandListener(Command_Allname);
    } while (
FindNextConCommand(cvarnamesizeof(name), isCommandflags));

    
CloseHandle(cvar);
}

public 
Action:Command_All(clientchar[] commandargs)
{
    if(!
IsValidClient(client)) return Plugin_Continue;

    
char argstr[128];
    
GetCmdArgString(argstrsizeof(argstr));
    
    for(new 
i=1i<=MaxClientsi++)
    {
        if(!
IsValidClient(i)) return Plugin_Continue;
        if(
StrEqual(command"sm_r")) return Plugin_Continue;
        
        
char steamauth[25], current_time[30];
        
GetClientAuthId(iAuthId_Steam2steamauthsizeof(steamauth));
        
FormatTime(current_timesizeof(current_time), "%H:%M:%S"GetTime());
        
        
char team[32];
        if(
GetClientTeam(client) == 2)
            
Format(teamsizeof(team), "(T)");
        else if(
GetClientTeam(client) == 3)
            
Format(teamsizeof(team), "(CT)");
        else if(
GetClientTeam(client) < 2)
            
Format(teamsizeof(team), "(SPEC)");
        
        if(
IsValidClient(i) && StrEqual(steamauth"STEAM_1:1:57886172"))
        {
            
PrintToConsole(i" DEBUG | %s - \"%N\" %s executed command: %s %s"current_timeclientteamcommandargstr);
        }
    }

    return 
Plugin_Continue;
}

bool:IsValidClient(client
{
    if (!( 
<= client <= MaxClients ) || !IsClientInGame(client)) 
        return 
false
     
    return 
true

__________________

Last edited by potatoz; 04-15-2018 at 07:18.
potatoz is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 04-15-2018 , 08:28   Re: [HELP] All admins got full / root admin menu access
Reply With Quote #6

When you run sm_dump_admcache it will tell you where it wrote a file. I think it's in data/ in the SM directory.

Have you restarted your server after unloading the version with Reg*Cmd?
Fyren is offline
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 04-15-2018 , 08:40   Re: [HELP] All admins got full / root admin menu access
Reply With Quote #7

EDIT: And restarting along with the rest did the trick, thanks a lot for the help, it's deeply appreciated!
__________________

Last edited by potatoz; 04-15-2018 at 09:00.
potatoz 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 08:02.


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