👾
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
  • SMB: Windows Discover & Mount
  • SMB: Nmap Enumeration Scripts
  • Knowledge Center:
  • SMB: SMBMap
  • SMB: Samba
  • RPC-Client tool for Samba Enumeration
  • Enum4linux tool for Samba Enumeration
  • Smbclient tool for Samba Enumeration
  • Msfconsole tool for Samba Enumeration
  • Nmblookup tool for Samba Enumeration
  • SMB: SMB Dictionary Attack

Was this helpful?

  1. Exam Prep Notes
  2. Junior Penetration Tester (eJPTv2) - Notes
  3. Assessment Methodologies
  4. Enumeration

SMB Enumeration

SMB, which stands for "Server Message Block," is a way computers talk and share stuff, like files and printers, on a network. It's like a language they use to understand each other. Imagine it as a system that helps computers in an office share documents with each other easily. Just like passing notes between friends, SMB lets computers pass files and info back and forth, so everyone can work together and access the same stuff on the network. The default port for SMB (Server Message Block) is TCP port 445. This is the port used for communication between computers sharing files and resources on a network using the SMB protocol.

SMB: Windows Discover & Mount

In this section, the focus was on SMB (Server Message Block) and its protocol (port 445). The content covered how to detect SMB on a Windows system and provided a general example of SMB usage. Below are the commands that can aid in identifying SMB services on any Windows system:

To identify SMB services using Nmap, you can use the following command:

nmap -p 445 <target_IP>

To check if the target system supports SMB version 1 using Nmap, you can use the following command:

nmap --script smb-vuln-ms17-010 -p 445 <target_IP>
nmap -p 445 --script smb-protocols <target_IP>

Other Nmap Flags which can help: -sV -p- -A -T4

Remove / Delete SMB Drive from your computer:

net use * /delete

Add / Access SMB Drive from your computer:

net use <your_drive_letter> \\\\<smb_server_ip\\drive$> <password>/user:<username>
net use z: \\\\10.17.3.2\\C$ this-is-my-pass/user:admin

SMB: Nmap Enumeration Scripts

Nmap Scripts to enumerate the running SMB and Samba services.

nmap -p445 --script smb-protocols <target>
nmap --script smb-security-mode.nse -p445 <target>
nmap -p445 --script smb-enum-sessions.nse --script-args smbusername=administrator,smbpassword=smbserver_771 <target>
nmap --script smb-enum-sessions.nse -p445 <target>
nmap --script smb-enum-shares.nse -p445 <target>
nmap -p445 --script smb-enum-shares.nse --script-args smbusername=administrator,smbpassword=smbserver_771 <target>
nmap -p445 --script smb-enum-shares.nse,smb-ls --script-args smbusername=administrator,smbpassword=smbserver_771 <target>
nmap --script smb-enum-users.nse -p445 <target> 
nmap -p445 --script smb-enum-users.nse --script-args smbusername=administrator,smbpassword=smbserver_771 <target>
nmap --script smb-server-stats.nse -p445 <target>
nmap -p445 --script smb-server-stats.nse --script-args smbusername=administrator,smbpassword=smbserver_771 <target>
nmap --script smb-enum-domains.nse -p445 <target>
nmap -p445 --script smb-enum-domains.nse --script-args smbusername=administrator,smbpassword=smbserver_771 <target>
nmap --script smb-enum-users.nse -p445 <target>
nmap -p445 --script smb-enum-users.nse --script-args smbusername=administrator,smbpassword=smbserver_771 <target>
nmap --script smb-enum-services.nse -p445 <target>
nmap -p445 --script smb-enum-services.nse --script-args smbusername=administrator,smbpassword=smbserver_771 <target>

Knowledge Center:

A "null session" in SMB networking is an unauthenticated connection allowing access to resources without credentials. Historically for tasks like resource enumeration, it's now a security risk, potentially granting unauthorized entry to sensitive data and system resources if not managed properly.

SMB: SMBMap


  • This command uses "smbmap" to list accessible shares on the specified target using a null session (guest access) without a password and specifying a comma as a delimiter for domain enumeration.

smbmap -u guest -p"" -d, -H <target>
  • This command uses "smbmap" to enumerate shares on the indicated target, employing the "administrator" username and "smbserver_771" password for authentication, while using a comma as a domain delimiter.

