SlideShare a Scribd company logo
http://bit.ly/1QkyU2e
FastNetMon
Open source DDoS mitigation toolkit
Pavel Odintsov
odintsov@fastvps.ee
http://bit.ly/1QkyU2e
0
10
20
30
40
2014-12 2015-01 2015-02 2015-03 2015-04 2015-05 2015-06
Number of DDoS attacks per
month for VPS hosting provider
2
http://bit.ly/1QkyU2e
DDoS attack directions
Outgoing
31 %
Incoming
69 %
3
http://bit.ly/1QkyU2e
Incoming DDoS attacks protocols
udp
71 %
tcp
29 %
4
http://bit.ly/1QkyU2e
Outgoing DDoS attacks protocols
udp
41 %
tcp
59 %
5
http://bit.ly/1QkyU2e
Is it dangerous — bandwidth?
6
http://bit.ly/1QkyU2e
Is it dangerous — pps?
7
http://bit.ly/1QkyU2e
Any solutions?
8
Hardware solutions Cloud solutions
http://bit.ly/1QkyU2e
What wrong with they?
9
http://bit.ly/1QkyU2e
What wrong with current DDoS
equipment?
• Too expensive!
• Need dedicated qualified network engineers
• Need significant changes in network architecture
• Not fully automated!
• Useless in case of channel overflow
10
http://bit.ly/1QkyU2e
What wrong with DDoS
services?
• Increased latency
• Significant reaction time (BGP propagation time)
• Still need tool for trigger traffic diversion/redirection
• No outgoing attack mitigation
• Security reasons
• Single point of failure (SPoF)
• Very costly for «always on» mode
• Service could be broken by attack to another client
11
http://bit.ly/1QkyU2e
Silver bullet - FASTNETMON!
FastNetMon
http://bit.ly/1QkyU2e
12
http://bit.ly/1QkyU2e
What we could do?
• Save NOC’s sleep :)
• Detect any DoS/DDoS attack for channel overflow or
equipment overload
• Partially or completely block malicious traffic from/to own
host (target of attack)
• Save your network (routers, switches, servers)
• Save your SLA
13
http://bit.ly/1QkyU2e
FastNetMon supported packet
capture engines
• sFlow v4, v5 (sampled traffic collection from switches)
• NetFlow v5, v9, v10 (sampled traffic data from routers)
• IPFIX (sampled traffic data from routers)
• Span/mirror (routers/switches deep inspection mode)
14
http://bit.ly/1QkyU2e
Detection time for capture backends
15
Seconds
0
10
20
30
40
NetFlow sFLOW
Mirror
http://bit.ly/1QkyU2e
Officially supported distributions
16
• CentOS 6
• CentOS 7
• Ubuntu 12.04
• Ubuntu 14.04
• Debian 6
• Debian 7
• Debian 8
• VyOS 1.1.6
• FreeBSD 9, 10, 11 (we are in official ports)
http://bit.ly/1QkyU2e
How we could block attack?
• BGP announce (community 666, blackhole, selective blackhole)
• BGP flow spec/RFC 5575 (selective traffic blocking: GoBGP, ExaBGP)
• Custom script
• Custom web callback script
17
http://bit.ly/1QkyU2e
Supported vendors
• Cisco
• Juniper
• Extreme
• Huawei
• Linux (ipt_NETFLOW)
18
http://bit.ly/1QkyU2e
Mirror capture performance
19
%fromlinerate10GE
0
25
50
75
100
pcap
PF_RING
AF_PACKET
PF_RING ZC
Netmap
http://bit.ly/1QkyU2e
How to install on Linux?
20
wget https://raw.githubusercontent.com/FastVPSEestiOu/fastnetmon/master/src/
fastnetmon_install.pl -Ofastnetmon_install.pl
sudo perl fastnetmon_install.pl --use-git-master
If you want «stable» 1.1.2 version please skip --use-git-master
http://bit.ly/1QkyU2e
Configuration
21
Main configuration file stored in /etc/fastnetmon.conf
Main log file stored in /var/log/fastnetmon.log
CLI client tool /opt/fastnetmon/fastnetmon_client
http://bit.ly/1QkyU2e
Configure networks list
22
Enumerate your networks in file /etc/networks_list in CIDR form:
10.10.12.0/24
8.8.8.0/24
192.168.77.0/24
4.8.4.8/32
We could work well only with ~/16 networks.
http://bit.ly/1QkyU2e
DDoS notify script
23
notify_script_path = /usr/local/bin/notify_about_attack.sh
#!/bin/bash
email_notify="root,please_fix_this_email@domain.ru"
if [ "$4" = "unban" ]; then
# No details arrived to stdin here
# Unban actions if used
exit 0
fi
if [ "$4" = "ban" ]; then
cat | mail -s "FastNetMon Guard: IP $1 blocked because $2 attack with power $3 pps" $email_notify;
exit 0
fi
if [ "$4" == "attack_details" ]; then
cat | mail -s "FastNetMon Guard: IP $1 blocked because $2 attack with power $3 pps" $email_notify;
exit 0
fi
http://bit.ly/1QkyU2e
Attack detection configuration
# Enable ban actions
enable_ban = on
# Enable sFLOW plugin
sflow = on
# Enable NetFlow. Please set active and incative flow timeout to 30 seconds
netflow = on
# Calculate traffic speed over X seconds
average_calculation_time = 30
# How long host should stay locked
ban_time = 1800
# Action thresholds
ban_for_pps = on
threshold_pps = 100000
ban_for_bandwidth = on
threshold_mbps = 1000
24
http://bit.ly/1QkyU2e
Starting up!
25
systemctl start fastnetmon
service fastnetmon start
/opt/fastnetmon/fastnetmon --daemonize
http://bit.ly/1QkyU2e
Example attack report
IP: 10.10.10.221
Attack type: syn_flood
Initial attack power: 546475 packets per second
Peak attack power: 546475 packets per second
Attack direction: incoming
Attack protocol: tcp
Total incoming traffic: 245 mbps
Total outgoing traffic: 0 mbps
Total incoming pps: 99059 packets per second
Total outgoing pps: 0 packets per second
Total incoming flows: 98926 flows per second
Total outgoing flows: 0 flows per second
Average incoming traffic: 45 mbps
Average outgoing traffic: 0 mbps
Average incoming pps: 99059 packets per second
Average outgoing pps: 0 packets per second
Incoming ip fragmented traffic: 250 mbps
Outgoing ip fragmented traffic: 0 mbps
Incoming ip fragmented pps: 546475 packets per second
Outgoing ip fragmented pps: 0 packets per second
Incoming tcp traffic: 250 mbps
Outgoing tcp traffic: 0 mbps
Incoming tcp pps: 546475 packets per second
Outgoing tcp pps: 0 packets per second
Incoming syn tcp traffic: 250 mbps
Outgoing syn tcp traffic: 0 mbps
Incoming syn tcp pps: 546475 packets per second
Outgoing syn tcp pps: 0 packets per second
Incoming udp traffic: 0 mbps
Outgoing udp traffic: 0 mbps
Incoming udp pps: 0 packets per second
Outgoing udp pps: 0 packets per second
26
http://bit.ly/1QkyU2e
Core algorithms
• We count number of packets/bytes per protocol to/from /32
host with moving average
• We use moving average for average_calculation_time
seconds for all counters.
• We count total number of bytes/packets for each monitored
subnet
27
http://bit.ly/1QkyU2e
DPI
• 100% guarantee against false positive attack detection
• Supported only for mirror/SPAN because packet body required
• Used as second level for detection algorithm
• Very useful for networks
• Complete support for SNMP, DNS, NTP, SSDP amplification attacks
28
http://bit.ly/1QkyU2e
Attack visualization in Grafana
29
http://bit.ly/1QkyU2e
I need help!
• Mail list: https://groups.google.com/forum/#!forum/fastnetmon
• Bug tracker GitHub: http://bit.ly/1QkyU2e
• Twitter: https://twitter.com/odintsov_pavel
• IRC channel: #fastnetmon irc.freenode.net
• Author’s email: pavel.odintsov@gmail.com (last resort!)
30
http://bit.ly/1QkyU2e
Thank you for attention!
pavel.odintsov@gmail.com
http://bit.ly/1QkyU2e
Bonus slides!
http://bit.ly/1QkyU2e
Traffic capture subsystem
33
• sFLOW v4, v5
• NetFlow v5, v9, v10 (IPFIX)
• Port mirroring, SPAN, RSPAN
http://bit.ly/1QkyU2e
sFLOW
34
• FastNetMon: sflow = on
• Supported by almost any switch
• No aggregation (detailed per host and per port data)
• No flow lag (fast attack detection without lag)
• Enough accurate traffic bandwidth
• Be careful with sampling! 10GE - 1024-2048.
• Has packet header for analytics
• Could be filtered with LUA script (complex deployments with multiple
traffic paths)
http://bit.ly/1QkyU2e
Netflow
35
• FastNetMon: netflow = on
• Could be sampled (be careful with sampling rate or do not use it), configured
manually with netflow_sampling_ratio.
• Has significant (~30 seconds) flow lag (+lag time to attack detection time)
• Please setup flow active timeout and flow inactive timeout to smallest possible value!
• Could kill your control plane CPU (software implementation)
• Could overload service link for NetFlow data
• Not so accurate bandwidth data
• Please set average_calculation_time to max(flow_active, flow_inactive)
• Haven’t any packet header information
• Could be filtered with LUA script (MPLS, complex deployments)
http://bit.ly/1QkyU2e
Mirror traffic capture
36
• pcap
• PF_RING
• Netmap
• AF_PACKET
• SnabbSwitch
http://bit.ly/1QkyU2e
pcap
37
• FastNetMon: pcap = on
• Work everywhere
• Very slow, really it will die on 200-300 000 packets per second
http://bit.ly/1QkyU2e
Netmap
38
• FastNetMon: mirror_netmap = on
• Bundled support in FreeBSD kernel
• Open source Linux kernel module
• Line rate for 10GE on old hardware
• Need patched driver on Linux (only Intel supported)
• Really fast attack detection
• Has whole packet data (DPI could be used)
• Could be used on sampled mirror (netmap_sampling_ratio)
• Could be used on cropped mirror (Juniper: maximum-packet-length,
use option netmap_read_packet_length_from_ip_header)
• Could collect pcap attack fingerprint
http://bit.ly/1QkyU2e
PF_RING
39
• FastNetMon: mirror = on
• Only Linux
• Only Intel NIC + additional license for line rate capture
(enable_pf_ring_zc_mode)
• Need patched driver on Linux for line rate capture
• Really fast attack detection
• Has whole packet data (DPI could be used)
• Could be used on sampled mirror (pfring_sampling_ratio)
• Could collect pcap attack fingerprint
http://bit.ly/1QkyU2e
AF_PACKET
40
• mirror_afpacket = on
• Buggy before Linux 3.6
• Bundled in Linux kernel
• Could do 80% of line rate on 10GE (~9 Mpps)
• Work anywhere (PowerPC, ARM, …)
• Fast attack detection and no external dependencies
http://bit.ly/1QkyU2e
SnabbSwitch
41
• mirror_snabbswitch = on
• Lua powered 82599 NIC driver
• Very fast!
• Very flexible!
• Really fun!
• You should specify interfaces with PCI addresses:
interfaces_snabbswitch = 0000:04:00.0,0000:04:00.1

