Techniques › T1205 › T1205.001
T1205.001 Port Knocking
stealth · persistence · command and control — Linux, macOS, Network Devices, Windows · attack.mitre.org · JSON
1
MITRE detection strategy
4
analytics
0
Sigma rules tagged attack.t1205.001
0
KEV CVEs mapped here
<p>Adversaries may use port knocking to hide open ports used for persistence or command and control. To enable a port, an adversary sends a series of attempted connections to a predefined sequence of closed ports. After the sequence is completed, opening a port is often accomplished by the host based firewall, but could also be implemented by custom software.</p><p>This technique has been observed both for the dynamic opening of a listening port as well as the initiating of a connection to a listening server on a different system.</p><p>The observation of the signal packets to trigger the communication can be conducted through different methods. One means, originally implemented by Cd00r, is to use the libpcap libraries to sniff for the packets in question. Another method leverages raw sockets, which enables the malware to use ports that are already open for use by other programs.</p>
KEV CVEs mapped to this technique · CTID Mappings Explorer
None. No KEV entry in the public mapping names this technique. Given that 74.7% of KEV has no mapping at all, this says more about the mapping than about the technique.
Detection strategy · ATT&CK Enterprise v19.2
- DET0302 Port-knock → rule/daemon change → first successful connect (T1205.001) v1.0
AN0842 WindowsA remote source rapidly touches a short sequence of closed ports (SYN→RST/S0) on a Windows host. Within a short window the host changes firewall state (WFP rule added/modified or service starts listening) and then the same source completes the first successful handshake to the newly opened port.WinEventLog:Microsoft-Windows-Windows Firewall With Advanced Security/Firewall
EventCode=2004, 2005, 2006→ DC0078 Network Traffic FlowTunable:TimeWindowMinSequenceLenRuleChangeAllowListWatchedPortsAN0843 LinuxA source performs a short closed-port sequence; the host then modifies iptables/nftables/ufw rules or starts a daemon binding a new socket, followed by a successful connection from the same source.auditd:SYSCALLexecve: Commands that alter firewall or start listeners: iptables|nft|ufw|firewall-cmd|pfctl|systemctl start sshd/telnet/dropbear; raw-socket/libpcap tools (tcpdump, tshark, nmap --raw).→ DC0032 Process Creationauditd:SYSCALLsocket/bind: New bind() to a previously closed port shortly after the sequence.→ DC0082 Network Connection CreationNSM:FlowKnock pattern: repeated REJ/S0 across ≥MinSequenceLen ports from same src_ip then SF success.→ DC0078 Network Traffic FlowTunable:ServicePortKnockToleranceMgmtAllowListAN0844 macOSA source performs a closed-port sequence; the endpoint enables a PF/socketfilterfw rule or a background process binds a port; then a successful connection completes from the same source.macos:unifiedlogexec: Execution of pfctl, socketfilterfw, launchctl start ssh/telnet, libpcap consumers.→ DC0032 Process CreationNSM:FlowSequence of REJ/S0 then SF success from same src_ip within TimeWindow.→ DC0082 Network Connection CreationTunable:PFAnchorPathsDevModeAN0845 Network DevicesRouter/switch receives a knock pattern (same src touches device unicast, broadcast, and network-address on same or stepped ports) followed by ACL/line-vty/service enable and the first mgmt session success.networkdevice:syslogConfig/ACL changes, line vty transport input changes, telnet/ssh/http(s) enable, image/feature module changes.→ DC0078 Network Traffic FlowNSM:FlowSeries of denied/closed flows to distinct ports then success to mgmt port from same src_ip within TimeWindow.→ DC0082 Network Connection CreationTunable:MgmtPortSetDeviceRole
Sigma rules · SigmaHQ da9bb07d64, tag attack.t1205.001
No Sigma rule carries this tag. MITRE publishes a detection strategy above, so the behaviour is specified; what is missing is public detection content.