BH DC 07 Sutton Up
BH DC 07 Sutton Up
BH DC 07 Sutton Up
• Background
– Vulnerability discovery methodologies
– What is fuzzing?
• Web application fuzzing
– Challenges
– Inputs
– Detection
• Web 2.0 fuzzing
• Fuzzing with Google
• Conclusions
class HelloWorld
• Internal perspective {
public static int Main(String[] args)
{
Blackbox Testing
• External perspective
• Run-time analysis
• Manual or automated testing
– Known vulnerabilities
– Unknown vulnerabilities
Security
Source Code Analysis Binary Auditing Fuzzing
Audit
Automate Automate Automate
Manual Manual Manual
d d d
Code
Coverage
Speed
False
Positives
False
Negatives
Complex
Vulns.
Verdict - There is no silver bullet.
Identify
Target
Identify
Inputs
Generate
Fuzzed Data
Execute
Fuzzed Data
Monitor for
Exceptions
Determine
Exploitability
Availability of tools
Protocol structure
Identifying inputs
Detecting exceptions
Code coverage
• Multi-layered technology
– Web server, application server, database server, etc.
• Where does the vulnerability lie?
• Network latency
– Network creates a bottle neck
• How can we speed up the process?
• Exception detection
– Numerous signals must be monitored/reviewed
• Did we miss anything?
• Code coverage
– Tracking business logic reached
• How do we know when to stop?
• Request-URI
– /[path]/[page].[extension]?[name]=[value]& [name]=[value]
• Protocol
– HTTP/[major]. [minor]
• Headers
– [Header name]: [Header value]
• Post Data
– [Name1]=[Value1]&[Name2]=[Value2]
• Cookies Think Outside the Box
– Cookie: [Name1]=[Value1]; [Name2]=[Value2] ...
/[path]/[page].[extension]?[name]=[value]& [name]=[value]
• Path
– Path traversal
• Page
– Predictable resource location
– Directory indexing
– Information leakage
• Extension
– Web filter bypass
– DoS
• Name
– Abuse of functionality (hidden functionality)
• Value
– SQL injection, XSS, file inclusion, command injection, etc.
• Separator
– Content spoofing (URI obfuscation)
HTTP/[major]. [minor]
• Fuzz variables
– Unsupported protocol version
• HTTP 1.1 (RFC 2616)
• HTTP 1.0 (RFC 1945)
• HTTP 0.9 (Deprecated)
– Non-RFC compliant values
• HTTP X.Y
• HTTP 2.2
• AAAAA
• Proxy issues
– Request may altered/blocked by ‘non-transparent’ proxies
• RFC 2145 - Use and Interpretation of HTTP Version Numbers
[Name1]=[Value1]&[Name2]=[Value2]
• Name
– Abuse of functionality (hidden functionality)
• Value
– SQL injection
– XSS
– File inclusion
– Command injection
– Buffer Overflows
• Open Source
– WebFuzz
• michaelsutton.net/download/WebFuzz.zip
– SPIKE Proxy
• www.immunitysec.com/resources-freesoftware.shtml
– OWASP WebScarab
• www.owasp.org/index.php/Category:OWASP_WebScarab_Project
• Commercial
– SPI Fuzzer
• Included with SPIDynamics WebInspect
Fuzzing.org
• Inputs
– XML parsing and generation
– Documented vs. undocumented
• WSDL (Web Services Description Language)
• Targets
– UDDI (Universal Description, Discovery and Integration)
• OASIS
– DISCO (Discovery of Web Services)
• Microsoft
• Protocol
– SOAP
• exchanging XML-based messages over HTTP
• Identify Targets
Identify
– UDDI
Targets
– DISCO
Identify
– Etc. Input
• Identify Inputs - WSDL Generate
– Blueprint for expected inputs Fuzzed Data
• Data types (i.e. integer) Execute
• Data ranges (i.e. 1-1000) Fuzzed Data
– Facilitates intelligent fuzzing Monitor for
• Generate fuzz variables outside of expected Exceptions
inputs
Determine
Exploitability
http://api.google.com/GoogleSearch.wsdl
<message name="doGoogleSearch">
<part name="key" type="xsd:string"/>
<part name="q" type="xsd:string"/>
<part name="start" type="xsd:int"/>
<part name="maxResults" type="xsd:int"/>
<part name="filter" type="xsd:boolean"/>
<part name="restrict" type="xsd:string"/>
<part name="safeSearch" type="xsd:boolean"/>
<part name="lr" type="xsd:string"/>
<part name="ie" type="xsd:string"/>
<part name="oe" type="xsd:string"/>
</message>
...
<service name="GoogleSearchService">
<port name="GoogleSearchPort" binding="typens:GoogleSearchBinding">
<soap:address location="http://api.google.com/search/beta2"/>
</port>
</service>
• Open Source
– OWASP WSFuzzer
• http://www.neurofuzz.com/modules/software/wsfuzzer.php
• Commercial
– SPI Dynamics WebInspect
• Multiple frameworks
– Prototype (http://www.prototypejs.org/)
– Script.aculo.us
– Dojo (http://dojotoolkit.org/)
– ASP.Net AJAX (http://ajax.asp.net/)
– Etc.
• Multiple browser objects
– Internet Explorer
• IE6 - XMLHTTP ActiveX control
• IE7 – XMLHTTP native script object
– Firefox
• XMLHttpRequest object
• Script page
BlinkList XMLHttpRequests
• Verbose SQL errors
– Multiple
• XSS
• Exposed functionality
– Web based email
• Directory browsing
Fuzzing
Using
Google
F u g g le
T
M
Gets
Low hanging fruit
Easily
A Russian hackers broke into a Rhode Island government Web site and
allegedly stole credit card data from individuals who have done business online
with state agencies.
The story was first reported by The Providence Journal this morning and comes
two days after state and local government officials released national surveys
indicating they need more cybersecurity guidance and help in strengthening
their systems.
Identify
Target
Identify
Inputs
Generate
Fuzzed Data
Execute
Fuzzed Data
Monitor for
Exceptions
Determine
Exploitability
Fuggle
Focus on input Focus on output
e.g. URI parameters e.g. page content
Identifying targets for further testing Identifying pages using vulnerable
3rd party apps or leaking
confidential information
Flexible search terms Fixed signature based searches
e.g. inurl:"id=10" e.g. intitle:index.of "parent
directory"
Custom vulnerabilities Known vulnerabilities
• Vulnerabilities
– Input vectors must be indexed by Google and accessible via
search operators
Title
Displayed page content
URI
Request/response headers
Page source code
– Effectively limits using Fuggle to pages using GET method
• Input vectors indexed in URL
• Input
– User supplied values concatenated into
SQL queries
www.example.com?id=10
• Goal
– Identify pages with verbose SQL errors
• Search Term
– inurl:"id=10"
• Targets
– Retail stores
• E.g. Product catalog
– Informational sites
• E.g. News archive
• Search results
– Results 1 - 10 of about 2,010,000 for
inurl:"id=10". (0.05 seconds)
• Cleanse results
– Remove URLs w/out “id=10”
– Remove duplicate results form single domain
• Goal
– Identify pages with verbose SQL
errors
• Fuzz data
– id=‘10"
– Blind SQL injection
• id=10 OR 1=1
– Comment remainder of query
• id=‘10--
– Encode query
• id=%2710
• Submit queries
• Capture responses
– Raw response
• Headers
• HTML source code
– HTML Status codes
• Associate requests with
responses
• Archive for automated and
manual review
• Input
– User supplied values echoed back in
displayed web page
www.example.com?user=joe
• Goal
– Identify pages which display unfiltered user
input
• Search Terms
– inurl:"search=xxx" intext:"search results for xxx"
– inurl:"query=xxx" intext:"search results for xxx"
– inurl:"q=xxx" intext:"search results for xxx"
• Targets
– Search pages
• Blogs
• Video sharing
• News
• Search results
– Typically < 1000
– Numerous duplicate sites
• Cleanse results
– Remove URLs w/out "search|query|q=xxx"
– Remove duplicate results form single domain
• Goal
– Identify pages echoing unfiltered user
input in responses
• Fuzz data
– Client side script
• JavaScript, VBScript, EMCA
Script, HTML, etc.
– Encoded data
• URL encoding
• Hexadecimal encoding
• Unicode encoding
• US-ASCII
• Etc.
• Fuzz Variable
– IMG tag
• Non existent page on local
web server
• Detection
– Allows implicit ‘phone home’
capability
– Log entry = vulnerable web page
– HTML likely to evade ineffective
input filters
• Reflected XSS
– DOM based content spoofing in phishing
attacks
– Stealing session credentials and
confidential data
• Persistent XSS
– Web based worm propagation
• October 4, 2005 – MySpace Samy worm
Training
& Fuzzing Tools
Education
• Tools
– Frameworks
– Integrated test environments
– Commercial tools
• People
– Wider audience
– Proactive fuzzing – the shift from offense to defense
Michael Sutton
Security Evangelist
SPI Dynamics
http://portal.spidynamics.com/blogs/msutton