SlideShare une entreprise Scribd logo
1  sur  50
Télécharger pour lire hors ligne
Running at 99%: Mitigating Application DoS
Ryan Huber
rhuber@gmail.com
@ryanhuber1
Thursday, October 10, 13
$contest
ssid: DoS2own
key: DoS2own!
target: http://feeblechat.com/ or http://10.0.0.2
rules: network DoS doesn’t count, MITM meh..
goal: polling must fail for > 30 seconds
prize: MY WEBSERVER!
Thursday, October 10, 13
$topics
app DoS intro/attack demo
mitigation strategies
bouncer
recap
Thursday, October 10, 13
$99%?
service 99% of users (limit false positives)
at 99% utilization (know your capacity)
Thursday, October 10, 13
$denial of service
network DoS
application DoS
Thursday, October 10, 13
$topics
app DoS primer/attack demo
mitigation strategies
bouncer
recap
Thursday, October 10, 13
$application DoS
its goal is
goal is to exceed your capacity to handle requests
it is
effective with few attack resources
targets or creates slow operations
more difficult to detect
no easy off-the-shelf mitigation
Thursday, October 10, 13
$app DoS categories
webserver
your application
Thursday, October 10, 13
$apache
the number we care about is
MaxClients
Thursday, October 10, 13
$slow headers
(slow loris)
connect
send a header every X seconds
wash, rinse, repeat
Thursday, October 10, 13
$slow POST
(R U Dead Yet)
find a form
POST 2gb of data @ .0000001KB/s
Thursday, October 10, 13
$slow read
GET /a_page
read it @ .000000001KB/s
Thursday, October 10, 13
$webserver DoS demo
Thursday, October 10, 13
$app DoS (your_app)
(targeted attack)
repeatedly execute expensive queries
large downloads
exceed a backend connection pool
create many sessions
Thursday, October 10, 13
$topics
app DoS primer/attack demo
mitigation strategies
bouncer
recap
Thursday, October 10, 13
$apache
mod_reqtimeout/mod_qos
varnish/reverse proxy
Thursday, October 10, 13
$strategies
keep slow pages behind login
limit POSTs
don’t generate sessions on GET /
leverage a CDN for large/static content
change webserver software
¡optimize your code!
Thursday, October 10, 13
$identification
Thursday, October 10, 13
$identification
user-agent
same url
no referer
hidden link(s)
geoip
ignores cookies/session
missing common headers
request timing
first seen time
proof of work
last resort: captcha
Thursday, October 10, 13
$a real example
german website
100,000 hosts
3 req/min
random valid URLs
Thursday, October 10, 13
$topics
app DoS primer/attack demo
mitigation strategies
bouncer
recap
Thursday, October 10, 13
$bouncer
(written in node)
(inspired by netflow)
Thursday, October 10, 13
$why node.js?
because it’s @hipsterhacker approved!
Thursday, October 10, 13
$seriously why node.js?
asynchronous
fast when your task is not CPU bound
great lib node-http-proxy
well known language
JSON is native
Thursday, October 10, 13
$goals
minimal code
small memory footprint
fail open
works in cloud
JSON messaging
decisions made outside of proxy code
Thursday, October 10, 13
$architecture
GRAPHIC HERE (combine next slide)
Thursday, October 10, 13
$message format
{"time":1379603264938,"type":"connect",
"host":"10.0.0.150"}
{"time":1379603264940,"type":"request",
"host":"10.0.0.150",
"url":"/changelog/","method":"GET",
"headers": (....),"uuid":
"f42095a1-3a4b-41fc-b005-46f504cde2a0"}
{"time":1379603263662,"type":"end",
"uuid":
"f42095a1-3a4b-41fc-b005-46f504cde2a0"}
Thursday, October 10, 13
$proxy.js
reverse proxy
has own blacklist
has own greylist
has own disabled URL list
236 lines of code
dynamic header and request timeouts
Thursday, October 10, 13
$proxy.js (does):
closes blacklisted sockets immediately
monitors total time to send headers (mitigate slow loris)
monitors total time from request to end of response
assigns UUID (v4) to every request
forwards request records to aggregator
Thursday, October 10, 13
$aggregator.js (does)
links proxies and consumers
multiplex events to consumers
multiplex commands to proxies
64 lines of code
Thursday, October 10, 13
$consumers
you write these
“drink from the (JSON) firehose”
make independent decisions
can be sized to the problem
send commands upstream via aggregator
Thursday, October 10, 13
$consumer commands
block/unblock
grey
durl/eurl
htimeout
rtimeout
flush
Thursday, October 10, 13
$example commands
BLOCK 10.0.0.1|10000
DURL /puppies_in_santa_costume.jpg
GREY 192.168.1.1|60000
HTIMEOUT 2000
RTIMEOUT 10000
Thursday, October 10, 13
$example consumer 1
track TCP connection attempts over a time period
cross the threshold, block
Thursday, October 10, 13
$demo consumer 1
Thursday, October 10, 13
$example consumer 2
track pages using the most time
track hosts using those pages
disable the url for hosts that cross threshold
Thursday, October 10, 13
$demo consumer 2
Thursday, October 10, 13
$demo consumer 2a
thi
Thursday, October 10, 13
$example consumer 3
python + redis
sorted sets are AWESOME
times stored for each ip with specified granularity
Thursday, October 10, 13
$demo consumer 3
Thursday, October 10, 13
$logs
echo -e ‘Cn’ | ncat (aggregator) 5555 |
gzip > /tmp/meh.log
Thursday, October 10, 13
$running
proxy MUST be run with ulimit -n increase
node ‘forever’ for daemonizing
clock sync VERY IMPORTANT
Thursday, October 10, 13
$performance testing!
AWS c1.medium example 2 -> 62k requests/s
(datatest.py generated data)
network saturated before CPU
Thursday, October 10, 13
$other uses
weathering a popularity storm
scraper-pocalypse
Thursday, October 10, 13
$the future, Conan?
gzip
operationalize
document
amazon amis
library of consumers
¿multicast?
¿log destroyed connections?
Thursday, October 10, 13
$takeaways
DoS mitigation is easier with a complete picture
suggestions are VERY welcome
contribution much appreciated
Thursday, October 10, 13
$further reading
http://goo.gl/c2vyEc
Thursday, October 10, 13
$whoami
ryan huber
risk.io
orbitz.com
ebookers.com
small local ISP
Thursday, October 10, 13
$thanks!
https://www.github.com/rawdigits/Bouncer
rhuber@gmail.com
@ryanhuber
Thursday, October 10, 13
$DEMO!!11!1!
Thursday, October 10, 13

