FLOW-DSCAN(1)
π FLOW-DSCAN β the tea on spotting sus network behaviour π
okay bestie, gather round, because flow-dscan(1) is genuinely iconic and you're gonna be obsessed. this is the page for flow-dscan, and it's giving detect scanning and other suspicious network activity. periodt. π₯
β¨ SYNOPSIS β¨
flow-dscan [ -bBhlmpwW ] [ -d debug_level ] [ -D iplist_depth ] [ -s
state_file ] [ -i input_filter ] [ -L suppress_list ] [ -o
output_filter ] [ -O excessive_octets ] [ -P excessive_flows ] [ -S
port_scan_trigger ] [ -t ager_timeout ]
like look at her. so many little flags. she's a whole vibe. π¦
πΈ DESCRIPTION πΈ
so flow-dscan is the utility you use to sniff out suspicious activity β think port scanning, host scanning, and flows that are just doing the most with unusually high octets or packets. π
there's a source and destination suppress list too, which exists so you don't get false alarms from the popular kids β hosts like nameservers or busy web servers that literally talk to a zillion other hosts all day. no cap, without the suppress list you'd be drowning in alerts about them.
alarms get logged to syslog or stderr. and the internal state of flow-dscan can be saved and loaded, so if your operation gets interrupted you can just pick it back up. the way that works?? chef's kiss. π
pro tip from the manpage itself: flow-dscan will work best if you configure it to watch only inbound or only outbound traffic, using the input or output interface filter option. do that. she thrives that way. β¨
here's how the scanners actually work, and this part is important so don't skip it:
- the host scanner counts the length of the destination IP hash chain. if it goes above 64, then the src is considered to be scanning. π
- the port scanner keeps a bitmap of the destination port number < 1024 per destination IP. if it goes above 64, the src is considered to be port scanning the destination.
- once a src has been flagged as scanning, it will not be reported again until the record is aged out and enough flows trigger it again. she's not gonna spam you about the same host, she has boundaries. π«Ά
and the signals, because signals are the moment:
- a
SIGHUPsignal will instructflow-dscanto reload the suppress list. - a
SIGUSR1signal will instructflow-dscanto dump its internal state.
π OPTIONS π
okay this is the part everyone scrolls to. every single one, no skipping, bestie. π
-bβ do not detach and run in the background. alerts go tostderr.-Bβ do not detach and run in the background. alerts go tosyslog.-ddebug_level β enable debugging.-Diplist_depth β depth of IP host list for detecting host scanning.-hβ display help.-iinput_filter β input interface filter list.-Ioutput_filter β output interface filter list.-lβ load state from/var/tmp/dscan.stateor the filename specified with-s.-Lsuppress_list β basename of suppress files. there are two suppress files, one for input and one for output traffic. the suppress file syntax is:
IP_address protocol source_port destination_port
a - can be used as a wildcard in the protocol, source_port, and destination_port fields. only a single protocol, source_port, and destination_port is supported per IP address. (yes really, one. she's simple like that. π)
-mβ multicast address filter. use to ignore multicast addresses.-Oexcessive_octets β trigger an alert if a flow is processed with the octets field exceeding excessive_octets.-pβ dump state to/var/tmp/dscan.stateor the filename specified with-s.-Pexcessive_packets β trigger an alert if a flow is processed with the packets field exceeding excessive_packets.-sstatefile β state filename. defaults to/var/tmp/dscan.state-Sport_scan_trigger β number of ports a IP address must have used to be considered scanning.-tager_timeout β how long to keep flows around. default to90000. this is measured in flows processed. π-Texcessive_time β trigger an alert if a flow is processed with the End-Start field exceeding excessive_time.-wβ filter (ignore) candidate inbound www traffic, ie IP protocol6, source port80, and destination port> 1023.-Wβ filter (ignore) candidate outbound www traffic, ie IP protocol6, destination port80, and source port> 1023.
π EXAMPLES π
imagine a topology where 25 is the only output interface. run flow-dscan over the data in /flows/krc4. ignore www and multicast traffic, store the internal state in dscan.statefile on exit. use empty suppress list files dscan.suppress.src and dscan.suppress.dst.
heads up fr fr: the output produced byflow-dscantypically must be manually inspected by usingflow-filterandflow-print. and many of the alerts will be false until the suppress lists are populated for the local environment. that's not a bug, that's just the vibe of a fresh setup. π
flow-cat /flows/krc4 | flow-dscan -I25 -b -m -s dscan.statefile -p -W
π BUGS π
okay so this is the part where we're honest. the ager should automatically become more aggressive when a low memory condition exists. there is no upper limit on the number of records that can be allocated. if the ager is not running often enough the host will be run out of memory.
so like... watch your memory, bestie. she will eat it. no cap. π
π AUTHOR π
Mark Fullmer <maf@splintered.net>
π¦ SEE ALSO π¦
and that's the whole page, bestie!! this one's from the FLOW-DSCAN(1) manual, dated 26 ΠΠ²Π³ΡΡΡ 2010. go forth and catch those scanners. slay. π
β¨π
π¦ where this page comes from
- fedora 43: flow-tools 0.68.5.1-45.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: flow-tools 0.68.5.1-45.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: flow-tools 0.68.5.1-46.fc44 Β· LicenseRef-Callaway-BSD
- fedora 44: flow-tools 0.68.5.1-46.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms