← All Threat Hunting ReportsThreat Hunting Exercise

Threat Hunting Exercise: Analyzing Linux SSH Port-Knocking Covert C2 Channel Dataset

This hunt uses a simulated Linux firewall/network dataset (linux_port_knock_2022-08-22T220000.json) capturing T1205.001: Traffic Signaling - Port Knocking, where an attacker configures a sequence-triggered firewall rule (via knockd or a custom iptables/nftables watcher) so that SSH access to a backdoor is only opened after a specific sequence of connection attempts to closed ports - keeping the backdoor invisible to routine port scans.

Step 1: Hypothesis Formation

Hypothesis: A host receives a rapid, sequential series of connection attempts to several closed/filtered ports from a single external source, immediately followed by that same source successfully establishing an SSH connection on a port that a prior scan showed as closed - indicating a port-knock sequence has opened access rather than a normally-listening service. Indicators:

Null Hypothesis: The sequential connection attempts are incidental background internet scanning noise (mass-scanning services routinely probe many ports), coincidentally followed by an unrelated legitimate SSH login. Invalidate by confirming the exact port sequence repeats consistently across multiple occurrences and matches a configured knockd rule on the host, rather than random scanner port ordering.

Rationale: Port knocking is specifically designed to keep a backdoor's listening port invisible to standard port scans and firewall audits, since the port only opens transiently after the correct sequence; this hunt validates sequential-connection-pattern detection as a control that doesn't depend on the backdoor port being open (and thus scannable) at audit time.

Step 2: Data Sources and Scope

Step 3: Key Findings

Parsed events (5 shown) confirm a repeating nightly port-knock sequence from a single external IP that reliably preceded successful SSH access to a port otherwise shown as closed in routine scans.

Timestamp (UTC)HostEventDetailIOC/Why Suspicious?
2022-08-22 22:00:01lnx-edge-node02Firewall LOG (DROP)SYN to port 7000 from 91.219.237.66Sequence-Start IOC: first hit of a fixed, repeating port sequence - port 7000 has no listening service and normally logs as a routine drop.
2022-08-22 22:00:03lnx-edge-node02Firewall LOG (DROP)SYN to port 8500 from 91.219.237.66Second sequential hit within 2 seconds - consistent tight timing across occurrences rules out random scanner ordering.
2022-08-22 22:00:05lnx-edge-node02Firewall LOG (DROP)SYN to port 9091 from 91.219.237.66Third and final knock in the sequence; identical three-port pattern (7000→8500→9091) observed on 6 prior nights at the same approximate time.
2022-08-22 22:00:08lnx-edge-node02Firewall LOG (ALLOW) + SSH authConnection to port 22 from 91.219.237.66, immediately accepted; auth log shows successful key-based login as root on first attemptBackdoor-Trigger IOC: SSH access succeeds immediately following the exact knock sequence, on a port a scan taken 10 minutes earlier showed as filtered/closed.
-lnx-edge-node02(process check)knockd running, config file /etc/knockd.conf defines sequence 7000:tcp,8500:tcp,9091:tcp opening port 22 for 10 secondsConfirms a deliberately configured port-knocking backdoor mechanism, not coincidental scanning followed by unrelated legitimate access.

Validation:

Step 4: Recommendations & Next Steps

Hypothesis confirmed - an attacker configured a port-knocking backdoor that opened root SSH access for 10 seconds following a specific three-port sequence, evading detection by routine port scans for at least 7 consecutive nights!