SlideShare uma empresa Scribd logo
1 de 25
SORRY ABOUT YOUR WAF
Bypassing the Modern WAF
Johnny Xmas
Johnny.Xmas@Kasada.io
@J0hnnyXm4s
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
https://www.infoq.com/presentations/
waf-scripting-techniques-autonomous-
attacks/
Presented at QCon New York
www.qconnewyork.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Blade Runner &
Director of Field Engineering,
North America & Europe @ kasada.io
CISSP, GIAC, GPEN
JOHNNY XMASJohnny.Xmas@Kasada.io
PREVIOUS PROFESSIONAL ROLES:
•Network Engineer
•Systems Engineer
•InformaGon Security Engineer
•InformaGon Security Consultant
•PenetraGon Tester
•Industrial Security Researcher
LINKS:
•hIps://twiIer.com/j0hnnyxm4s
•hIps://www.linkedin.com/in/johnnyxmas/
•hIps://www.youtube.com/c/johnnyxmas
•hIps://github.com/johnnyxmas

WAFW E B A P P L I C AT I O N F I R E W A L L S
BASIC
•Very Basic Behavioral Analysis
•Various levels of IP ReputaGon, header
inspecGon and POST data inspecGon.
•Just blacklists IPs (LOL)
•Trivial to Bypass
SQLMap
https://github.com/sqlmapproject/sqlmap
WAFW E B A P P L I C AT I O N F I R E W A L L S
•OXen a Reverse Proxy
•ParGally relies on js execuGon
•Fingerprints client environment
SOPHISTIOCATED
Also, they’re both preOy useless. . .
…so let’s get hacking!
BARE MINIMUMS
•Huge # of “Free Proxy” sites
• https://hide.me
• https://hidester.com
• https://www.proxysite.com/
•Srsly just google “Free Proxies”
Rotate Your IP
BARE MINIMUMS
•Huge # of “Free Proxy” sites

•Hard to convince The
Business to allow blocking
residential IPs

•Residential IPs are easy to
lease in bulk

•Residential IPs are not free

