👾
Rootkid - Cyber Journal
Portfolio
  • 👩‍🚀Introduction
    • 🤖About Cyber Journal & Rootkid
    • 📜License Agreement
    • ⚠️Disclaimer
  • 📚Exam Prep Notes
    • 🗒️KLCP Exam (PEN-103) - Notes
      • 1. Linux Fundamentals
      • 2. Introduction
      • 3. About Kali Linux
      • 4. Getting Started with Kali Linux
      • 5. Installing Kali Linux
      • 6. Configuring Kali Linux
      • 7. Helping Yourself and Getting Help
      • 8. Securing and Monitoring Kali Linux
      • 9. Debian Package Management
      • 10. Advanced Usage
      • 11. Kali Linux in the Enterprise
      • 12. Introduction to Security Assessments
      • 13. Conclusion: The Road Ahead
    • 📒ISO/IEC 27001:2022 Lead Auditor - Notes
      • ISO - Training - Day - 1
      • ISO - Training - Day - 2
      • ISO - Training - Day - 3
      • ISO - Training - Day - 4
      • Practice Questions - Notes
      • Other PDF References
    • 📑Junior Penetration Tester (eJPTv2) - Notes
      • 💡Assessment Methodologies
        • 🔍Information Gathering
          • 🌏Passive Information Gathering
          • 🧐Active Information Gathering
        • 👣Footprinting & Scanning
          • 🗺️Mapping a Network
          • 🎛️Port Scanning
        • 🕵️Enumeration
          • 📜SMB Enumeration
          • 📂FTP Enumeration
          • 🐚SSH Enumeration
          • 🕸️HTTP Enumeration
          • 🗄️MySQL & MSSQL Enumeration
        • 🐛Vulnerability Assessment
          • 🩸Case Study: Heartbleed Vulnerability (CVE-2014-0160)
          • 🔵Case Study: EternalBlue Vulnerability (CVE-2017-0143)
          • 👨‍💻Case Study: Log4J Vulnerability (CVE-2021-44228)
      • 🧰Assessment Methodologies: Auditing Fundamentals
      • 📶Host & Network Penetration Testing
        • 💻System/Host Based Attacks
          • 🪟Overview Of Windows Vulnerabilities
          • 💣Exploiting Windows Vulnerabilities
            • 🧨Exploiting Microsoft IIS WebDAV
            • 🧨Exploiting WebDAV With Metasploit
            • 🧨Exploiting SMB With PsExec
            • 🧨Exploiting Windows MS17-010 SMB Vulnerability (EternalBlue)
            • 🧨Exploiting RDP - Brute Force
            • 🧨Exploiting Windows CVE-2019-0708 RDP Vulnerability (BlueKeep)
            • 🧨Exploiting WinRM
          • 📈Windows Privilege Escalation
            • 🔥Windows Kernel Exploits
            • 🔥Bypassing UAC With UACMe
            • 🔥Access Token Impersonation
          • 🗃️Windows File System Vulnerability - Alternate Data Streams
          • 💳Windows Credential Dumping
            • 🔑Searching For Passwords In Windows Configuration Files
            • 🔑Dumping Hashes With Mimikatz
            • 🔑Pass-The-Hash Attacks
          • 💎Linux Vulnerabilities
          • 🎰Exploiting Linux Vulnerabilities
            • 🐚Exploiting Bash CVE-2014-6271 Vulnerability (Shellshock)
            • 🗄️Exploiting FTP - Linux
            • 🔐Exploiting SSH - Linux
            • 📭Exploiting SAMBA - Linux
          • ‼️Linux Privilege Escalation
            • 💥Linux Kernel Exploits
            • 💥Exploiting Misconfigured Cron Jobs
            • 💥Exploiting SUID Binaries
          • 🔐Linux Credential Dumping
        • 📶Network-Based Attacks
          • 📦Tshark & Filtering Basics
          • 🕷️Arp Poisoning
        • 💣The Metasploit Framework (MSF)
        • 💥Exploitation
          • 🖲️Vulnerability Scanning
          • ⚠️Searching For Exploits
          • 🐚Bind & Reverse Shells
          • 👾Exploitation Frameworks
          • 🪟Windows Exploitation
          • 🥌Linux Exploitation
          • ☣️AV Evasion & Obfuscation
        • 🚩Post-Exploitation
          • 🌬️Windows Local Enumeration
          • 📟Linux Local Enumeration
          • 🚜Transferring Files To Windows & Linux Targets
          • 🔼Upgrading Shells
          • 👀Windows Privilege Escalation
          • ⚒️Linux Privilege Escalation
          • 🔮Windows Persistence
          • 🧙Linux Persistence
          • 〰️Dumping & Cracking Windows Hashes (NTLM Hashes)
          • 🍘Dumping & Cracking Linux Password Hashes
          • ➿Pivoting Overview
          • 🧹Clearing Your Tracks On Windows & Linux
        • 🧑‍🔬Social Engineering Fundamentals
      • 🕸️Web Application Penetration Testing
        • ℹ️Intro to Web
        • 🎯Directory Enumeration
        • 🧰BurpSuite and ZAP-Proxy Overview
        • 🛠️Nikto, SQLMap, XSSer & Hydra Overview
      • 👽Extra Resources
        • ➕CIDR Conversion Table
        • 📦Machines or Lab Solved to Practice
    • 📓Certified in Cybersecurity - (ISC)2 - Notes
      • 📝Chapter-1 Security Controls - Notes
      • 📝Chapter-2 Incident Response, Business Continuity & Disaster Recovery - Notes
      • 📝Chapter 3: Access Control Concepts - Notes
      • 📝Chapter 4: Network Security - Notes
      • 📝Chapter 5: Security Operations - Notes
    • 📕Certified Ethical Hacker v12 - Practical - Notes
      • 👣Module 02: Footprinting and Reconnaissance
      • 🔎Module 03: Enumeration
      • Module 04: Scanning Networks
      • Module 05: Vulnerability Analysis
      • 💻Module 06: System Hacking
      • 🐛Module 07: Malware Threats
      • 🧙Module 08: Sniffing
      • 🐧Module 09: Social Engineering
      • ⚠️Module 10: Denial-of-Service
      • 🪝Module 11: Session Hijacking
      • Module 12: Evading IDS, Firewalls, and Honeypots
      • 🗄️Module 13: Hacking Web Servers
      • Module 14: Hacking Web Applications
      • 💉Module 15: SQL Injection
      • Module 16: Hacking Wireless Networks
      • Module 17: Hacking Mobile Platforms
      • Module 18: IoT and OT Hacking
      • Module 19: Cloud Computing
      • Module 20: Cryptography
      • Extra Resources
        • 📚Helpful Resources
        • 📜Cheat Sheet
  • ✍️Blogs
    • Mastering the Art of Logic Flaws: Unraveling Cyber Mysteries !!!
    • How to write a Detailed Vulnerability Report
    • Payment Gateway Bypass on Government Domain.
