SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
OWASP Meetup Russia 12 Oct 2016
Web Application Firewalls:
Advanced analysis of detection
logic mechanisms
Vladimir Ivanov
@httpsonly
OWASP Meetup Russia 12 Oct 2016
MSc Information Security (merit) - RHUL (UK)
Web App penetration tester at Positive Technologies (ptsecurity.com)
Blog (bugbounty writeups): https://httpsonly.blogspot.com
/whoam/i
OWASP Meetup Russia 12 Oct 2016
1. Introduction
2. Detection logic in WAFs
3. METHOD I: Syntax bypass
4. METHOD II: Unexpected by primary logic bypass
5. Takeaways
Agenda
OWASP Meetup Russia 12 Oct 2016
The Standoff:
1. Attackers. Mix of various techniques, rarely understand root cause.
2. Defenders. WAFs protect against automative testing, every vendor
implements additional functionality.
Result: No careful whitebox analysis
Motivation
OWASP Meetup Russia 12 Oct 2016
WAF workflow example
Stage 1: Parse HTTP(s) packet from client
Stage 2: Chose rule set depending on type of
incoming parameter
Stage 3: Normalise data
Stage 4: Apply detection logic
Stage 5: Make detection decision
OWASP Meetup Russia 12 Oct 2016
WAF workflow:
Detection logic
OWASP CRS 2
OWASP CRS 3dev OWASP CRS 3rc
PHPIDS
Comodo rules
QuickDefenceWaf
Vultureproject
Waf.red
ShadowD
etc…
Tokenizer
libinjection
Reputation
repsheet
Score
Builder
NAXSI
Anomaly
detection
HMM
OWASP Meetup Russia 12 Oct 2016
Regular expression…
…is a sequence of characters that define a search pattern
(с) Wikipedia
(?i)(<script[^>]*>.*?)
1 2 3
OWASP Meetup Russia 12 Oct 2016
Sources500+ regular expressions:
• OWASP CRS2 (modsecurity)
• OWASP CRS3dev (modsecurity)
• OWASP CRS3rc1 (modsecurity)
• PHPIDS
• Comodo WAF
• QuickDefense
317
321
94 XSS
SQL
Other: LFI/RFI, PHP,
OS exec, etc
OWASP Meetup Russia 12 Oct 2016
300+ potential bypasses
Most “vulnerable”: PHPIDS (E = 1,15)
Less “vulnerable”: Comodo WAF (E = 0,32)
Most “exploitable”: OWASP CRS3-rc (E = 0,89)
E = Potential bypasses / Total rules
Results
OWASP Meetup Russia 12 Oct 2016
Not only WAFs use Reg Exp Detection Logic:
• XSS Auditors
• Backend parsers
• Front-end analyzers
Developers, security auditors, bughunters
Target audience
OWASP Meetup Russia 12 Oct 2016
Of regular expressions
Enumerate all possible and invent all impossible mistakes
METHOD I: Syntax bypass
OWASP Meetup Russia 12 Oct 2016
What’s wrong with regexp?
Level: Easy
(?i: )
^ $
{1,3}
1. atTacKpAyloAd
2. attackpayload
3. attackpayloadattackpayloadattackpayloadatt…
!!
OWASP Meetup Russia 12 Oct 2016
What’s wrong with regexp?
Level: Medium
ReDoS
Repetitions: + *
Blacklisting wildcards in a set
1.
2.
3.
OWASP Meetup Russia 12 Oct 2016
What’s wrong with regexp?
Level: Advanced
Non-standard diapasons1.
POSIX character classes2.
Operators3.
Backlinks, wildcards4.
OWASP Meetup Russia 12 Oct 2016
2 parts: theoretical "whitepaper" and practical "code".
Hack regular expressions with regular expressions!
+ SAST: Assists with whitebox analysis of regular expressions in source code
of your projects
+ Low false positives: Focused on finding high severity security issues
+ Opensource on Github!
- Does not dynamically analyze lexis (yet).
Regular expressions:
Security cheatsheet
OWASP Meetup Russia 12 Oct 2016
https://github.com/attackercan/
REGEXP-SECURITY-CHEATSHEET
OWASP Meetup Russia 12 Oct 2016
Regex Security Cheatsheet DEMO
+
«CVE generator»
DEMO
OWASP Meetup Russia 12 Oct 2016
^(?:ht|f)tps?://(.*)$
Comodo WAF:
Att4ck is bl0cked!
OWASP Meetup Russia 12 Oct 2016
JavaScript checker in real-life web app
We can make ReDoS on client-side by supplying specially crafted email as input.
But what if backend also has same regex for checking?
OWASP Meetup Russia 12 Oct 2016
XSS Auditor: EdgeHTML.dll
OWASP Meetup Russia 12 Oct 2016
XSS Auditor: EdgeHTML.dll
IE+Edge XSS
Auditor
Result: blocked
OWASP Meetup Russia 12 Oct 2016
XSS Auditor: EdgeHTML.dll
Regexp
bypass.
Result: alert!
Thx @ahack_ru for payload
OWASP Meetup Russia 12 Oct 2016
(?:div|like|between|and|not )s+w)
OWASP Meetup Russia 12 Oct 2016
(?:div|like|between|and|not )s+w)
https://github.com/PHPIDS/PHPIDS/commit/667e63af93e8fd2ee4df99dd98cb41acdf480906
OWASP Meetup Russia 12 Oct 2016
What’s next?
1. Identify WAF vendor and version using “signature” vulnerabilities.
2. Reveal and apply bypasses depending on a situation
3. Craft string which bypasses all regexp-based rules.
OWASP Meetup Russia 12 Oct 2016
ModSecurity 3 SQLi Bypass
Basic SQLi is given:
All SQLi Regexp bypass:
​-1'OR#foo
id=IF#foo
(ASCII#foo
((SELECT-version()/1.))<250,1,0) #
OWASP Meetup Russia 12 Oct 2016
What’s next?
1. Identify WAF vendor and version using “signature” vulnerabilities.
2. Reveal and apply bypasses depending on a situation
3. Craft string which bypasses all regexp-based rules.
4. …
5. Dig deeper!
OWASP Meetup Russia 12 Oct 2016
METHOD II: Unexpected by
primary logic bypass
OWASP Meetup Russia 12 Oct 2016
libinjection
OWASP Meetup Russia 12 Oct 2016
libinjection
OWASP Meetup Russia 12 Oct 2016
https://github.com/attackercan/
CPP-SQL-FUZZER
• Receive SQL query as input
• Fuzz it (mysql.h, SQLAPI.h, ODBC?)
• Record every query except syntax errors
• Parse output!
• Current MySQL.h perfomance: 21M symbols in ~10 mins;
speed = 35k queries per second (QPS).
• Up to 1.6M QPS!
OWASP Meetup Russia 12 Oct 2016
SQL fuzzer
OWASP Meetup Russia 12 Oct 2016
SQL fuzzer: Examples
OWASP Meetup Russia 12 Oct 2016
SQL fuzzer: Newest results
“Clever fuzzing” + scalable
DEMO
OWASP Meetup Russia 12 Oct 2016
SQL Fuzzer: Results
OWASP Meetup Russia 12 Oct 2016
• OWASP: Regexp security cheatsheet + SAST
•SQL Fuzzer: Classified tables
https://www.owasp.org/index.php/Regular_Expressi
on_Security_Cheatsheet
Contribution
OWASP Meetup Russia 12 Oct 2016
1. Help OWASP! Update Regular Expression Security Cheatsheet
2. Create regular expression Dynamic analysis tool
Call for help
OWASP Meetup Russia 12 Oct 2016
Questions?
OWASP Meetup Russia 12 Oct 2016
Arseniy Sharoglazov <mohemiv@gmail.com>
(Contribution to Regex Security Cheatsheet)
Dmitry Serebryannikov @dsrbr
(Contribution to SQL fuzzer)
Andrey Evlanin @xpathmaster
All @ptsecurity team ;)
Thank you

