SlideShare a Scribd company logo
1
How To Shot Web
(Better hacking in 2015)
2
Jason Haddix
● Bugcrowd
● Director of Technical Ops
● Hacker & Bug hunter
● #1 on all-time leaderboard bugcrowd 2014
whoami
@jhaddix
3
Hack
Stuff
Better
(and practically)
What this talk’s about...
And…LOTS of memes…. only some are funny
4
Step 1: Cut a hole in a box... j/k
Step 1: Started with my bug hunting methodology
Step 2: Parsed some of the top bug hunters’ research (web/mobile only for now)
Step 3: Create kickass preso
Topics? BB philosophy shifts, discovery
techniques, mapping methodology, parameters
oft attacked, useful fuzz strings, bypass or filter
evasion techniques, new/awesome tooling
More Specifically
5
Philosophy
6
Differences from standard testing
Single-sourced Crowdsourced
● looking mostly for
common-ish vulns
● not competing with
others
● incentivized for count
● payment based on sniff
test
● looking for vulns that
aren’t as easy to find
● racing vs. time
● competitive vs. others
● incentivized to find
unique bugs
● payment based on
impact not number of
findings
7
The regular methodologies
8
Discovery
9
Find the road less traveled
^ means find the application (or parts of an
application) less tested.
1. *.acme.com scope is your friend
2. Find domains via Google (and others!)
a. Can be automated well via recon-ng
and other tools.
3. Port scan for obscure web servers or
services (on all domains)
4. Find acquisitions and the bounty
acquisition rules
a. Google has a 6 month rule
5. Functionality changes or re-designs
6. Mobile websites
7. New mobile app versions
10
Tool: Recon-ng script (enumall.sh)
https://github.com/jhaddix/domain
11
12
LMGTFY
13
LMGTFY
14
15
https://www.facebook.com/notes/phwd/facebook-bug-bounties/707217202701640
16
Port scanning is not just for Netpen!
A full port scan of all your new found targets will usually
yield #win:
● separate webapps
● extraneous services
● Facebook had Jenkins Script console with no auth
● IIS.net had rdp open vulnerable to MS12_020
nmap -sS -A -PN -p- --script=http-title dontscanme.bro
^ syn scan, OS + service fingerprint, no ping, all ports,
http titles
Port Scanning!
17
Mapping
18
Mapping tips
● Google
● *Smart* Directory Brute Forcing
● RAFT lists (included in Seclists)
● SVN Digger (included in Seclists)
● Git Digger
● Platform Identification:
● Wapplyzer (Chrome)
● Builtwith (Chrome)
● retire.js (cmd-line or Burp)
● Check CVE’s
● Auxiliary
● WPScan
● CMSmap
19
Directory Bruteforce Workflow
After bruteforcing look for other status codes indicating you are denied or require auth then
append list there to test for misconfigured access control.
Example:
GET http://www.acme.com - 200
GET http://www.acme.com/backlog/ - 404
GET http://www.acme.com/controlpanel/ - 401 hmm.. ok
GET http://www.acme.com/controlpanel/[bruteforce here now]
20
Mapping/Vuln Discovery using OSINT
Find previous/existing problem:
● Xssed.com
● Reddit XSS - /r/xss
● Punkspider
● xss.cx
● xssposed.org
● twitter searching
● ++
Issues might already reported but use the flaw area
and injection type to guide you to further injections or
filter bypass.
21
New Project: Maps
New OSINT/Mapping project
● 250+ bounty programs
● Crawl
● DNS info + bruteforce
● Bounty metadata (links, rewards, scope)
● API -> Intrigue
http://github.com/bugcrowdlabs/maps
22
23
Using the Maps Project: Crawling
Using + Ruby + Anemone + JSON + Grep
$cat test_target_json.txt | grep redirect
https://test_target/redirect/?url=http://twitter.com/...
https://test_target/redirect/?url=http://facebook.com/...
https://test_target/redirect/?url=http://pinterest.com/...
24
New Tool: Intrigue
OSINT framework, simple to integrate. Features like:
● DNS Subdomain Brute force
● Web Spider
● Nmap Scan
● etc
Code @ http://github.com/intrigueio/intrigue-core
25
26
27
Auth and Session
28
Auth (better be quick)
Auth Related (more in logic, priv, and transport sections)
● User/pass discrepancy flaw
● Registration page harvesting
● Login page harvesting
● Password reset page harvesting
● No account lockout
● Weak password policy
● Password not required for account updates
● Password reset tokens (no expiry or re-use)
29
Session (better be quick)
Session Related
● Failure to invalidate old cookies
● No new cookies on login/logout/timeout
● Never ending cookie length
● Multiple sessions allowed
● Easily reversible cookie (base64 most often)
30
Tactical Fuzzing - XSS
31
XSS
Core Idea: Does the page functionality display something to the users?
For time sensitive testing the 80/20 rule
applies. Many testers use Polyglot payloads.
You probably have too!
32
XSS
';alert(String.fromCharCode(88,83,83))//';alert(String.
fromCharCode(88,83,83))//";alert(String.fromCharCode
(88,83,83))//";alert(String.fromCharCode(88,83,83))//--
></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))
</SCRIPT>
Multi-context, filter bypass based polyglot payload #1 (Rsnake XSS Cheat Sheet)
33
XSS
'">><marquee><img src=x onerror=confirm(1)></marquee>"
></plaintext></|><plaintext/onmouseover=prompt(1)
><script>prompt(1)</script>@gmail.com<isindex
formaction=javascript:alert(/XSS/) type=submit>'-->"
></script><script>alert(1)</script>"><img/id="confirm&lpar;
1)"/alt="/"src="/"onerror=eval(id&%23x29;>'"><img src="http:
//i.imgur.com/P8mL8.jpg">
Multi-context, filter bypass based polyglot payload #2 (Ashar Javed XSS Research)
34
XSS
“ onclick=alert(1)//<button ‘ onclick=alert(1)//> */ alert(1)//
Multi-context polyglot payload (Mathias Karlsson)
35
Other XSS
Observations
Input Vectors
Customizable Themes & Profiles via CSS
Event or meeting names
URI based
Imported from a 3rd party (think Facebook integration)
JSON POST Values (check returning content type)
File Upload names
Uploaded files (swf, HTML, ++)
Custom Error pages
fake params - ?realparam=1&foo=bar’+alert(/XSS/)+’
Login and Forgot password forms
36
SWF Parameter XSS
Common Params:
Common Params:
onload, allowedDomain, movieplayer, xmlPath, eventhandler, callback (more on OWASP page)
Common Injection Strings:
%22})))}catch(e){alert(document.domain);}//
"]);}catch(e){}if(!self.a)self.a=!alert(document.domain);//
"a")(({type:"ready"}));}catch(e){alert(1)}//
37
SWF Parameter XSS
38
Tactical Fuzzing - SQLi
39
SQL Injection
Core Idea: Does the page look like it might need to call on stored data?
There exist some SQLi polyglots, i.e;
SLEEP(1) /*‘ or SLEEP(1) or ‘“ or SLEEP(1) or “*/
Works in single quote context, works in double quote context, works in “straight into query”
context! (Mathias Karlsson)
40
SQL Injection
You can also leverage the large database of
fuzzlists from Seclists here:
41
SQL Injection Observations
Blind is predominant, Error based is highly unlikely.
‘%2Bbenchmark(3200,SHA1(1))%2B’
‘+BENCHMARK(40000000,SHA1(1337))+’
SQLMap is king!
● Use -l to parse a Burp log file.
● Use Tamper Scripts for blacklists.
● SQLiPy Burp plugin works well to instrument SQLmap quickly.
Lots of injection in web services!
Common Parameters or Injection points
ID
Currency Values
Item number values
sorting parameters (i.e order, sort, etc)
JSON and XML values
Cookie values (really?)
Custom headers (look for possible
integrations with CDN’s or WAF’s)
REST based Services
42
SQLmap SQLiPy
43
Best SQL injection resources
DBMS Specific Resources
mySQL PentestMonkey's mySQL injection cheat sheet
Reiners mySQL injection Filter Evasion Cheatsheet
MSSQL EvilSQL's Error/Union/Blind MSSQL Cheatsheet
PentestMonkey's MSSQL SQLi injection Cheat Sheet
ORACLE PentestMonkey's Oracle SQLi Cheatsheet
POSTGRESQL PentestMonkey's Postgres SQLi Cheatsheet
Others Access SQLi Cheatsheet
PentestMonkey's Ingres SQL Injection Cheat Sheet
pentestmonkey's DB2 SQL Injection Cheat Sheet
pentestmonkey's Informix SQL Injection Cheat Sheet
SQLite3 Injection Cheat sheet
Ruby on Rails (Active Record) SQL Injection Guide
44
Tactical Fuzzing - FI & Uploads
45
Local file inclusion
Core Idea: Does it (or can it) interact with the server file system?
Liffy is new and cool here but you can also use Seclists: Common Parameters or Injection points
file=
location=
locale=
path=
display=
load=
read=
retrieve=
46
Malicious File Upload ++
This is an important and common attack vector in this type of testing
A file upload functions need a lot of protections to be adequately secure.
Attacks:
● Upload unexpected file format to achieve code exec (swf, html, php, php3, aspx, ++) Web
shells or...
● Execute XSS via same types of files. Images as well!
● Attack the parser to DoS the site or XSS via storing payloads in metadata or file header
● Bypass security zones and store malware on target site via file polyglots
47
Malicious File Upload ++
File upload attacks are a whole presentation. Try this one to get a feel for bypass techniques:
● content type spoofing
● extension trickery
● File in the hole! presentaion - http://goo.gl/VCXPh6
48
Malicious File Upload ++
As referenced file polyglots can be used
to store malware on servers!
See @dan_crowley ‘s talk: http://goo.
gl/pquXC2
and @angealbertini research: corkami.
com
49
Remote file includes and redirects
Look for any param with another web address
in it. Same params from LFI can present here too.
Common blacklist bypasses:
● escape  "/" with "/" or “//” with “//”
● try single "/" instead of "//"
● remove http i.e. "continue=//google.com"
● “//” , “|/” , “/%09/”
● encode, slashes
● ”./” CHANGE TO “..//”
● ”../” CHANGE TO “….//”
● ”/” CHANGE TO “//”
Redirections Common Parameters or Injection
points
dest=
continue=
redirect=
url= (or anything with “url” in it)
uri= (same as above)
window=
next=
50
Remote file includes and redirects
RFI Common Parameters or Injection points
File= document=
Folder= root=
Path= pg=
style= pdf=
template=
php_path=
doc=
51
CSRF
52
CSRF
Everyone knows CSRF but the TLDR
here is find sensitive functions and
attempt to CSRF.
Burps CSRF PoC is fast and easy for
this:
53
CSRF
Many sites will have CSRF protection, focus on CSRF bypass!
Common bypasses:
● Remove CSRF token from request
● Remove CSRF token parameter value
● Add bad control chars to CSRF parameter value
● Use a second identical CSRF param
● Change POST to GET
Check this out...
54
CSRF
Debasish Mandal wrote a python tool to automate finding CSRF bypasses called
Burpy.
Step 1: Enable logging in Burp. Crawl a site with Burp completely executing all
functions.
Step 2: Create a template...
55
56
57
58
CSRF
Or focus on pages without the token in Burp:
https://github.
com/arvinddoraiswamy/mywebappscripts/blob/master/BurpExtensions/csrf_token_d
etect.py
59
CSRF
CSRF Common Critical functions
Add / Upload file Password change
Email change Transfer Money /
Currency
Delete File Profile edit
60
Privilege, Transport, Logic
61
Privilege
Often logic, priv, auth bugs are blurred.
Testing user priv:
1. admin has power
2. peon has none
3. peon can use function only meant for
admin
62
Privilege
1. Find site functionality that is restricted to certain
user types
2. Try accessing those functions with lesser/other
user roles
3. Try to directly browse to views with sensitive
information as a lesser priv user
Autorize Burp plugin is pretty neat here...
https://github.com/Quitten/Autorize
Common Functions or Views
Add user function
Delete user function
start project / campaign / etc function
change account info (pass, CC, etc) function
customer analytics view
payment processing view
any view with PII
63
1. Browse using high priv user
2. Login with a lower priv user
3. Burp Plugin re-requests to see if low priv can access high priv
64
Insecure direct object references
IDORs are common place in bounties, and hard
to catch with scanners.
Find any and all UIDs
● increment
● decrement
● negative values
● Attempt to perform sensitive functions
substituting another UID
○ change password
○ forgot password
○ admin only functions
65
Idor’s
Common Functions , Views, or Files
Everything from the CSRF Table, trying cross account attacks
Sub: UIDs, user hashes, or emails
Images that are non-public
Receipts
Private Files (pdfs, ++)
Shipping info & Purchase Orders
Sending / Deleting messages
66
67
Transport
Most security concerned sites will enable HTTPs. It’s
your job to ensure they’ve done it EVERYWHERE. Most
of the time they miss something.
Examples:
● Sensitive images transported over HTTP
● Analytics with session data / PII leaked over HTTP
68
Transport
https://github.com/arvinddoraiswamy/mywebappscripts/tree/master/ForceSSL
69
Logic
Logic flaws that are tricky, mostly manual:
● substituting hashed parameters
● step manipulation
● use negatives in quantities
● authentication bypass
● application level DoS
● Timing attacks
70
Mobile
71
Data Storage
Its common to see mobile apps not applying
encryption to the files that store PII. Common places to find PII unencrypted
Phone system logs (avail to all apps)
webkit cache (cache.db)
plists, dbs, etc
hardcoded in the binary
72
Quick spin-up for iOS
Daniel Mayers idb tool:
73
Logs!
74
Auxiliary
75
The vulns formerly known as “noise”
● Content Spoofing or HTML injection
● Referer leakage
● security headers
● path disclosure
● clickjacking
● ++
76
How to test a web app in n minutes
How can you get maximum results within a
given time window?
77
Data Driven Assessment (diminishing return FTW)
1. Visit the search, registration, contact, password reset, and comment
forms and hit them with your polyglot strings
2. Scan those specific functions with Burp’s built-in scanner
3. Check your cookie, log out, check cookie, log in, check cookie. Submit old
cookie, see if access.
4. Perform user enumeration checks on login, registration, and password
reset.
5. Do a reset and see if; the password comes plaintext, uses a URL based
token, is predictable, can be used multiple times, or logs you in
automatically
6. Find numeric account identifiers anywhere in URLs and rotate them for
context change
7. Find the security-sensitive function(s) or files and see if vulnerable to
non-auth browsing (idors), lower-auth browsing, CSRF, CSRF protection
bypass, and see if they can be done over HTTP.
8. Directory brute for top short list on SecLists
9. Check upload functions for alternate file types that can execute code (xss
or php/etc/etc)
~ 15 minutes
78
Things to take with you…
1. Crowdsourced testing is different enough to pay attention to
2. Crowdsourcing focuses on the 20% because the 80% goes quick
3. Data analysis can yield the most successfully attacked areas
4. A 15 minute web test, done right, could yield a majority of your critical vulns
5. Add polyglots to your toolbelt
6. Use SecLists to power your scanners
7. Remember to periodically refresh your game with the wisdom of other techniques and
other approaches
Follow these ninjas who I profiled: https://twitter.com/Jhaddix/lists/bninjas
79
Gitbook project: The Bug Hunters Methodology
This preso ended up to be way too much to fit in an 45min talk so... we turned it into a Git
project! (if you are reading this from the Defcon DVD check my twitter or Github for linkage)
● 50% of research still unparsed
● More tooling to automate
● XXE and parser attacks
● SSRF
● Captcha bypass
● Detailed logic flaws
● More mobile
80
Meme Count:
13
81
Attribution and Thanks
82
Tim Tomes - Recon-ng
Joe Giron - RFI params
Soroush Dalili - File in the Hole preso
Mathias Karlsson - polyglot research
Ashar Javed - polyglot/xss research
Ryan Dewhurst & Wpscan Team
Bitquark - for being a ninja, bsqli string
rotlogix - liffy LFI scanner
Arvind Doraiswamy - HTTPs, CSRF Burp Plugins
Barak Tawily - Autorize burp plugin
the RAFT list authors
Ferruh Mavituna - SVNDigger
Jaime Filson aka wick2o - GitDigger
Robert Hansen aka rsnake - polyglot / xss
Dan Crowley - polyglot research
Daniel Miessler - methodology, slide, and data contributions
My awesome team at Bugcrowd (Jon, Tod, Shpend, Ben, Grant, Fatih, Patrik, Kati, Kym, Abby, Casey, Chris, Sam, ++)
All the bug hunting community!!!