More Related Content

PPTX
FastNetMon Advanced DDoS detection tool
PDF
FastNetMon - ENOG9 speech about DDoS mitigation
PPTX
BGP Flowspec (RFC5575) Case study and Discussion
PDF
LinuxCon 2015 Linux Kernel Networking Walkthrough
PDF
Iptables fundamentals
PDF
GoBGP : yet another OSS BGPd
PDF
GTPing, How To
PDF
Using MikroTik routers for BGP transit and IX points
FastNetMon Advanced DDoS detection tool
FastNetMon - ENOG9 speech about DDoS mitigation
BGP Flowspec (RFC5575) Case study and Discussion
LinuxCon 2015 Linux Kernel Networking Walkthrough
Iptables fundamentals
GoBGP : yet another OSS BGPd
GTPing, How To
Using MikroTik routers for BGP transit and IX points

What's hot (20)

PPTX
Tutorial: Using GoBGP as an IXP connecting router
PDF
An Introduction to BGP Flow Spec
PDF
Faster packet processing in Linux: XDP
PDF
TRex Traffic Generator - Hanoch Haim
PDF
PPTX
IPv6 - Neighbour Discovery
PDF
BGP filter with mikrotik
PPTX
FD.io VPP事始め
ODP
nftables - the evolution of Linux Firewall
PPT
Juniper mpls best practice part 1
PDF
DevConf 2014 Kernel Networking Walkthrough
PDF
Ultra fast DDoS Detection with FastNetMon at Coloclue (AS 8283)
PDF
eBPF/XDP
PPT
PDF
SIP and DNS - federation, failover, load balancing and more
PDF
Cilium - Container Networking with BPF & XDP
PDF
DDoS Mitigation Tools and Techniques
PDF
Mss solution guide
PPTX
VXLAN Practice Guide
PPTX
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
Tutorial: Using GoBGP as an IXP connecting router
An Introduction to BGP Flow Spec
Faster packet processing in Linux: XDP
TRex Traffic Generator - Hanoch Haim
IPv6 - Neighbour Discovery
BGP filter with mikrotik
FD.io VPP事始め
nftables - the evolution of Linux Firewall
Juniper mpls best practice part 1
DevConf 2014 Kernel Networking Walkthrough
Ultra fast DDoS Detection with FastNetMon at Coloclue (AS 8283)
eBPF/XDP
SIP and DNS - federation, failover, load balancing and more
Cilium - Container Networking with BPF & XDP
DDoS Mitigation Tools and Techniques
Mss solution guide
VXLAN Practice Guide
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
Ad

Viewers also liked (20)

PDF
03 estrategia-ddos
PDF
Detecting and mitigating DDoS ZenDesk by Vicente De Luca
PDF
DDoS detection at small ISP by Wardner Maia
PDF
Distributed Denial of Service Attack - Detection And Mitigation
PDF
Blackholing from a_providers_perspektive_theo_voss
PDF
Jon Nield FastNetMon
PDF
Nanog66 vicente de luca fast netmon
PDF
Protect your edge BGP security made simple
PDF
Janog 39: speech about FastNetMon by Yutaka Ishizaki
PDF
Keeping your rack cool
PDF
Борьба с DDoS в хостинге - по обе стороны баррикад / Константин Новаковский (...
PDF
Open Source Logging and Metrics Tools
PDF
FastNetMonを試してみた
PDF
Utilize Process Improvement Methodologies to Improve Accounting by Tom Sonde ...
PPS
Creating Client Value
PDF
Gene synthesis technology and applications update—unleash your lab’s potentia...
PPTX
U.S. Immigrant Visa Interview Appointments Scheduled by NVC
PDF
SNS Gelous color real nail
PPTX
Implementation Experiences with SAP Ariba Solutions – Customer Panel
PDF
Soft skills pattern and syllabus, ducc systems
03 estrategia-ddos
Detecting and mitigating DDoS ZenDesk by Vicente De Luca
DDoS detection at small ISP by Wardner Maia
Distributed Denial of Service Attack - Detection And Mitigation
Blackholing from a_providers_perspektive_theo_voss
Jon Nield FastNetMon
Nanog66 vicente de luca fast netmon
Protect your edge BGP security made simple
Janog 39: speech about FastNetMon by Yutaka Ishizaki
Keeping your rack cool
Борьба с DDoS в хостинге - по обе стороны баррикад / Константин Новаковский (...
Open Source Logging and Metrics Tools
FastNetMonを試してみた
Utilize Process Improvement Methodologies to Improve Accounting by Tom Sonde ...
Creating Client Value
Gene synthesis technology and applications update—unleash your lab’s potentia...
U.S. Immigrant Visa Interview Appointments Scheduled by NVC
SNS Gelous color real nail
Implementation Experiences with SAP Ariba Solutions – Customer Panel
Soft skills pattern and syllabus, ducc systems
Ad

Similar to Ripe71 FastNetMon open source DoS / DDoS mitigation (20)

PPTX
PLNOG 17 - Artur Kane - DDoS? You shall not pass!
PDF
XDP in Practice: DDoS Mitigation @Cloudflare
PDF
Practical steps to mitigate DDoS attacks
PPTX
DeiC DDoS Prevention System - DDPS
PDF
CNIT 40: 4: Monitoring and detecting security breaches
PDF
EuroBSDCon 2013 - Mitigating DDoS Attacks at Layer 7
PDF
Kentik Network@Scale (Dan Ellis)
PDF
Practical steps to mitigate DDoS attacks
PDF
12 Years in DNS Security As a Defender
PDF
Bandwidth Monitoring - pfSense Hangout March 2015
PPT
OSTU - Sake Blok on Packet Capturing with Tshark
PPT
flowspec @ APF 2013
PDF
CNIT 40: 4: Monitoring and detecting security breaches
PDF
DDoS Challenges in IPv6 environment
PDF
KHNOG 3: DDoS Attack Prevention
PPTX
anti-ddos GNTC based on P4 /BIH
PPT
Day2
PPTX
DDoS: practical survival
PDF
A10 issa d do s 5-2014
PDF
Network Automation with Salt and NAPALM: Introuction
PLNOG 17 - Artur Kane - DDoS? You shall not pass!
XDP in Practice: DDoS Mitigation @Cloudflare
Practical steps to mitigate DDoS attacks
DeiC DDoS Prevention System - DDPS
CNIT 40: 4: Monitoring and detecting security breaches
EuroBSDCon 2013 - Mitigating DDoS Attacks at Layer 7
Kentik Network@Scale (Dan Ellis)
Practical steps to mitigate DDoS attacks
12 Years in DNS Security As a Defender
Bandwidth Monitoring - pfSense Hangout March 2015
OSTU - Sake Blok on Packet Capturing with Tshark
flowspec @ APF 2013
CNIT 40: 4: Monitoring and detecting security breaches
DDoS Challenges in IPv6 environment
KHNOG 3: DDoS Attack Prevention
anti-ddos GNTC based on P4 /BIH
Day2
DDoS: practical survival
A10 issa d do s 5-2014
Network Automation with Salt and NAPALM: Introuction

More from Pavel Odintsov (12)

PDF
BGP Flow Spec HKNOG 13
PDF
Network telemetry for DDoS detection presentation
PPTX
BGP FlowSpec experience and future developments
PDF
VietTel AntiDDoS Volume Based
PDF
DDoS Defense Mechanisms for IXP Infrastructures
PPTX
Flowspec contre les attaques DDoS : l'expérience danoise
PDF
Detectando DDoS e intrusiones con RouterOS
PDF
Lekker weer nlnog_nlnog_ddos_fl
PDF
Lekker weer nlnog_how_to_avoid_buying_expensive_routers
PDF
Implementing BGP Flowspec at IP transit network
PDF
SIG-NOC Tools Survey
PDF
Containers in real world презентация
BGP Flow Spec HKNOG 13
Network telemetry for DDoS detection presentation
BGP FlowSpec experience and future developments
VietTel AntiDDoS Volume Based
DDoS Defense Mechanisms for IXP Infrastructures
Flowspec contre les attaques DDoS : l'expérience danoise
Detectando DDoS e intrusiones con RouterOS
Lekker weer nlnog_nlnog_ddos_fl
Lekker weer nlnog_how_to_avoid_buying_expensive_routers
Implementing BGP Flowspec at IP transit network
SIG-NOC Tools Survey
Containers in real world презентация

Recently uploaded (20)

PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
DOCX
Unit-3 cyber security network security of internet system
PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PPTX
innovation process that make everything different.pptx
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PPTX
Internet___Basics___Styled_ presentation
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PDF
Introduction to the IoT system, how the IoT system works
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PPTX
artificial intelligence overview of it and more
PPTX
international classification of diseases ICD-10 review PPT.pptx
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
introduction about ICD -10 & ICD-11 ppt.pptx
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
SAP Ariba Sourcing PPT for learning material
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
Unit-3 cyber security network security of internet system
Slides PDF The World Game (s) Eco Economic Epochs.pdf
An introduction to the IFRS (ISSB) Stndards.pdf
innovation process that make everything different.pptx
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Internet___Basics___Styled_ presentation
WebRTC in SignalWire - troubleshooting media negotiation
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Cloud-Scale Log Monitoring _ Datadog.pdf
Introduction to the IoT system, how the IoT system works
Unit-1 introduction to cyber security discuss about how to secure a system
artificial intelligence overview of it and more
international classification of diseases ICD-10 review PPT.pptx
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...

Ripe71 FastNetMon open source DoS / DDoS mitigation