CyberSecC@ptBlackb3ard
  • 🦜Welcome
  • Cyber Security
    • Offensive Security
      • Penetration Testing Methodology
      • Pre-Engagement Interaction
      • Reconnaissance (Information Gathering)
        • Open-Source Intelligence (OSINT)
      • Scanning and Enumeration
        • Domain Enumeration
        • Network Enumeration
          • Network Mapper (nmap)
          • Port/Protocol & Service Enumeration & Attack
            • File Transfer Protocol (FTP): 20, 21
              • Trivial File Transfer Protocol (TFTP): 69
              • FTP over SSL/TLS (FTPS): 989, 990
            • Secure Shell (SSH): 22
            • Telnet: 23
            • Simple Mail Transfer Protocol (SMTP): 25
              • SMTP Secure (SMTPS): 587
            • Domain Name System (DNS):53
            • Dynamic Host Configuration Protocol (DHCP): 67, 68
            • Hyper Text Transfer Protocol (HTTP): 80
              • HTTP over SSL/TLS (HTTPS): 443
            • Kerberos: 88
            • Post Office Protocol version 3 (POP3): 110
            • Network Time Protocol (NTP): 123
            • Remote Procedure Call (RPC): 135
            • NetBIOS: 137, 138, 139
            • Internet Message Access Protocol (IMAP): 143
            • IMAP over SSL/TLS: 933
            • Internet Relay Chat (IRC): 194
            • Light Weight Directory Access Protocol (LDAP): 389
              • LDAP over SSL/TLS (LDAPS): 636
            • Server Message Block (SMB): 445
              • Hostname
              • Shared Folders
            • Network File System (NFS): 2049
            • Microsoft SQL Server: 1433
            • MySQL Server: 3306
            • PostgreSQL Server: 5432
            • Remote Desktop Protocol (RDP): 3389
            • Border Gateway Protocol (BGP): 179
            • Remote Authentication Dial-In User Service (RADIUS): 1812, 1813
        • Web Enumeration
      • Security Assessment Report Writing
      • Tools
        • Cryptography & Encoding
          • Password Recovery
        • Network Tools
  • Networking
    • OSI and TCP/IP Model
      • Common Network Ports & Protocols
  • Cloud
    • Cloud Computing
  • General
    • Cyber Security Theory
      • Information Security
      • Cybersecurity Resilience
      • Cybersecurity Posture
    • Terms and Acronyms
    • Database Cheat Sheets
Powered by GitBook
On this page
  • Summary
  • Why Should SMB Be Enumerated?
  • General Enumeration Steps/Checklist
  • Information Gathered via SMB Enumeration
  • SMB Enumeration
  • Windows Environment-Related Information
  1. Cyber Security
  2. Offensive Security
  3. Scanning and Enumeration
  4. Network Enumeration
  5. Port/Protocol & Service Enumeration & Attack

Server Message Block (SMB): 445

Summary

  • Ports: 139 (TCP) and 445 (TCP)

Security Weaknesses

  • Exploitation of SMBv1 vulnerabilities (e.g., EternalBlue).

  • Unauthorized access to shared files and resources.

  • Lack of encryption in older versions of SMB.

Security Defense and Mitigation Measures

  • Disable SMBv1 and enforce SMBv2 or SMBv3.

  • Use network segmentation to limit SMB access.

  • Regularly patch SMB services and enforce access controls.

Indicators of Compromise or Attack

  • Unauthorized access to file shares.

  • Unusual SMB traffic from unexpected endpoints.

  • High volumes of failed login attempts.

Why Should SMB Be Enumerated?

  • SMB (Server Message Block) should be enumerated and assessed for vulnerabilities because it is a widely used protocol in Windows environments, facilitating file sharing, authentication, and remote administration. Due to its prevalence, SMB is a high-value target for attackers and has a history of severe vulnerabilities like EternalBlue (MS17-010), which led to widespread ransomware attacks such as WannaCry.

  • By enumerating SMB, attackers and penetration testers can uncover critical information, such as shared folders, usernames, groups, service versions, and file permissions. This data may reveal sensitive information, weak configurations, or unpatched systems, all of which can be exploited for remote code execution, lateral movement, privilege escalation, or data theft.

  • SMB is also vulnerable to credential theft and relay attacks if SMB signing is disabled, allowing attackers to capture NTLM hashes for further exploitation. Misconfigured shares with overly permissive access can expose sensitive files and enable attackers to gain unauthorized access to critical resources.

  • Assessing SMB for vulnerabilities is crucial to protecting against ransomware, man-in-the-middle attacks, and unauthorized access. Regular patching, disabling SMBv1, enabling SMB signing, and limiting SMB access to trusted networks are essential mitigation strategies to reduce the risks posed by SMB vulnerabilities. Proper assessment helps organizations identify weak points in their network and prevent severe security breaches.

General Enumeration Steps/Checklist

#1 - Enumerate Hostname
$nmblookup -A [target_ip]

#2 - List Shared Folders 
$smbmap -H [ip/hostname]
$echo exit | smbclient -L \\\\[target_ip]
$nmap --script smb-enum-shares -p 139,445 [target_ip]

#3 - Check for Null Sessions
$smbmap -H [target_ip/hostname]
$rpcclient -U "" -N [target_ip]
$smbclient \\\\[target_ip]\\[share name]

#4 - List Users
$enum4linux -a <Target-IP>	

#5 - Vulnerability Scanning
$nmap --script smb-vuln* -p 139,445 [ip]

#6 - Overall Scanning
#Enum4Linux - can detect and fetch data from both Windows and Linux
$enum4linux -U <target IP>

#Scan a network searching for hosts
$nbtscan -r <CIDR Range>

Information Gathered via SMB Enumeration

SMB Enumeration

Summary

Detailed Enumeration

Windows Environment-Related Information

Workgroup VS Domain

  • Workgroup: It is a peer-to-peer network for a maximum of 10 computers in the same LAN or subnet. It has no Centralized Administration, meaning no computer controls another computer. Each user controls the resources and security locally on their system.

  • Domain: It is a client/server network for up to 2000 computers anywhere in the world. The administrator manages the domain and its users and resources. A user with an account on the domain can log onto any computer system without having the account on that computer.

PreviousLDAP over SSL/TLS (LDAPS): 636NextHostname

Last updated 5 months ago

Hostname
Shared Folders