Contenu connexe

En vedette

Ultrabooks for real
Ultrabooks for realUltrabooks for real
Ultrabooks for real
Katie Wood
 
Panduan pkm-tahun-2013
Panduan pkm-tahun-2013Panduan pkm-tahun-2013
Panduan pkm-tahun-2013
Sindi Erwanti
 
Sejarah perkemangan ilmu
Sejarah perkemangan ilmuSejarah perkemangan ilmu
Sejarah perkemangan ilmu
Kodogg Kritingg
 
1.2 μυκηναϊκός πολιτισμος β
1.2 μυκηναϊκός πολιτισμος β1.2 μυκηναϊκός πολιτισμος β
1.2 μυκηναϊκός πολιτισμος β
varalig
 
Οι Ολυμπιακοί Αγώνες στο χρόνο
Οι Ολυμπιακοί Αγώνες στο χρόνοΟι Ολυμπιακοί Αγώνες στο χρόνο
Οι Ολυμπιακοί Αγώνες στο χρόνο
varalig
 
Tra. parc. de ipap
Tra. parc. de ipapTra. parc. de ipap
Tra. parc. de ipap
VIDMACK075
 
Kλασική εποχή γ' μέρος
Kλασική εποχή γ' μέροςKλασική εποχή γ' μέρος
Kλασική εποχή γ' μέρος
varalig
 
Rppfiqihviianyar 130722111454-phpapp01
Rppfiqihviianyar 130722111454-phpapp01Rppfiqihviianyar 130722111454-phpapp01
Rppfiqihviianyar 130722111454-phpapp01
gaga sihab
 
Chapter 007-standar-akuntansi-keuangan-daerah
Chapter 007-standar-akuntansi-keuangan-daerahChapter 007-standar-akuntansi-keuangan-daerah
Chapter 007-standar-akuntansi-keuangan-daerah
resig jeflin
 

En vedette (20)

Ultrabooks for real
Ultrabooks for realUltrabooks for real
Ultrabooks for real
 
κεφ. ε 4.η συγκρότηση της αθηναϊκής κοινωνίας
κεφ. ε 4.η συγκρότηση της αθηναϊκής κοινωνίαςκεφ. ε 4.η συγκρότηση της αθηναϊκής κοινωνίας
κεφ. ε 4.η συγκρότηση της αθηναϊκής κοινωνίας
 
Panduan pkm-tahun-2013
Panduan pkm-tahun-2013Panduan pkm-tahun-2013
Panduan pkm-tahun-2013
 
Sejarah perkemangan ilmu
Sejarah perkemangan ilmuSejarah perkemangan ilmu
Sejarah perkemangan ilmu
 
1.2 μυκηναϊκός πολιτισμος β
1.2 μυκηναϊκός πολιτισμος β1.2 μυκηναϊκός πολιτισμος β
1.2 μυκηναϊκός πολιτισμος β
 
Οι Ολυμπιακοί Αγώνες στο χρόνο
Οι Ολυμπιακοί Αγώνες στο χρόνοΟι Ολυμπιακοί Αγώνες στο χρόνο
Οι Ολυμπιακοί Αγώνες στο χρόνο
 
Tra. parc. de ipap
Tra. parc. de ipapTra. parc. de ipap
Tra. parc. de ipap
 
Final project essay perla
Final project essay perlaFinal project essay perla
Final project essay perla
 
2014 12-02 hta emro banken 1
2014 12-02 hta emro banken 12014 12-02 hta emro banken 1
2014 12-02 hta emro banken 1
 
Simple present tense
Simple present tenseSimple present tense
Simple present tense
 
2015-12-11 UdM l’ETS en appui à la couverture sanitaire universelle
2015-12-11 UdM l’ETS en appui à la couverture sanitaire universelle2015-12-11 UdM l’ETS en appui à la couverture sanitaire universelle
2015-12-11 UdM l’ETS en appui à la couverture sanitaire universelle
 
Kλασική εποχή γ' μέρος
Kλασική εποχή γ' μέροςKλασική εποχή γ' μέρος
Kλασική εποχή γ' μέρος
 
Rppfiqihviianyar 130722111454-phpapp01
Rppfiqihviianyar 130722111454-phpapp01Rppfiqihviianyar 130722111454-phpapp01
Rppfiqihviianyar 130722111454-phpapp01
 
Storyboard for Trig Ratios Lesson
Storyboard for Trig Ratios LessonStoryboard for Trig Ratios Lesson
Storyboard for Trig Ratios Lesson
 
Chapter 007-standar-akuntansi-keuangan-daerah
Chapter 007-standar-akuntansi-keuangan-daerahChapter 007-standar-akuntansi-keuangan-daerah
Chapter 007-standar-akuntansi-keuangan-daerah
 
Complimenting other
Complimenting other Complimenting other
Complimenting other
 
Ultrabooks
UltrabooksUltrabooks
Ultrabooks
 
basic level for kids
basic level for kids basic level for kids
basic level for kids
 
Expressing hope
Expressing hopeExpressing hope
Expressing hope
 
Η ζωή της Θεοδώρας (3)
Η ζωή της Θεοδώρας (3)Η ζωή της Θεοδώρας (3)
Η ζωή της Θεοδώρας (3)
 

Similaire à Running At 99%: Mitigating App DoS

Network Traffic Search using Apache HBase
Network Traffic Search using Apache HBaseNetwork Traffic Search using Apache HBase
Network Traffic Search using Apache HBase
Evans Ye
 
Malware vs Big Data
Malware vs Big DataMalware vs Big Data
Malware vs Big Data
Frank Denis
 
Vinted life embetterment
Vinted life embettermentVinted life embetterment
Vinted life embetterment
Agile Lietuva
 

Similaire à Running At 99%: Mitigating App DoS (20)

Armorizing applications
Armorizing applicationsArmorizing applications
Armorizing applications
 