More Related Content

PPTX
Web Hacking With Burp Suite 101
PPTX
Waf bypassing Techniques
PDF
XSS Magic tricks
PDF
Burp suite
PPT
Pentesting Using Burp Suite
PPTX
Bug Bounty 101
PPTX
Burp Suite Starter
PDF
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
Web Hacking With Burp Suite 101
Waf bypassing Techniques
XSS Magic tricks
Burp suite
Pentesting Using Burp Suite
Bug Bounty 101
Burp Suite Starter
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016

What's hot (20)

PDF
Bug Bounty Hunter Methodology - Nullcon 2016
PPTX
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
PDF
Polyglot payloads in practice by avlidienbrunn at HackPra
PPTX
Attacking thru HTTP Host header
PPTX
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
PDF
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
PDF
Ekoparty 2017 - The Bug Hunter's Methodology
PPTX
XSS - Do you know EVERYTHING?
PPTX
Reverse proxies & Inconsistency
PDF
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
PDF
Building Advanced XSS Vectors
PDF
PPTX
Command injection
PPTX
Bug Bounty #Defconlucknow2016
PDF
Bug Bounty Basics
PDF
64 Methods for Mimikatz Execution
PDF
Secure Coding principles by example: Build Security In from the start - Carlo...
PDF
HTTP Request Smuggling via higher HTTP versions
PDF
Same Origin Method Execution (BlackHat EU2014)
Bug Bounty Hunter Methodology - Nullcon 2016
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
Polyglot payloads in practice by avlidienbrunn at HackPra
Attacking thru HTTP Host header
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
Ekoparty 2017 - The Bug Hunter's Methodology
XSS - Do you know EVERYTHING?
Reverse proxies & Inconsistency
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
Building Advanced XSS Vectors
Command injection
Bug Bounty #Defconlucknow2016
Bug Bounty Basics
64 Methods for Mimikatz Execution
Secure Coding principles by example: Build Security In from the start - Carlo...
HTTP Request Smuggling via higher HTTP versions
Same Origin Method Execution (BlackHat EU2014)
Ad

Similar to How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Description (20)

PDF
DEFCON 23 - Jason Haddix - how do i shot web
PPTX
Hacking WebApps for fun and profit : how to approach a target?
PDF
Web Application Security: Introduction to common classes of security flaws an...
PDF
Tw noche geek quito webappsec
PPT
Beyond Automated Testing - RVAsec 2016
PPT
BSidesDC 2016 Beyond Automated Testing
PDF
BugBounty Roadmap with Mohammed Adam
PPTX
Pentesting Tips: Beyond Automated Testing
PDF
Web Application Penetration Testing.pdf
PDF
Web Security - Introduction v.1.3
PDF
Web Security - Introduction
PPT
Andrew and Zac RVA-Beyond-Automated-Testing-2016.ppt
PPTX
Course_Presentation cyber --------------.pptx
PPTX
Attacking Web Applications
PDF
Common Web Application Attacks
PDF
Getting Inside Common Web Security Threats
PPTX
[FTP|SQL|Cache] Injections
PPTX
Burp Suite is a powerful and widely-used tool
PDF
The Web Application Hackers Toolchain
PDF
Burp suite
DEFCON 23 - Jason Haddix - how do i shot web
Hacking WebApps for fun and profit : how to approach a target?
Web Application Security: Introduction to common classes of security flaws an...
Tw noche geek quito webappsec
Beyond Automated Testing - RVAsec 2016
BSidesDC 2016 Beyond Automated Testing
BugBounty Roadmap with Mohammed Adam
Pentesting Tips: Beyond Automated Testing
Web Application Penetration Testing.pdf
Web Security - Introduction v.1.3
Web Security - Introduction
Andrew and Zac RVA-Beyond-Automated-Testing-2016.ppt
Course_Presentation cyber --------------.pptx
Attacking Web Applications
Common Web Application Attacks
Getting Inside Common Web Security Threats
[FTP|SQL|Cache] Injections
Burp Suite is a powerful and widely-used tool
The Web Application Hackers Toolchain
Burp suite
Ad

More from bugcrowd (19)

PDF
Bug Bounties, Ransomware, and Other Cyber Hype for Legal Counsel
PPTX
3 Reasons to Swap Your Next Pen Test With a Bug Bounty Program
PPTX
7 Bug Bounty Myths, BUSTED
PDF
If You Can't Beat 'Em, Join 'Em (AppSecUSA)
PPTX
AppSecUSA 2016: 'Your License for Bug Hunting Season'
PDF
Bug Bounty Tipping Point: Strength in Numbers
PDF
[Webinar] Building a Product Security Incident Response Team: Learnings from ...
PDF
If You Can't Beat 'Em, Join 'Em
PDF
Writing vuln reports that maximize payouts - Nullcon 2016
PDF
Revitalizing Product Securtiy at Zephyr Health
PPTX
HI THIS IS URGENT PLZ FIX ASAP: Critical Vunlerabilities and Bug Bounty Programs
PPTX
How Portal Can Change Your Security Forever - Kati Rodzon at BSidesLV
PDF
4 Reasons to Crowdsource Your Pen Test
PDF
Mobile Application Security Threats through the Eyes of the Attacker
PPTX
Build or Buy: The Barracuda Bug Bounty Story [Webinar]
PDF
5 Tips to Successfully Running a Bug Bounty Program
PDF
[Webinar] The Art & Value of Bug Bounty Programs
PDF
Key Takeaways from Instructure's Successful Bug Bounty Program
PDF
How to run a kick ass bug bounty program - Node Summit 2013
Bug Bounties, Ransomware, and Other Cyber Hype for Legal Counsel
3 Reasons to Swap Your Next Pen Test With a Bug Bounty Program
7 Bug Bounty Myths, BUSTED
If You Can't Beat 'Em, Join 'Em (AppSecUSA)
AppSecUSA 2016: 'Your License for Bug Hunting Season'
Bug Bounty Tipping Point: Strength in Numbers
[Webinar] Building a Product Security Incident Response Team: Learnings from ...
If You Can't Beat 'Em, Join 'Em
Writing vuln reports that maximize payouts - Nullcon 2016
Revitalizing Product Securtiy at Zephyr Health
HI THIS IS URGENT PLZ FIX ASAP: Critical Vunlerabilities and Bug Bounty Programs
How Portal Can Change Your Security Forever - Kati Rodzon at BSidesLV
4 Reasons to Crowdsource Your Pen Test
Mobile Application Security Threats through the Eyes of the Attacker
Build or Buy: The Barracuda Bug Bounty Story [Webinar]
5 Tips to Successfully Running a Bug Bounty Program
[Webinar] The Art & Value of Bug Bounty Programs
Key Takeaways from Instructure's Successful Bug Bounty Program
How to run a kick ass bug bounty program - Node Summit 2013

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
A Presentation on Artificial Intelligence
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
Teaching material agriculture food technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
KodekX | Application Modernization Development
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
A Presentation on Artificial Intelligence
“AI and Expert System Decision Support & Business Intelligence Systems”
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Spectral efficient network and resource selection model in 5G networks
Diabetes mellitus diagnosis method based random forest with bat algorithm
Teaching material agriculture food technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Network Security Unit 5.pdf for BCA BBA.
20250228 LYD VKU AI Blended-Learning.pptx
KodekX | Application Modernization Development
Reach Out and Touch Someone: Haptics and Empathic Computing
Chapter 3 Spatial Domain Image Processing.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation_ Review paper, used for researhc scholars

How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Description

  • 1. 1 How To Shot Web (Better hacking in 2015)
  • 2. 2 Jason Haddix ● Bugcrowd ● Director of Technical Ops ● Hacker & Bug hunter ● #1 on all-time leaderboard bugcrowd 2014 whoami @jhaddix
  • 3. 3 Hack Stuff Better (and practically) What this talk’s about... And…LOTS of memes…. only some are funny
  • 4. 4 Step 1: Cut a hole in a box... j/k Step 1: Started with my bug hunting methodology Step 2: Parsed some of the top bug hunters’ research (web/mobile only for now) Step 3: Create kickass preso Topics? BB philosophy shifts, discovery techniques, mapping methodology, parameters oft attacked, useful fuzz strings, bypass or filter evasion techniques, new/awesome tooling More Specifically
  • 6. 6 Differences from standard testing Single-sourced Crowdsourced ● looking mostly for common-ish vulns ● not competing with others ● incentivized for count ● payment based on sniff test ● looking for vulns that aren’t as easy to find ● racing vs. time ● competitive vs. others ● incentivized to find unique bugs ● payment based on impact not number of findings
  • 9. 9 Find the road less traveled ^ means find the application (or parts of an application) less tested. 1. *.acme.com scope is your friend 2. Find domains via Google (and others!) a. Can be automated well via recon-ng and other tools. 3. Port scan for obscure web servers or services (on all domains) 4. Find acquisitions and the bounty acquisition rules a. Google has a 6 month rule 5. Functionality changes or re-designs 6. Mobile websites 7. New mobile app versions
  • 10. 10 Tool: Recon-ng script (enumall.sh) https://github.com/jhaddix/domain
  • 11. 11
  • 14. 14
  • 16. 16 Port scanning is not just for Netpen! A full port scan of all your new found targets will usually yield #win: ● separate webapps ● extraneous services ● Facebook had Jenkins Script console with no auth ● IIS.net had rdp open vulnerable to MS12_020 nmap -sS -A -PN -p- --script=http-title dontscanme.bro ^ syn scan, OS + service fingerprint, no ping, all ports, http titles Port Scanning!
  • 18. 18 Mapping tips ● Google ● *Smart* Directory Brute Forcing ● RAFT lists (included in Seclists) ● SVN Digger (included in Seclists) ● Git Digger ● Platform Identification: ● Wapplyzer (Chrome) ● Builtwith (Chrome) ● retire.js (cmd-line or Burp) ● Check CVE’s ● Auxiliary ● WPScan ● CMSmap
  • 19. 19 Directory Bruteforce Workflow After bruteforcing look for other status codes indicating you are denied or require auth then append list there to test for misconfigured access control. Example: GET http://www.acme.com - 200 GET http://www.acme.com/backlog/ - 404 GET http://www.acme.com/controlpanel/ - 401 hmm.. ok GET http://www.acme.com/controlpanel/[bruteforce here now]
  • 20. 20 Mapping/Vuln Discovery using OSINT Find previous/existing problem: ● Xssed.com ● Reddit XSS - /r/xss ● Punkspider ● xss.cx ● xssposed.org ● twitter searching ● ++ Issues might already reported but use the flaw area and injection type to guide you to further injections or filter bypass.
  • 21. 21 New Project: Maps New OSINT/Mapping project ● 250+ bounty programs ● Crawl ● DNS info + bruteforce ● Bounty metadata (links, rewards, scope) ● API -> Intrigue http://github.com/bugcrowdlabs/maps
  • 22. 22
  • 23. 23 Using the Maps Project: Crawling Using + Ruby + Anemone + JSON + Grep $cat test_target_json.txt | grep redirect https://test_target/redirect/?url=http://twitter.com/... https://test_target/redirect/?url=http://facebook.com/... https://test_target/redirect/?url=http://pinterest.com/...
  • 24. 24 New Tool: Intrigue OSINT framework, simple to integrate. Features like: ● DNS Subdomain Brute force ● Web Spider ● Nmap Scan ● etc Code @ http://github.com/intrigueio/intrigue-core
  • 25. 25
  • 26. 26
  • 28. 28 Auth (better be quick) Auth Related (more in logic, priv, and transport sections) ● User/pass discrepancy flaw ● Registration page harvesting ● Login page harvesting ● Password reset page harvesting ● No account lockout ● Weak password policy ● Password not required for account updates ● Password reset tokens (no expiry or re-use)
  • 29. 29 Session (better be quick) Session Related ● Failure to invalidate old cookies ● No new cookies on login/logout/timeout ● Never ending cookie length ● Multiple sessions allowed ● Easily reversible cookie (base64 most often)
  • 31. 31 XSS Core Idea: Does the page functionality display something to the users? For time sensitive testing the 80/20 rule applies. Many testers use Polyglot payloads. You probably have too!
  • 33. 33 XSS '">><marquee><img src=x onerror=confirm(1)></marquee>" ></plaintext></|><plaintext/onmouseover=prompt(1) ><script>prompt(1)</script>@gmail.com<isindex formaction=javascript:alert(/XSS/) type=submit>'-->" ></script><script>alert(1)</script>"><img/id="confirm&lpar; 1)"/alt="/"src="/"onerror=eval(id&%23x29;>'"><img src="http: //i.imgur.com/P8mL8.jpg"> Multi-context, filter bypass based polyglot payload #2 (Ashar Javed XSS Research)
  • 34. 34 XSS “ onclick=alert(1)//<button ‘ onclick=alert(1)//> */ alert(1)// Multi-context polyglot payload (Mathias Karlsson)
  • 35. 35 Other XSS Observations Input Vectors Customizable Themes & Profiles via CSS Event or meeting names URI based Imported from a 3rd party (think Facebook integration) JSON POST Values (check returning content type) File Upload names Uploaded files (swf, HTML, ++) Custom Error pages fake params - ?realparam=1&foo=bar’+alert(/XSS/)+’ Login and Forgot password forms
  • 36. 36 SWF Parameter XSS Common Params: Common Params: onload, allowedDomain, movieplayer, xmlPath, eventhandler, callback (more on OWASP page) Common Injection Strings: %22})))}catch(e){alert(document.domain);}// "]);}catch(e){}if(!self.a)self.a=!alert(document.domain);// "a")(({type:"ready"}));}catch(e){alert(1)}//
  • 39. 39 SQL Injection Core Idea: Does the page look like it might need to call on stored data? There exist some SQLi polyglots, i.e; SLEEP(1) /*‘ or SLEEP(1) or ‘“ or SLEEP(1) or “*/ Works in single quote context, works in double quote context, works in “straight into query” context! (Mathias Karlsson)
  • 40. 40 SQL Injection You can also leverage the large database of fuzzlists from Seclists here:
  • 41. 41 SQL Injection Observations Blind is predominant, Error based is highly unlikely. ‘%2Bbenchmark(3200,SHA1(1))%2B’ ‘+BENCHMARK(40000000,SHA1(1337))+’ SQLMap is king! ● Use -l to parse a Burp log file. ● Use Tamper Scripts for blacklists. ● SQLiPy Burp plugin works well to instrument SQLmap quickly. Lots of injection in web services! Common Parameters or Injection points ID Currency Values Item number values sorting parameters (i.e order, sort, etc) JSON and XML values Cookie values (really?) Custom headers (look for possible integrations with CDN’s or WAF’s) REST based Services
  • 43. 43 Best SQL injection resources DBMS Specific Resources mySQL PentestMonkey's mySQL injection cheat sheet Reiners mySQL injection Filter Evasion Cheatsheet MSSQL EvilSQL's Error/Union/Blind MSSQL Cheatsheet PentestMonkey's MSSQL SQLi injection Cheat Sheet ORACLE PentestMonkey's Oracle SQLi Cheatsheet POSTGRESQL PentestMonkey's Postgres SQLi Cheatsheet Others Access SQLi Cheatsheet PentestMonkey's Ingres SQL Injection Cheat Sheet pentestmonkey's DB2 SQL Injection Cheat Sheet pentestmonkey's Informix SQL Injection Cheat Sheet SQLite3 Injection Cheat sheet Ruby on Rails (Active Record) SQL Injection Guide
  • 44. 44 Tactical Fuzzing - FI & Uploads
  • 45. 45 Local file inclusion Core Idea: Does it (or can it) interact with the server file system? Liffy is new and cool here but you can also use Seclists: Common Parameters or Injection points file= location= locale= path= display= load= read= retrieve=
  • 46. 46 Malicious File Upload ++ This is an important and common attack vector in this type of testing A file upload functions need a lot of protections to be adequately secure. Attacks: ● Upload unexpected file format to achieve code exec (swf, html, php, php3, aspx, ++) Web shells or... ● Execute XSS via same types of files. Images as well! ● Attack the parser to DoS the site or XSS via storing payloads in metadata or file header ● Bypass security zones and store malware on target site via file polyglots
  • 47. 47 Malicious File Upload ++ File upload attacks are a whole presentation. Try this one to get a feel for bypass techniques: ● content type spoofing ● extension trickery ● File in the hole! presentaion - http://goo.gl/VCXPh6
  • 48. 48 Malicious File Upload ++ As referenced file polyglots can be used to store malware on servers! See @dan_crowley ‘s talk: http://goo. gl/pquXC2 and @angealbertini research: corkami. com
  • 49. 49 Remote file includes and redirects Look for any param with another web address in it. Same params from LFI can present here too. Common blacklist bypasses: ● escape  "/" with "/" or “//” with “//” ● try single "/" instead of "//" ● remove http i.e. "continue=//google.com" ● “//” , “|/” , “/%09/” ● encode, slashes ● ”./” CHANGE TO “..//” ● ”../” CHANGE TO “….//” ● ”/” CHANGE TO “//” Redirections Common Parameters or Injection points dest= continue= redirect= url= (or anything with “url” in it) uri= (same as above) window= next=
  • 50. 50 Remote file includes and redirects RFI Common Parameters or Injection points File= document= Folder= root= Path= pg= style= pdf= template= php_path= doc=
  • 52. 52 CSRF Everyone knows CSRF but the TLDR here is find sensitive functions and attempt to CSRF. Burps CSRF PoC is fast and easy for this:
  • 53. 53 CSRF Many sites will have CSRF protection, focus on CSRF bypass! Common bypasses: ● Remove CSRF token from request ● Remove CSRF token parameter value ● Add bad control chars to CSRF parameter value ● Use a second identical CSRF param ● Change POST to GET Check this out...
  • 54. 54 CSRF Debasish Mandal wrote a python tool to automate finding CSRF bypasses called Burpy. Step 1: Enable logging in Burp. Crawl a site with Burp completely executing all functions. Step 2: Create a template...
  • 55. 55
  • 56. 56
  • 57. 57
  • 58. 58 CSRF Or focus on pages without the token in Burp: https://github. com/arvinddoraiswamy/mywebappscripts/blob/master/BurpExtensions/csrf_token_d etect.py
  • 59. 59 CSRF CSRF Common Critical functions Add / Upload file Password change Email change Transfer Money / Currency Delete File Profile edit
  • 61. 61 Privilege Often logic, priv, auth bugs are blurred. Testing user priv: 1. admin has power 2. peon has none 3. peon can use function only meant for admin
  • 62. 62 Privilege 1. Find site functionality that is restricted to certain user types 2. Try accessing those functions with lesser/other user roles 3. Try to directly browse to views with sensitive information as a lesser priv user Autorize Burp plugin is pretty neat here... https://github.com/Quitten/Autorize Common Functions or Views Add user function Delete user function start project / campaign / etc function change account info (pass, CC, etc) function customer analytics view payment processing view any view with PII
  • 63. 63 1. Browse using high priv user 2. Login with a lower priv user 3. Burp Plugin re-requests to see if low priv can access high priv
  • 64. 64 Insecure direct object references IDORs are common place in bounties, and hard to catch with scanners. Find any and all UIDs ● increment ● decrement ● negative values ● Attempt to perform sensitive functions substituting another UID ○ change password ○ forgot password ○ admin only functions
  • 65. 65 Idor’s Common Functions , Views, or Files Everything from the CSRF Table, trying cross account attacks Sub: UIDs, user hashes, or emails Images that are non-public Receipts Private Files (pdfs, ++) Shipping info & Purchase Orders Sending / Deleting messages
  • 66. 66
  • 67. 67 Transport Most security concerned sites will enable HTTPs. It’s your job to ensure they’ve done it EVERYWHERE. Most of the time they miss something. Examples: ● Sensitive images transported over HTTP ● Analytics with session data / PII leaked over HTTP
  • 69. 69 Logic Logic flaws that are tricky, mostly manual: ● substituting hashed parameters ● step manipulation ● use negatives in quantities ● authentication bypass ● application level DoS ● Timing attacks
  • 71. 71 Data Storage Its common to see mobile apps not applying encryption to the files that store PII. Common places to find PII unencrypted Phone system logs (avail to all apps) webkit cache (cache.db) plists, dbs, etc hardcoded in the binary
  • 72. 72 Quick spin-up for iOS Daniel Mayers idb tool:
  • 75. 75 The vulns formerly known as “noise” ● Content Spoofing or HTML injection ● Referer leakage ● security headers ● path disclosure ● clickjacking ● ++
  • 76. 76 How to test a web app in n minutes How can you get maximum results within a given time window?
  • 77. 77 Data Driven Assessment (diminishing return FTW) 1. Visit the search, registration, contact, password reset, and comment forms and hit them with your polyglot strings 2. Scan those specific functions with Burp’s built-in scanner 3. Check your cookie, log out, check cookie, log in, check cookie. Submit old cookie, see if access. 4. Perform user enumeration checks on login, registration, and password reset. 5. Do a reset and see if; the password comes plaintext, uses a URL based token, is predictable, can be used multiple times, or logs you in automatically 6. Find numeric account identifiers anywhere in URLs and rotate them for context change 7. Find the security-sensitive function(s) or files and see if vulnerable to non-auth browsing (idors), lower-auth browsing, CSRF, CSRF protection bypass, and see if they can be done over HTTP. 8. Directory brute for top short list on SecLists 9. Check upload functions for alternate file types that can execute code (xss or php/etc/etc) ~ 15 minutes
  • 78. 78 Things to take with you… 1. Crowdsourced testing is different enough to pay attention to 2. Crowdsourcing focuses on the 20% because the 80% goes quick 3. Data analysis can yield the most successfully attacked areas 4. A 15 minute web test, done right, could yield a majority of your critical vulns 5. Add polyglots to your toolbelt 6. Use SecLists to power your scanners 7. Remember to periodically refresh your game with the wisdom of other techniques and other approaches Follow these ninjas who I profiled: https://twitter.com/Jhaddix/lists/bninjas
  • 79. 79 Gitbook project: The Bug Hunters Methodology This preso ended up to be way too much to fit in an 45min talk so... we turned it into a Git project! (if you are reading this from the Defcon DVD check my twitter or Github for linkage) ● 50% of research still unparsed ● More tooling to automate ● XXE and parser attacks ● SSRF ● Captcha bypass ● Detailed logic flaws ● More mobile
  • 82. 82 Tim Tomes - Recon-ng Joe Giron - RFI params Soroush Dalili - File in the Hole preso Mathias Karlsson - polyglot research Ashar Javed - polyglot/xss research Ryan Dewhurst & Wpscan Team Bitquark - for being a ninja, bsqli string rotlogix - liffy LFI scanner Arvind Doraiswamy - HTTPs, CSRF Burp Plugins Barak Tawily - Autorize burp plugin the RAFT list authors Ferruh Mavituna - SVNDigger Jaime Filson aka wick2o - GitDigger Robert Hansen aka rsnake - polyglot / xss Dan Crowley - polyglot research Daniel Miessler - methodology, slide, and data contributions My awesome team at Bugcrowd (Jon, Tod, Shpend, Ben, Grant, Fatih, Patrik, Kati, Kym, Abby, Casey, Chris, Sam, ++) All the bug hunting community!!!