Mais conteúdo relacionado

Destaque

[1.3] Мониторинг событий ИБ — мастерим «дашборд» - Тарас Иващенко
[1.3] Мониторинг событий ИБ — мастерим «дашборд» - Тарас Иващенко[1.3] Мониторинг событий ИБ — мастерим «дашборд» - Тарас Иващенко
[1.3] Мониторинг событий ИБ — мастерим «дашборд» - Тарас Иващенко
OWASP Russia
 
[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection
Moabi.com
 
Software development lifecycle: final security review and automatization, Tar...
Software development lifecycle: final security review and automatization, Tar...Software development lifecycle: final security review and automatization, Tar...
Software development lifecycle: final security review and automatization, Tar...
OWASP Russia
 
Qradar ibm partner_enablement_220212_final
Qradar ibm partner_enablement_220212_finalQradar ibm partner_enablement_220212_final
Qradar ibm partner_enablement_220212_final
Arrow ECS UK
 
Black Ops of Fundamental Defense:
Black Ops of Fundamental Defense:Black Ops of Fundamental Defense:
Black Ops of Fundamental Defense:
Recursion Ventures
 

Destaque (18)

[HackInTheBox] Breaking virtualization by any means
[HackInTheBox] Breaking virtualization by any means[HackInTheBox] Breaking virtualization by any means
[HackInTheBox] Breaking virtualization by any means
 
[3.2] Content Security Policy - Pawel Krawczyk
[3.2] Content Security Policy - Pawel Krawczyk[3.2] Content Security Policy - Pawel Krawczyk
[3.2] Content Security Policy - Pawel Krawczyk
 
[1.3] Мониторинг событий ИБ — мастерим «дашборд» - Тарас Иващенко
[1.3] Мониторинг событий ИБ — мастерим «дашборд» - Тарас Иващенко[1.3] Мониторинг событий ИБ — мастерим «дашборд» - Тарас Иващенко
[1.3] Мониторинг событий ИБ — мастерим «дашборд» - Тарас Иващенко
 
QIWI SOC benchmarking: Blue Team story
QIWI SOC benchmarking: Blue Team storyQIWI SOC benchmarking: Blue Team story
QIWI SOC benchmarking: Blue Team story
 
Qradar as a SOC core
Qradar as a SOC coreQradar as a SOC core
Qradar as a SOC core
 
[2.2] Hacking Internet of Things devices - Ivan Novikov
[2.2] Hacking Internet of Things devices - Ivan Novikov[2.2] Hacking Internet of Things devices - Ivan Novikov
[2.2] Hacking Internet of Things devices - Ivan Novikov
 
Melbourne Office 365 User Group - February 2015
Melbourne Office 365 User Group - February 2015Melbourne Office 365 User Group - February 2015
Melbourne Office 365 User Group - February 2015
 
[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection
 
XPath Injection
XPath InjectionXPath Injection
XPath Injection
 
Software development lifecycle: final security review and automatization, Tar...
Software development lifecycle: final security review and automatization, Tar...Software development lifecycle: final security review and automatization, Tar...
Software development lifecycle: final security review and automatization, Tar...
 
XML & XPath Injections
XML & XPath InjectionsXML & XPath Injections
XML & XPath Injections
 
Lie to Me: Bypassing Modern Web Application Firewalls
Lie to Me: Bypassing Modern Web Application FirewallsLie to Me: Bypassing Modern Web Application Firewalls
Lie to Me: Bypassing Modern Web Application Firewalls
 
Qradar ibm partner_enablement_220212_final
Qradar ibm partner_enablement_220212_finalQradar ibm partner_enablement_220212_final
Qradar ibm partner_enablement_220212_final
 
[3.1] Webappsec future standards - Taras Ivaschenko
[3.1] Webappsec future standards - Taras Ivaschenko[3.1] Webappsec future standards - Taras Ivaschenko
[3.1] Webappsec future standards - Taras Ivaschenko
 
5 Ways to Get Even More from Your IBM Security QRadar Investment in 2016
5 Ways to Get Even More from Your IBM Security QRadar Investment in 20165 Ways to Get Even More from Your IBM Security QRadar Investment in 2016
5 Ways to Get Even More from Your IBM Security QRadar Investment in 2016
 
Tapping into the core
Tapping into the coreTapping into the core
Tapping into the core
 
Black Ops of Fundamental Defense:
Black Ops of Fundamental Defense:Black Ops of Fundamental Defense:
Black Ops of Fundamental Defense:
 
BGA SOME/SOC Etkinliği - Kurumsal SOME’ler için SOC Modeli Nasıl Olmalı?
BGA SOME/SOC Etkinliği - Kurumsal SOME’ler için SOC Modeli Nasıl Olmalı?BGA SOME/SOC Etkinliği - Kurumsal SOME’ler için SOC Modeli Nasıl Olmalı?
BGA SOME/SOC Etkinliği - Kurumsal SOME’ler için SOC Modeli Nasıl Olmalı?
 

Semelhante a Web Application Firewalls: Advanced analysis of detection logic mechanisms, Vladimir Ivanov

GraphConnect Europe 2016 - Pushing the Evolution of Software Analytics with G...
GraphConnect Europe 2016 - Pushing the Evolution of Software Analytics with G...GraphConnect Europe 2016 - Pushing the Evolution of Software Analytics with G...
GraphConnect Europe 2016 - Pushing the Evolution of Software Analytics with G...
Neo4j
 
Catching Multilayered Zero-Day Attacks on MS Office
Catching Multilayered Zero-Day Attacks on MS OfficeCatching Multilayered Zero-Day Attacks on MS Office
Catching Multilayered Zero-Day Attacks on MS Office
Kaspersky
 

Semelhante a Web Application Firewalls: Advanced analysis of detection logic mechanisms, Vladimir Ivanov (20)

OWASP Europe Summit Portugal 2008. Web Application Assessments
OWASP Europe Summit Portugal 2008. Web Application AssessmentsOWASP Europe Summit Portugal 2008. Web Application Assessments
OWASP Europe Summit Portugal 2008. Web Application Assessments
 
Owasp london training course 2010 - Matteo Meucci
Owasp london training course 2010 - Matteo MeucciOwasp london training course 2010 - Matteo Meucci
Owasp london training course 2010 - Matteo Meucci
 
A Quick Intro to ReactiveX
A Quick Intro to ReactiveXA Quick Intro to ReactiveX
A Quick Intro to ReactiveX
 
Automating Security Testing with the OWTF
Automating Security Testing with the OWTFAutomating Security Testing with the OWTF
Automating Security Testing with the OWTF
 
Creating, obfuscating and analyzing malware JavaScript
Creating, obfuscating and analyzing malware JavaScriptCreating, obfuscating and analyzing malware JavaScript
Creating, obfuscating and analyzing malware JavaScript
 
Automating Web Application Security Testing With OWASP ZAP DOT NET API - Tech...
Automating Web Application Security Testing With OWASP ZAP DOT NET API - Tech...Automating Web Application Security Testing With OWASP ZAP DOT NET API - Tech...
Automating Web Application Security Testing With OWASP ZAP DOT NET API - Tech...
 
OWASP an Introduction
OWASP an Introduction OWASP an Introduction
OWASP an Introduction
 
GraphConnect Europe 2016 - Pushing the Evolution of Software Analytics with G...
GraphConnect Europe 2016 - Pushing the Evolution of Software Analytics with G...GraphConnect Europe 2016 - Pushing the Evolution of Software Analytics with G...
GraphConnect Europe 2016 - Pushing the Evolution of Software Analytics with G...
 
Mirai botnet
Mirai botnetMirai botnet
Mirai botnet
 
Security Code Review for .NET - Sherif Koussa (OWASP Ottawa)
Security Code Review for .NET - Sherif Koussa (OWASP Ottawa)Security Code Review for .NET - Sherif Koussa (OWASP Ottawa)
Security Code Review for .NET - Sherif Koussa (OWASP Ottawa)
 
AppSec EU 2009 - HTTP Parameter Pollution by Luca Carettoni and Stefano di P...
AppSec EU 2009 - HTTP Parameter Pollution by Luca Carettoni and  Stefano di P...AppSec EU 2009 - HTTP Parameter Pollution by Luca Carettoni and  Stefano di P...
AppSec EU 2009 - HTTP Parameter Pollution by Luca Carettoni and Stefano di P...
 
Owasp tools - OWASP Serbia
Owasp tools - OWASP SerbiaOwasp tools - OWASP Serbia
Owasp tools - OWASP Serbia
 
Java Deserialization Vulnerabilities - The Forgotten Bug Class (RuhrSec Edition)
Java Deserialization Vulnerabilities - The Forgotten Bug Class (RuhrSec Edition)Java Deserialization Vulnerabilities - The Forgotten Bug Class (RuhrSec Edition)
Java Deserialization Vulnerabilities - The Forgotten Bug Class (RuhrSec Edition)
 
[Php Camp]Owasp Php Top5+Csrf
[Php Camp]Owasp Php Top5+Csrf[Php Camp]Owasp Php Top5+Csrf
[Php Camp]Owasp Php Top5+Csrf
 
Silent web app testing by example - BerlinSides 2011
Silent web app testing by example - BerlinSides 2011Silent web app testing by example - BerlinSides 2011
Silent web app testing by example - BerlinSides 2011
 
Catching Multilayered Zero-Day Attacks on MS Office
Catching Multilayered Zero-Day Attacks on MS OfficeCatching Multilayered Zero-Day Attacks on MS Office
Catching Multilayered Zero-Day Attacks on MS Office
 
Apache Cassandra: building a production app on an eventually-consistent DB
Apache Cassandra: building a production app on an eventually-consistent DBApache Cassandra: building a production app on an eventually-consistent DB
Apache Cassandra: building a production app on an eventually-consistent DB
 
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar KuppanHybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
 
Follow your code: Node tracing
Follow your code: Node tracingFollow your code: Node tracing
Follow your code: Node tracing
 
Datascript: Serverless Architetecture
Datascript: Serverless ArchitetectureDatascript: Serverless Architetecture
Datascript: Serverless Architetecture
 

Último

Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
anilsa9823
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
ellan12
 

Último (20)

How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 

Web Application Firewalls: Advanced analysis of detection logic mechanisms, Vladimir Ivanov

  • 1. OWASP Meetup Russia 12 Oct 2016 Web Application Firewalls: Advanced analysis of detection logic mechanisms Vladimir Ivanov @httpsonly
  • 2. OWASP Meetup Russia 12 Oct 2016 MSc Information Security (merit) - RHUL (UK) Web App penetration tester at Positive Technologies (ptsecurity.com) Blog (bugbounty writeups): https://httpsonly.blogspot.com /whoam/i
  • 3. OWASP Meetup Russia 12 Oct 2016 1. Introduction 2. Detection logic in WAFs 3. METHOD I: Syntax bypass 4. METHOD II: Unexpected by primary logic bypass 5. Takeaways Agenda
  • 4. OWASP Meetup Russia 12 Oct 2016 The Standoff: 1. Attackers. Mix of various techniques, rarely understand root cause. 2. Defenders. WAFs protect against automative testing, every vendor implements additional functionality. Result: No careful whitebox analysis Motivation
  • 5. OWASP Meetup Russia 12 Oct 2016 WAF workflow example Stage 1: Parse HTTP(s) packet from client Stage 2: Chose rule set depending on type of incoming parameter Stage 3: Normalise data Stage 4: Apply detection logic Stage 5: Make detection decision
  • 6. OWASP Meetup Russia 12 Oct 2016 WAF workflow: Detection logic OWASP CRS 2 OWASP CRS 3dev OWASP CRS 3rc PHPIDS Comodo rules QuickDefenceWaf Vultureproject Waf.red ShadowD etc… Tokenizer libinjection Reputation repsheet Score Builder NAXSI Anomaly detection HMM
  • 7. OWASP Meetup Russia 12 Oct 2016 Regular expression… …is a sequence of characters that define a search pattern (с) Wikipedia (?i)(<script[^>]*>.*?) 1 2 3
  • 8. OWASP Meetup Russia 12 Oct 2016 Sources500+ regular expressions: • OWASP CRS2 (modsecurity) • OWASP CRS3dev (modsecurity) • OWASP CRS3rc1 (modsecurity) • PHPIDS • Comodo WAF • QuickDefense 317 321 94 XSS SQL Other: LFI/RFI, PHP, OS exec, etc
  • 9. OWASP Meetup Russia 12 Oct 2016 300+ potential bypasses Most “vulnerable”: PHPIDS (E = 1,15) Less “vulnerable”: Comodo WAF (E = 0,32) Most “exploitable”: OWASP CRS3-rc (E = 0,89) E = Potential bypasses / Total rules Results
  • 10. OWASP Meetup Russia 12 Oct 2016 Not only WAFs use Reg Exp Detection Logic: • XSS Auditors • Backend parsers • Front-end analyzers Developers, security auditors, bughunters Target audience
  • 11. OWASP Meetup Russia 12 Oct 2016 Of regular expressions Enumerate all possible and invent all impossible mistakes METHOD I: Syntax bypass
  • 12. OWASP Meetup Russia 12 Oct 2016 What’s wrong with regexp? Level: Easy (?i: ) ^ $ {1,3} 1. atTacKpAyloAd 2. attackpayload 3. attackpayloadattackpayloadattackpayloadatt… !!
  • 13. OWASP Meetup Russia 12 Oct 2016 What’s wrong with regexp? Level: Medium ReDoS Repetitions: + * Blacklisting wildcards in a set 1. 2. 3.
  • 14. OWASP Meetup Russia 12 Oct 2016 What’s wrong with regexp? Level: Advanced Non-standard diapasons1. POSIX character classes2. Operators3. Backlinks, wildcards4.
  • 15. OWASP Meetup Russia 12 Oct 2016 2 parts: theoretical "whitepaper" and practical "code". Hack regular expressions with regular expressions! + SAST: Assists with whitebox analysis of regular expressions in source code of your projects + Low false positives: Focused on finding high severity security issues + Opensource on Github! - Does not dynamically analyze lexis (yet). Regular expressions: Security cheatsheet
  • 16. OWASP Meetup Russia 12 Oct 2016 https://github.com/attackercan/ REGEXP-SECURITY-CHEATSHEET
  • 17. OWASP Meetup Russia 12 Oct 2016 Regex Security Cheatsheet DEMO + «CVE generator» DEMO
  • 18. OWASP Meetup Russia 12 Oct 2016 ^(?:ht|f)tps?://(.*)$
  • 20. OWASP Meetup Russia 12 Oct 2016 JavaScript checker in real-life web app We can make ReDoS on client-side by supplying specially crafted email as input. But what if backend also has same regex for checking?
  • 21. OWASP Meetup Russia 12 Oct 2016 XSS Auditor: EdgeHTML.dll
  • 22. OWASP Meetup Russia 12 Oct 2016 XSS Auditor: EdgeHTML.dll IE+Edge XSS Auditor Result: blocked
  • 23. OWASP Meetup Russia 12 Oct 2016 XSS Auditor: EdgeHTML.dll Regexp bypass. Result: alert! Thx @ahack_ru for payload
  • 24. OWASP Meetup Russia 12 Oct 2016 (?:div|like|between|and|not )s+w)
  • 25. OWASP Meetup Russia 12 Oct 2016 (?:div|like|between|and|not )s+w) https://github.com/PHPIDS/PHPIDS/commit/667e63af93e8fd2ee4df99dd98cb41acdf480906
  • 26. OWASP Meetup Russia 12 Oct 2016 What’s next? 1. Identify WAF vendor and version using “signature” vulnerabilities. 2. Reveal and apply bypasses depending on a situation 3. Craft string which bypasses all regexp-based rules.
  • 27. OWASP Meetup Russia 12 Oct 2016 ModSecurity 3 SQLi Bypass Basic SQLi is given: All SQLi Regexp bypass: ​-1'OR#foo id=IF#foo (ASCII#foo ((SELECT-version()/1.))<250,1,0) #
  • 28. OWASP Meetup Russia 12 Oct 2016 What’s next? 1. Identify WAF vendor and version using “signature” vulnerabilities. 2. Reveal and apply bypasses depending on a situation 3. Craft string which bypasses all regexp-based rules. 4. … 5. Dig deeper!
  • 29. OWASP Meetup Russia 12 Oct 2016 METHOD II: Unexpected by primary logic bypass
  • 30. OWASP Meetup Russia 12 Oct 2016 libinjection
  • 31. OWASP Meetup Russia 12 Oct 2016 libinjection
  • 32. OWASP Meetup Russia 12 Oct 2016 https://github.com/attackercan/ CPP-SQL-FUZZER • Receive SQL query as input • Fuzz it (mysql.h, SQLAPI.h, ODBC?) • Record every query except syntax errors • Parse output! • Current MySQL.h perfomance: 21M symbols in ~10 mins; speed = 35k queries per second (QPS). • Up to 1.6M QPS!
  • 33. OWASP Meetup Russia 12 Oct 2016 SQL fuzzer
  • 34. OWASP Meetup Russia 12 Oct 2016 SQL fuzzer: Examples
  • 35. OWASP Meetup Russia 12 Oct 2016 SQL fuzzer: Newest results “Clever fuzzing” + scalable DEMO
  • 36. OWASP Meetup Russia 12 Oct 2016 SQL Fuzzer: Results
  • 37. OWASP Meetup Russia 12 Oct 2016 • OWASP: Regexp security cheatsheet + SAST •SQL Fuzzer: Classified tables https://www.owasp.org/index.php/Regular_Expressi on_Security_Cheatsheet Contribution
  • 38. OWASP Meetup Russia 12 Oct 2016 1. Help OWASP! Update Regular Expression Security Cheatsheet 2. Create regular expression Dynamic analysis tool Call for help
  • 39. OWASP Meetup Russia 12 Oct 2016 Questions?
  • 40. OWASP Meetup Russia 12 Oct 2016 Arseniy Sharoglazov <mohemiv@gmail.com> (Contribution to Regex Security Cheatsheet) Dmitry Serebryannikov @dsrbr (Contribution to SQL fuzzer) Andrey Evlanin @xpathmaster All @ptsecurity team ;) Thank you