Continuous Delivery at Netflix
Continuous Delivery at NetflixContinuous Delivery at Netflix
Continuous Delivery at Netflix
 
PLNOG 17 - Patryk Wojtachnio - DDoS mitygacja oraz ochrona sieci w środowisku...
PLNOG 17 - Patryk Wojtachnio - DDoS mitygacja oraz ochrona sieci w środowisku...PLNOG 17 - Patryk Wojtachnio - DDoS mitygacja oraz ochrona sieci w środowisku...
PLNOG 17 - Patryk Wojtachnio - DDoS mitygacja oraz ochrona sieci w środowisku...
 
Exploring the Possibilities of Sencha and WebRTC
Exploring the Possibilities of Sencha and WebRTCExploring the Possibilities of Sencha and WebRTC
Exploring the Possibilities of Sencha and WebRTC
 
Art and Science of Web Sites Performance: A Front-end Approach
Art and Science of Web Sites Performance: A Front-end ApproachArt and Science of Web Sites Performance: A Front-end Approach
Art and Science of Web Sites Performance: A Front-end Approach
 
So what's a web app? introduction to the chrome web store
So what's a web app? introduction to the chrome web storeSo what's a web app? introduction to the chrome web store
So what's a web app? introduction to the chrome web store
 
Web Performance Optimization @Develer
Web Performance Optimization @DevelerWeb Performance Optimization @Develer
Web Performance Optimization @Develer
 
In Plain Sight: The Perfect Exfiltration
In Plain Sight: The Perfect ExfiltrationIn Plain Sight: The Perfect Exfiltration
In Plain Sight: The Perfect Exfiltration
 
Network Traffic Search using Apache HBase
Network Traffic Search using Apache HBaseNetwork Traffic Search using Apache HBase
Network Traffic Search using Apache HBase
 
Hammering Responsive Web Design Into Shape
Hammering Responsive Web Design Into ShapeHammering Responsive Web Design Into Shape
Hammering Responsive Web Design Into Shape
 
DNS High-Availability Tools - Open-Source Load Balancing Solutions
DNS High-Availability Tools - Open-Source Load Balancing SolutionsDNS High-Availability Tools - Open-Source Load Balancing Solutions
DNS High-Availability Tools - Open-Source Load Balancing Solutions
 
Malware vs Big Data
Malware vs Big DataMalware vs Big Data
Malware vs Big Data
 
Ddos and mitigation methods.pptx (1)
Ddos and mitigation methods.pptx (1)Ddos and mitigation methods.pptx (1)
Ddos and mitigation methods.pptx (1)
 
DNS DDoS Attack and Risk
DNS DDoS Attack and RiskDNS DDoS Attack and Risk
DNS DDoS Attack and Risk
 
REST in peace @ IPC 2012 in Mainz
REST in peace @ IPC 2012 in MainzREST in peace @ IPC 2012 in Mainz
REST in peace @ IPC 2012 in Mainz
 
Scaling Streaming - Concepts, Research, Goals
Scaling Streaming - Concepts, Research, GoalsScaling Streaming - Concepts, Research, Goals
Scaling Streaming - Concepts, Research, Goals
 
Full Stack & Full Circle: What the Heck Happens In an HTTP Request-Response C...
Full Stack & Full Circle: What the Heck Happens In an HTTP Request-Response C...Full Stack & Full Circle: What the Heck Happens In an HTTP Request-Response C...
Full Stack & Full Circle: What the Heck Happens In an HTTP Request-Response C...
 
Understanding the Node.js Platform
Understanding the Node.js PlatformUnderstanding the Node.js Platform
Understanding the Node.js Platform
 
Vinted life embetterment
Vinted life embettermentVinted life embetterment
Vinted life embetterment
 
DEF CON 27 - GERALD DOUSSOT AND ROGER MEYER - state of dns rebinding attack ...
DEF CON 27 - GERALD DOUSSOT  AND ROGER MEYER - state of dns rebinding attack ...DEF CON 27 - GERALD DOUSSOT  AND ROGER MEYER - state of dns rebinding attack ...
DEF CON 27 - GERALD DOUSSOT AND ROGER MEYER - state of dns rebinding attack ...
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Running At 99%: Mitigating App DoS