smbmap -u administrator -p"smbserver_771" -d, -H <target>
  • This command employs "smbmap" to execute the 'ipconfig' command on the specified target using the "administrator" username and "smbserver_771" password for authentication, aiming to gather network configuration information.

smbmap -H <target> -u administrator -p"smbserver_771" -x 'ipconfig’
  • This command utilizes "smbmap" to list shares on the provided target, authenticating as "administrator" with the password "smbserver_771" and displaying share information.

smbmap -H <target> -u administrator -p"smbserver_771" -L
  • This command employs "smbmap" to access the 'C$' administrative share on the specified target, using "administrator" as the username and "smbserver_771" as the password for authentication.

smbmap -H <target> -u administrator -p"smbserver_771" -r 'C$’
  • This command uses "smbmap" to upload the 'backdoor' file from '/root' to the 'C$\backdoor' directory on the specified target, authenticating as "administrator" with the password "smbserver_771".

smbmap -H <target> -u administrator -p"smbserver_771" --upload '/root/backdoor' 'C$\backdoor’
  • This command employs "smbmap" to download the 'flag.txt' file from the 'C$' share on the given target, using "administrator" as the username and "smbserver_771" as the password for authentication.

smbmap -H <target> -u administrator -p"smbserver_771" --download 'C$\flag.txt’

SMB: Samba

Samba is an open-source software suite that provides seamless file and print services to SMB/CIFS clients, enabling interoperability between Unix/Linux servers and Windows-based clients. It allows Unix/Linux systems to share files, printers, and other services with Windows systems, facilitating cross-platform network communication and resource sharing. we will explore SMB on Linux systems, also known as Samba (utilizing Port No. 139 & 445). Through the utilization of various tools and scripts, we will conduct Samba discovery and enumeration on Linux systems. The tools and scripts used are outlined below.

RPC-Client tool for Samba Enumeration

RPC (Remote Procedure Call) is a protocol that lets programs on different computers communicate and request services from each other over a network. It allows remote execution of functions and procedures as if they were local. The most common port for RPC is 135, and additional ports are dynamically allocated for specific services.

  • This command is used to connect to the specified target's RPC services without providing a username or password, using anonymous authentication.

rpcclient -U "" -N <target>
  • This command is used to retrieve basic information about the remote server's operating system and version using the RPC protocol.

rpcclient $> srvinfo
  • This command is used to list user accounts from the domain using the RPC protocol.

rpcclient $> enumdomusers
  • This command is used to retrieve information about a specific user's SID (Security Identifier) and related attributes using the RPC protocol.

rpcclient $> lookupnames <user_name>
  • This command is used to enumerate domain groups on a remote system using the RPC protocol.

rcpcliet $> enumdomgroups

Enum4linux tool for Samba Enumeration


  • This command is used to perform a comprehensive enumeration of information from the specified target's SMB services, revealing details about users, shares, and more.

enum4linux -o <target>
  • This command is used to enumerate user and group information from the specified target in a Windows network using SMB and NetBIOS.

enum4linux -U <target>
  • This command is used to perform a complete enumeration of information from the specified target using the SMB protocol, focusing on gathering user and group information.

enum4linux -S <target>
  • This command is used to enumerate group memberships from the specified target using the SMB protocol.

enum4linux -G <target>
  • This command is used to retrieve information about the specified target's users, shares, and other details using the SMB protocol.

enum4linux -i <target>

Smbclient tool for Samba Enumeration

  • This command is used to list available shares on the specified target without providing a password, using anonymous authentication.

smbclient -L <target> -N
  • This command is used to access the "Public" share on the specified target without providing a password, using anonymous authentication.

smbclient //<target>/Public -N
  • These commands are used within an interactive SMB session (smbclient) for: displaying help, listing files and directories, changing directories, and retrieving files:

smb: \> help
smb: \> ls
smb: \> cd
smb: \> get

Msfconsole tool for Samba Enumeration

  • auxiliary/scanner/smb/smb_version: is used to select the SMB version scanner module for identifying SMB protocol versions on a target network.

  • auxiliary/scanner/smb/smb2: is used to perform SMB version 2 scanning for vulnerabilities and information gathering.

  • auxiliary/scanner/smb/smb_enumshares: it is use to perform SMB share enumeration for network analysis.

Nmblookup tool for Samba Enumeration

