Privilege Escalation on Linux

Share on:

OSCP Notes

  1. Tools for enumeration

  2. Kernel exploit enumeration tools

  3. Services exploits

    • List services

      sc query

    • Query service configuration

      sc qc <service name>

    • Query current status

      sc query <service name>

    • modify service

      sc config <service name> <option>= <value>

    • Stop/Start service

      net start/stop <service name>

  4. Registry enumeration

    • Check current values in Service registry

      req query HKLM\SYSTEM\CurrentControlSet\services\regsvc

    • Override a value in registry

      reg add HKLM\SYSTEM\CurrentControlSet\services\regsvc /v <parameter> /t REG_EXPAND_SZ /d <value> /f

    • Autorun Programs

      reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

    • Check for passwords

      reg query HKLM /f password /t REG_SZ /s

      reg query HKCU /f password /t REG_SZ /s

    • Check for config files

      dir /s *pass* == *.config

      findstr /si password *.xml *.ini *.txt

  5. SAM and System files

    • SAM and System files can be located at : c:\Windows\System32\config
    • Backups of these files can be located at: C:\Windows\Repair OR C:\Windows\System32\config\RegBack
    • samdump or pwdump tools can help dump files. Use https://github.com/CiscoCXSecurity/creddump7.git to download creddump7 suite.
  6. Startup apps can be found at -

    • C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp