Commonly Used Port
Adversaries may communicate over a commonly used port to bypass firewalls or network detection systems and to blend with normal network activity to avoid more detailed inspection. They may use commonly open ports such as TCP:80 (HTTP), TCP:443 (HTTPS), TCP:25 (SMTP), and TCP/UDP:53 (DNS). They may use the protocol associated with the port, or a completely different protocol to evade inspection. For connections within an enclave, common ports include TCP/UDP:135 (RPC), TCP/UDP:22 (SSH), and TCP/UDP:3389 (RDP). This technique has been deprecated in favor of T1571 (Non-Standard Port) and T1071 (Application Layer Protocol), but the detection pattern remains relevant: identifying unexpected processes communicating over well-known ports that do not match their expected traffic profile.
// Detect unusual processes communicating over commonly used ports
// Focus: non-browser/non-service processes using HTTP/HTTPS/DNS/SMTP/RDP/SSH/RPC
let CommonPorts = dynamic([80, 443, 53, 25, 22, 3389, 135]);
let LegitimateHTTPProcesses = dynamic([
"chrome.exe", "firefox.exe", "msedge.exe", "iexplore.exe", "safari",
"svchost.exe", "MicrosoftEdge.exe", "OneDrive.exe", "Teams.exe",
"outlook.exe", "winlogon.exe", "lsass.exe", "services.exe",
"MsMpEng.exe", "wuauclt.exe", "WindowsUpdate", "TiWorker.exe",
"msiexec.exe", "wermgr.exe", "SearchIndexer.exe"
]);
DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemotePort in (CommonPorts)
| where ActionType == "ConnectionSuccess"
// Exclude obviously legitimate processes
| where InitiatingProcessFileName !in~ (LegitimateHTTPProcesses)
// Exclude internal RFC1918 destinations for some ports (keep RDP/SSH lateral movement)
| extend IsInternal = (RemoteIPType == "Private")
// Flag suspicious process categories
| extend IsScriptInterpreter = InitiatingProcessFileName in~ (
"powershell.exe", "pwsh.exe", "cmd.exe", "wscript.exe",
"cscript.exe", "mshta.exe", "wmic.exe"
)
| extend IsLOLBin = InitiatingProcessFileName in~ (
"rundll32.exe", "regsvr32.exe", "certutil.exe", "bitsadmin.exe",
"msbuild.exe", "csc.exe", "installutil.exe", "regasm.exe",
"regsvcs.exe", "ieexec.exe", "msiexec.exe", "expand.exe",
"extrac32.exe", "makecab.exe", "pcalua.exe", "replace.exe",
"hh.exe", "infdefaultinstall.exe", "xwizard.exe"
)
| extend IsUnusualSystem = InitiatingProcessFileName in~ (
"notepad.exe", "calc.exe", "mspaint.exe", "wordpad.exe",
"write.exe", "winver.exe", "charmap.exe", "snippingtool.exe"
)
| where IsScriptInterpreter or IsLOLBin or IsUnusualSystem
| project
Timestamp,
DeviceName,
AccountName,
InitiatingProcessFileName,
InitiatingProcessCommandLine,
InitiatingProcessParentFileName,
RemoteIP,
RemotePort,
RemoteIPType,
IsInternal,
IsScriptInterpreter,
IsLOLBin,
IsUnusualSystem
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Scripting engines (PowerShell, cscript) used by legitimate IT automation tools to call REST APIs over HTTPS (port 443) — common with Ansible, Chef, Puppet, SCCM
- certutil.exe and bitsadmin.exe used by Windows Update or software distribution systems to fetch payloads over HTTP/HTTPS
- msiexec.exe downloading MSI packages from internal or cloud distribution points over port 80/443
- IT monitoring agents (SolarWinds, Datadog, Zabbix) using script-based checks that make HTTP requests
- Developer workstations where build tools (msbuild.exe, csc.exe) reach out to NuGet package feeds over HTTPS
References (9)
- https://attack.mitre.org/techniques/T1043/
- https://attack.mitre.org/techniques/T1571/
- https://attack.mitre.org/techniques/T1071/
- https://arxiv.org/ftp/arxiv/papers/1408/1408.1136.pdf
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1043/T1043.md
- https://www.sans.org/reading-room/whitepapers/detection/detecting-dns-tunneling-34152
- https://lolbas-project.github.io/
- https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon
Unlock Pro Content
Get the full detection package for T1043 including response playbook, investigation guide, and atomic red team tests.