GeorgeBanu
  • About me
  • Pentesting CheatSheets
    • Information Gathering
    • Ports Enumeration
      • FTP-21
      • SSH-22
      • Telnet-23
      • SMTP - 25,465,587
      • DNS-53
      • NetBIOS, SMB - 139,445
      • SNMP-161
      • MySQL-3306
      • RDP-3389
      • WinRM-5985
    • Web Cheat Sheet
    • Privilege Escalation
      • Linux Enumeration
      • Linux Privesc Techniques
    • Tricks
    • Template
  • TryHackMe Writeups
    • Starter
    • Dreaming
    • ColddBox: Easy
    • Ollie
    • Blog
    • KoTH Hackers
    • Brooklyn Nine Nine
    • Chill Hack
    • Undiscovered
    • Archangel
    • Jason
    • GLITCH
    • VulnNet: Node
    • Road
    • VulnNet:Internal
    • W1seGuy
  • CyberEDU Writeups
    • flag-is-hidden
    • file-crawler
    • reccon
    • this-file-hides-something
    • wifiland
    • old-tickets
    • inodat
    • pattern
    • ultra-crawl
  • eJPT
Powered by GitBook
On this page
  • Some basic vulnerability explanations
  • Kernel Exploits
  • Sudo
  • SUID
  • Cron Jobs
  1. Pentesting CheatSheets
  2. Privilege Escalation

Linux Privesc Techniques

Some basic vulnerability explanations

Kernel Exploits

  • Great resource -> https://www.linuxkernelcves.com/cves

  • First you need to enumerate the kernel version then search for exploits on google

Sudo

  • Leverage LD_PRELOAD

    • Check for LD_PRELOAD (with the env_keep option)

    • Write a simple C code compiled as a share object (.so extension) file

    • Run the program with sudo rights and the LD_PRELOAD option pointing to our .so file

  • Leverage application function

If you have sudo rights to run a program see this -> https://gtfobins.github.io/

SUID

SUID -> set user ID

  • SUID bit allows users to run executable files with the same permissions as the owner of that file

  • Find files that are SUID bit.

  • Search on gtfobins for exploit a SUID file

See https://www.stationx.net/linux-file-permissions-cheat-sheet/ for more info about file permissions

Cron Jobs

Cronjobs -> scheduled tasks

  • Identify the active jobs.

  • Check if there’s a scheduled task that runs with root privileges or any other user.

  • Change the script that will be run & gain that jobs owner privileges. (we can change if that script has write,execute perm or not full path defined loopholes etc).

PreviousLinux EnumerationNextTricks

Last updated 1 year ago