Powered by GitBook
On this page
  • Enumerating System Information
  • Enumerating Users & Groups
  • Enumerating Network Information
  • Enumerating Processes & Cron Jobs
  • Automating Linux Local Enumeration

Was this helpful?

  1. Exam Prep Notes
  2. Junior Penetration Tester (eJPTv2) - Notes
  3. Host & Network Penetration Testing
  4. Post-Exploitation

Linux Local Enumeration

Enumerating System Information

  • After gaining initial access to a target system, it is always important to learn more about the system like, what OS is running as well as the OS version. This information is very useful as it gives us an idea of what we can do and what type of exploits we can run.

  • What are we looking for?

    • Hostname

    • Distribution & distribution release version

    • Kernel version & architecture

    • CPU information

    • Disk information & mounted drives

    • Installed packages/software

MSFconsole Commands:

  • sessions -u 1 – upgrades the shell to Meterpreter shell.

Meterpreter Command:

  • sysinfo – Display system information for the compromised machine.

Linux Commands:

  • /bin/bash -i – Start an interactive bash shell.

  • hostname – Display the name of the host (computer) on which the command is executed.

  • cat /etc/issue – Show the operating system and version information.

  • cat /etc/*release – Display distribution-specific release information.

  • uname -a – Show detailed system information.

  • uname -r – Display the kernel release information.

  • env – Display environment variables.

  • lscpu – Display information about the CPU architecture.

  • free -h – Show memory usage in human-readable format.

  • df -h – Display disk space usage for all mounted filesystems.

  • df -ht ext4 – Show disk space usage only for ext4 filesystems.

  • lsblk | grep sd – List block devices (drives) and filter for those containing "sd".

  • dpkg -l – List installed packages on a Debian-based system.

Enumerating Users & Groups

  • After gaining initial access to a target system, it is always important to learn more about the system like, what user account you have access to and other user accounts on the system.

  • What are we looking for?

    • Current user & privileges

    • Other users on the system

    • Groups

Meterpreter Command:

  • getuid – Retrieve the current user's ID and privilege level.

Linux Commands:

  • whoami – Display the name of the currently logged-in user.

  • sudo -l – List available commands that the current user can run with sudo privileges.

  • groups <user> – Show group memberships of a specific user.

  • cat /etc/passwd | grep -v /nologin – Display user accounts excluding those with "/nologin" shell.

  • w – Display currently logged-in users with detailed information.

  • who – Display currently logged-in users.

  • last – Show listing of last logged-in users and logouts.

  • lastlog – Display information about last logged-in users.

Enumerating Network Information

What are we looking for?

  • Current IP address & network adapter

  • Internal networks

  • TCP/UDP services running and their respective ports

  • Other hosts on the network

Meterpreter Commands:

  • ifconfig – Display network interface configuration.

  • netstat – Show network statistics and active connections.

  • route – Display the routing table.

  • arp – Show the ARP (Address Resolution Protocol) cache.

Linux Commands:

  • ifconfig – Display network interface configuration.

  • ip a s – Show IP address information for all interfaces.

  • cat /etc/networks – Display network configuration information.

  • cat /etc/hostname – Show the hostname of the system.

  • cat /etc/hosts – Display the hosts file, mapping hostnames to IP addresses.

  • cat /etc/resolv.conf – Show DNS resolver configuration.

  • arp -a – Display the ARP cache of the system.

Enumerating Processes & Cron Jobs

  • After gaining initial access to a target system, it is always important to learn more about the system like, what processes, services and scheduled tasks are currently running.

  • What are we looking for?

    • Running services

    • Cron Jobs

Meterpreter Command:

  • ps – List running processes on the target system.

Linux Commands:

  • ps – Display running processes.

  • ps aux – List all running processes with detailed information.

  • top – Display dynamic real-time information about system processes.

  • crontab -l – List the cron jobs for the current user.

  • ls -al /etc/cron* – List cron-related files and directories in the /etc/ directory.

  • cat /etc/cron* – Display the content of cron-related files in the /etc/ directory.

Automating Linux Local Enumeration

  • In addition to performing local enumeration manually, we can also automate the process with the help of a few scripts and MSF modules.

  • While local enumeration techniques/commands are important to know, as a penetration tester, you will need to be time efficient. As a result, you will need to learn how to utilize various automated enumeration scripts.

  • In addition to automating the process of enumerating information like system information, users & groups etc, these automated enumeration scripts will also provide you with additional information regarding the target system like; privilege escalation vulnerabilities, locally stored passwords etc.

Linux Local Enum Scripts

MSFconsole Post-exploitation Modules for Linux:

  • /post/linux/gather/enum_configs – Gather configuration information on a Linux system.

  • /post/linux/gather/enum_network – Enumerate network-related information on the target Linux system.

  • /post/linux/gather/enum_system – Enumerate general system information on a Linux system.

  • /post/linux/gather/checkvm – Check if the target Linux system is a virtual machine.

Getting LinEnum Script on Target System:

  1. Visit the GitHub repository of LinEnum Script and copy the script from the RAW tab.

  2. Paste the copied script on the attacking machine.

  3. Use a Meterpreter shell to upload the script to the victim's temporary folder using the "upload <file_path>" command.

  4. Give executable permissions to the script using "chmod +x <script_name>".

  5. Run the script using the command "./linenum".




Hacker's Mantra:In a world of zeros and ones, hackers are the ones who see the bigger picture.

PreviousWindows Local EnumerationNextTransferring Files To Windows & Linux Targets

Last updated 10 months ago

Was this helpful?

- LinEnum is a simple bash script that automates common Linux local enumeration checks in addition to identifying privilege escalation vulnerabilities.

📚
📑
📶
🚩
📟
LinEnum