•Services like HolaVPN and
MonkeySocks use users’ IPs
Use ResidenGal IPs
BARE MINIMUMS
Use The Usual HTTP Headers
BARE MINIMUMS
• BUT ALSO:
• Accept : */*
• DNT : 1
• X-Headers (Sometimes)
• User-Agent (NO QUOTES)
• Session Cookies (Sometimes)
•Seriously, this gets past so
many defenses
•Rotate with each HTTP
request, if possible
•Also use this for whitelist
fuzzing
Rotate User-Agents
•Auth’d sessions often have
more lenient throttling
•Some session cookies are
*required*
•WATCH OUT FOR
SNEAKY WAF COOKIES
Use Cookies
BARE MINIMUMS
Use POSTMan
https://www.getpostman.com/
(IT’S COOL, WE PROMISE)
P L E A S E B E A R W I T H U S F O R L I K E 2 M I N U T E S
SUPER BORING CODE DEMO
ADVANCED TACTICS
FOR CLOUD WAFS
BE THE LUCHADOR *AND* THE OSTRICHES
EDGE ENUMERATION
• Find ASN’s owned by target (ARIN,
etc)
• Find domains owned by target to
uncover additional ASNs (WHOIS)
• Find which IPs are hosting web
servers (ScanCannon)
• Enumerate paths to find forms, APIs,
data, etc (wfuzz, etc)
Check Every System
Smash DNS
•Find ASN’s owned by
target (ARIN, etc)
•Find domains owned by
target to uncover
additional ASNs
•Reverse Lookup on IPs to
DNS names (human-
language indicators)
•DNS History lookups
•DNS Zone Transfers
•DNS name fuzzing
EDGE ENUMERATION
•Discover all edge nodes
•Hit one until it blocks you,
then hit the next
•This exploits the sync
delay (often 15 minutes)
and conserves IPs
Round-Robin the Edge Nodes
•Layer 7 WAFs & their
associated CDNs
have path rules
•One application may
have multiple login
portals  paths
•Some of these may
be accidental or
intentionally
unprotected
Unprotected Paths
•APIs are almost never fully-protected;
often not at all
•Great if all you need is to steal data
•Can also be used to “test” credentials
Smash the API
•Use previous enumeration
(look for “origin” in DNS)
•UUID or hash DNS names
•Hitting these bypasses the WAF
completely
•Watch out for firewalls
Find the Origins
•Identify and block WAF
javascript snippets
•*RUN* WAF Javascript and
replay the resulting fingerprint
cookie
Ditch the Script, Share the Cookies
SOPHISTICATED WAFs
OR. . .
AUTOMATE A REAL BROWSER
•Headless Chrome •Puppeteer •Selenium
•Looks like human activity
•Practically undetectable
•Scriptable AF
•Executes Javascript
•Properly leverages
Cookies
•Multiple instances per IP
AUTOMATE A REAL BROWSER
https://github.com/GoogleChrome/puppeteer
RealisWc WebDriver
•User_agent

•Navigator_Platform

•Color_depth

•Pixel_ratio

•Cpu_Class
•Hardware_concurrency

•Resolution

•Available_resolutions

•Timezone_offset

•Session_storage
•Rotate IP Addresses
• Use Residential IPs
•Use the Usual HTTP
Headers
•Use POSTMan
•Rotate your User-
Agents
•Rotate session cookies

Rotate between targets
•Hit the Origin directly
•Use a Web Driver
• Change the stock
config!
SUMMARY:
Johnny Xmas, CISSP, GIAC, GPEN
THANKS FOR PLAYING!
Johnny.Xmas@Kasada.io
@J0hnnyXm4s
hOps://www.github.com/johnnyxmas/Talk_Decks
Watch the video with slide synchronization
on InfoQ.com!
https://www.infoq.com/presentations/waf-
scripting-techniques-autonomous-attacks/

Mais conteúdo relacionado

Mais de C4Media

Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDC4Media
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine LearningC4Media
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at SpeedC4Media
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsC4Media
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsC4Media
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerC4Media
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleC4Media
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeC4Media
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereC4Media
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing ForC4Media
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data EngineeringC4Media
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreC4Media
 
Navigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsNavigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsC4Media
 
High Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechHigh Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechC4Media
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/awaitC4Media
 
Opportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven UtopiaOpportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven UtopiaC4Media
 
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/DayDatadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/DayC4Media
 
Are We Really Cloud-Native?
Are We Really Cloud-Native?Are We Really Cloud-Native?
Are We Really Cloud-Native?C4Media
 
CockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL DatabaseCockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL DatabaseC4Media
 
A Dive into Streams @LinkedIn with Brooklin
A Dive into Streams @LinkedIn with BrooklinA Dive into Streams @LinkedIn with Brooklin
A Dive into Streams @LinkedIn with BrooklinC4Media
 

Mais de C4Media (20)

Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 
Navigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsNavigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery Teams
 
High Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechHigh Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in Adtech
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/await
 
Opportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven UtopiaOpportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven Utopia
 
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/DayDatadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
 
Are We Really Cloud-Native?
Are We Really Cloud-Native?Are We Really Cloud-Native?
Are We Really Cloud-Native?
 
CockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL DatabaseCockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL Database
 
A Dive into Streams @LinkedIn with Brooklin
A Dive into Streams @LinkedIn with BrooklinA Dive into Streams @LinkedIn with Brooklin
A Dive into Streams @LinkedIn with Brooklin
 

Último

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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...DianaGray10
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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.pdfsudhanshuwaghmare1
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
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...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
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 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Modern WAF Bypass Scripting Techniques for Autonomous Attacks

  • 1. SORRY ABOUT YOUR WAF Bypassing the Modern WAF Johnny Xmas Johnny.Xmas@Kasada.io @J0hnnyXm4s
  • 2. InfoQ.com: News & Community Site • 750,000 unique visitors/month • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • News 15-20 / week • Articles 3-4 / week • Presentations (videos) 12-15 / week • Interviews 2-3 / week • Books 1 / month Watch the video with slide synchronization on InfoQ.com! https://www.infoq.com/presentations/ waf-scripting-techniques-autonomous- attacks/
  • 3. Presented at QCon New York www.qconnewyork.com Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide
  • 4. Blade Runner & Director of Field Engineering, North America & Europe @ kasada.io CISSP, GIAC, GPEN JOHNNY XMASJohnny.Xmas@Kasada.io PREVIOUS PROFESSIONAL ROLES: •Network Engineer •Systems Engineer •InformaGon Security Engineer •InformaGon Security Consultant •PenetraGon Tester •Industrial Security Researcher LINKS: •hIps://twiIer.com/j0hnnyxm4s •hIps://www.linkedin.com/in/johnnyxmas/ •hIps://www.youtube.com/c/johnnyxmas •hIps://github.com/johnnyxmas

  • 5. WAFW E B A P P L I C AT I O N F I R E W A L L S BASIC •Very Basic Behavioral Analysis •Various levels of IP ReputaGon, header inspecGon and POST data inspecGon. •Just blacklists IPs (LOL) •Trivial to Bypass
  • 7. WAFW E B A P P L I C AT I O N F I R E W A L L S •OXen a Reverse Proxy •ParGally relies on js execuGon •Fingerprints client environment SOPHISTIOCATED
  • 8. Also, they’re both preOy useless. . . …so let’s get hacking!
  • 10. •Huge # of “Free Proxy” sites • https://hide.me • https://hidester.com • https://www.proxysite.com/ •Srsly just google “Free Proxies” Rotate Your IP BARE MINIMUMS
  • 11. •Huge # of “Free Proxy” sites
 •Hard to convince The Business to allow blocking residential IPs
 •Residential IPs are easy to lease in bulk
 •Residential IPs are not free
 •Services like HolaVPN and MonkeySocks use users’ IPs Use ResidenGal IPs BARE MINIMUMS
  • 12. Use The Usual HTTP Headers BARE MINIMUMS • BUT ALSO: • Accept : */* • DNT : 1 • X-Headers (Sometimes) • User-Agent (NO QUOTES) • Session Cookies (Sometimes)
  • 13. •Seriously, this gets past so many defenses •Rotate with each HTTP request, if possible •Also use this for whitelist fuzzing Rotate User-Agents •Auth’d sessions often have more lenient throttling •Some session cookies are *required* •WATCH OUT FOR SNEAKY WAF COOKIES Use Cookies BARE MINIMUMS
  • 15. (IT’S COOL, WE PROMISE) P L E A S E B E A R W I T H U S F O R L I K E 2 M I N U T E S SUPER BORING CODE DEMO
  • 16. ADVANCED TACTICS FOR CLOUD WAFS BE THE LUCHADOR *AND* THE OSTRICHES
  • 17. EDGE ENUMERATION • Find ASN’s owned by target (ARIN, etc) • Find domains owned by target to uncover additional ASNs (WHOIS) • Find which IPs are hosting web servers (ScanCannon) • Enumerate paths to find forms, APIs, data, etc (wfuzz, etc) Check Every System Smash DNS •Find ASN’s owned by target (ARIN, etc) •Find domains owned by target to uncover additional ASNs •Reverse Lookup on IPs to DNS names (human- language indicators) •DNS History lookups •DNS Zone Transfers •DNS name fuzzing
  • 18. EDGE ENUMERATION •Discover all edge nodes •Hit one until it blocks you, then hit the next •This exploits the sync delay (often 15 minutes) and conserves IPs Round-Robin the Edge Nodes •Layer 7 WAFs & their associated CDNs have path rules •One application may have multiple login portals paths •Some of these may be accidental or intentionally unprotected Unprotected Paths •APIs are almost never fully-protected; often not at all •Great if all you need is to steal data •Can also be used to “test” credentials Smash the API
  • 19. •Use previous enumeration (look for “origin” in DNS) •UUID or hash DNS names •Hitting these bypasses the WAF completely •Watch out for firewalls Find the Origins •Identify and block WAF javascript snippets •*RUN* WAF Javascript and replay the resulting fingerprint cookie Ditch the Script, Share the Cookies SOPHISTICATED WAFs OR. . .
  • 20. AUTOMATE A REAL BROWSER
  • 21. •Headless Chrome •Puppeteer •Selenium •Looks like human activity •Practically undetectable •Scriptable AF •Executes Javascript •Properly leverages Cookies •Multiple instances per IP AUTOMATE A REAL BROWSER https://github.com/GoogleChrome/puppeteer
  • 23. •Rotate IP Addresses • Use Residential IPs •Use the Usual HTTP Headers •Use POSTMan •Rotate your User- Agents •Rotate session cookies
 Rotate between targets •Hit the Origin directly •Use a Web Driver • Change the stock config! SUMMARY:
  • 24. Johnny Xmas, CISSP, GIAC, GPEN THANKS FOR PLAYING! Johnny.Xmas@Kasada.io @J0hnnyXm4s hOps://www.github.com/johnnyxmas/Talk_Decks
  • 25. Watch the video with slide synchronization on InfoQ.com! https://www.infoq.com/presentations/waf- scripting-techniques-autonomous-attacks/