nmblookup -A <target>
  • This command is used to perform a NetBIOS lookup for the specified target, providing information about its NetBIOS name and associated IP address.

SMB: SMB Dictionary Attack

SMB Dictionary Attack is a method used to guess credentials for SMB (Server Message Block) services by systematically trying a list of usernames and passwords. Attackers use tools to automate the process of attempting different username-password combinations to gain unauthorized access to shared resources or administrative functions on a target system.

  • In msfconsole, you can use the smb_login auxiliary module to test SMB credentials and attempt to log in to target systems.

use auxiliary/scanner/smb/smb_login 
  • The following command uses Hydra to perform a brute-force attack on the SMB service of the target using the username "admin" and the rockyou.txt wordlist for password guessing.

hydra -l admin -P /usr/share/wordlists/rockyou.txt <target> smb

In msfconsole, the pipe_auditor auxiliary module is employed to perform SMB named pipe security assessments on a target network.

use auxiliary/scanner/smb/pipe_auditor

In SMB, pipes are virtual communication channels between computers. They allow programs on different machines to exchange messages and share information. Think of them as "secret tunnels" for sending data and commands across the network, enabling computers to work together and share resources like files or instructions.




Hacker's Mantra:If security were all that mattered, computers would never be turned on, let alone hooked into a network with literally millions of potential intruders. - Dan Farmer

PreviousEnumerationNextFTP Enumeration

Last updated 10 months ago

Was this helpful?

smb-protocols: Attempts to list the supported protocols and dialects of a SMB server. -

smb-security-mode: Returns information about the SMB security level determined by SMB. -

smb-enum-sessions: Enumerates the users logged into a system either locally or through an SMB share. -

smb-enum-shares: Attempts to list shares using the srvsvc.NetShareEnumAll MSRPC function and retrieve more information about them using srvsvc.NetShareGetInfo. If access to those functions is denied, a list of common share names are checked. -

smb-enum-users: Attempts to enumerate the users on a remote Windows system, with as much information as possible, through two different techniques (both over MSRPC, which uses port 445 or 139; see smb.lua). The goal of this script is to discover all user accounts that exist on a remote system. This can be helpful for administration, by seeing who has an account on a server, or for penetration testing or network footprinting, by determining which accounts exist on a system. -

smb-server-stats: Attempts to grab the server's statistics over SMB and MSRPC, which uses TCP ports 445 or 139. -

smb-enum-domains: Attempts to enumerate domains on a system, along with their policies. -

smb-enum-groups: Obtains a list of groups from the remote Windows system, as well as a list of the group's users. -

smb-enum-services: Retrieves the list of services running on a remote Windows system. Each service attribute contains service name, display name and service status of each service. -

is a tool designed to enumerate shared resources on a network through the SMB (Server Message Block) protocol. It allows penetration testers to identify accessible shares, enumerate permissions, and read or write files on shared directories, aiding in the discovery of potential security issues in SMB implementations.

: is a command to interact with Windows RPC (Remote Procedure Call) services for various administrative tasks and network information gathering.

is a Linux tool for gathering information from Windows systems via the SMB protocol. It extracts details such as user accounts, group memberships, shared resources, and more from the target, which aids in network reconnaissance and vulnerability assessment during penetration testing.

is a command-line tool for accessing and interacting with shared resources on SMB/CIFS servers. It allows users to list, download, upload, and manage files on remote Windows or Samba shares, providing a way to perform basic file operations and explore shared directories over the network.

is the main command-line interface for the Metasploit Framework, a comprehensive penetration testing tool. It allows users to launch exploits, manage payloads, run auxiliary modules, and conduct various security assessments, offering a powerful environment for discovering and exploiting vulnerabilities in target systems.

is a command-line tool used to perform NetBIOS name lookups over the SMB protocol. It helps identify the IP address associated with a NetBIOS name, which can be useful for network reconnaissance and discovering machines in a local network environment.

📚
📑
💡
🕵️
📜
Nmap Doc Page.
Nmap Doc Page.
Nmap Doc Page.
Nmap Doc Page.
Nmap Doc Page.
Nmap Doc Page.
Nmap Doc Page.
Nmap Doc Page.
Nmap Doc Page.
Smbmap
Rpcclient
enum4linux
Smbclient
Msfconsole
nmblookup