Port scanning from one source.
What gives it awayOne SRC against a sequence of DPT values in a short window.
ATT&CK T1046Nothing matches that yet. Tell us what you were looking for and it goes on the list.
iptables / netfilter · Event IN= OUT=
The Linux kernel firewall matched a packet against a rule with logging enabled and wrote the packet header to the kernel log. The format is dense and unpunctuated, but every field is a key-value pair and it reads easily once you know the order.
Also written as iptables deniedIN= OUT= SRC= DST=kernel iptables drop lognetfilter drop log
Your Linux machine's firewall blocked a connection and wrote down the details. On anything reachable from the internet this happens continuously and is the firewall working correctly.
The LOG target only writes the entry; it does not drop anything, so a matching DROP or REJECT rule must follow it. The IN and OUT fields together give you direction: IN populated with OUT empty means inbound to this host, and both populated means forwarded. Outbound and forwarded drops deserve far more attention than inbound ones.
Sanitised. Addresses come from the RFC 5737 documentation ranges.
Aug 28 09:41:17 gw-01 kernel: [1234567.890123] IPT-DROP-IN: IN=eth0 OUT= MAC=00:00:5e:00:53:01:00:00:5e:00:53:02:08:00 SRC=198.51.100.77 DST=192.0.2.15 LEN=60 TOS=0x00 PREC=0x00 TTL=54 ID=41928 DF PROTO=TCP SPT=49820 DPT=3389 WINDOW=29200 RES=0x00 SYN URGP=0 Everything else in the log line is context.
Both IN and OUT populatedA forwarded packet — this host is routing. IN populated, OUT emptyInbound to this machine. The most common case. IN empty, OUT populatedGenerated locally and leaving. Outbound drops are the interesting ones. 22SSH. Continuously scanned on any public address. 3389Remote Desktop, unusual on a Linux host and worth noting. 445SMB. Should never be reachable from the internet. A high random portOften the return leg of an outbound connection that the state table lost. Most of the time it is one of these.
What gives it awayOne SRC against a sequence of DPT values in a short window.
ATT&CK T1046What gives it awayOne DPT across many DST addresses.
ATT&CK T1018What gives it awayDrops where IN is empty and OUT is populated. Outbound drops from your own machine are the ones worth chasing.
ATT&CK T1071What gives it awayForwarded drops on administrative ports crossing between network segments.
ATT&CK T1021grep 'IN=' /var/log/kern.log | grep -oP 'SRC=\K[\d.]+' | sort | uniq -c | sort -rn | head -20 grep 'IN=' /var/log/kern.log | grep -oP 'DPT=\K\d+' | sort -n | uniq -c | sort -rn | head -20 journalctl -k --since '1 hour ago' | grep 'IN=' | grep -oP 'SRC=\K[\d.]+' | sort | uniq -c | awk '$1 > 50' grep -P 'IN=\s' /var/log/kern.log | grep -oP 'DST=\K[\d.]+' | sort | uniq -c | sort -rn event.dataset:"iptables" and iptables.output_device:* | stats count by destination.ip, destination.port Every field is a key-value pair in a fixed order. IN and OUT are the interfaces, SRC and DST the addresses, PROTO the protocol, and SPT and DPT the source and destination ports. The bare words near the end — SYN, ACK, RST — are TCP flags. Read IN and OUT first, because together they tell you the direction, which determines what the rest means.
To the kernel log, which means /var/log/kern.log on Debian and Ubuntu, /var/log/messages on many Red Hat derivatives, and `journalctl -k` on any systemd host. The exact destination depends on your syslog configuration, and it is common to route them to a dedicated file with an rsyslog rule to keep them out of the general kernel log.
Because LOG is a non-terminating target — it writes the entry and lets the packet continue through the chain. You need a DROP or REJECT rule after it. A LOG rule with nothing following it produces log entries for traffic that is then happily accepted, which is a common and confusing misconfiguration.
Use --log-prefix on each LOG rule to tag its output, for example `-j LOG --log-prefix "IPT-DROP-IN: "`. Without a prefix, every rule's output looks identical and there is no way to work out which one matched.
Last reviewed 28 August 2026