+ All Categories
Home > Documents > Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and...

Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and...

Date post: 23-Dec-2015
Category:
Upload: gloria-snow
View: 217 times
Download: 2 times
Share this document with a friend
Popular Tags:
45
Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehats ec.com
Transcript
Page 1: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Windows Security 2002

BlackHat New Orleans

WhiteHat Security

“Web Application Security”and

“Presenting”

Jeremiah Grossman [email protected]

Page 2: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Topics

Web Application Security Landscape

Why is Web Application Security Important

Common Web Application Security Mistakes

Web Application Attack Methodologies

Page 3: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Web Application Security Landscape

Entertainment

Message BoardsWebMail

Guest BooksVoting Polls

E-Commerce

ShoppingAuctionsBanking

Stock Trading

Just Plain Crazy

PrintersPDA’s

Cell PhonesSystem

Configuration.NET/Passport

Page 4: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Web Application The Simple Definition

A web application or web service is a software application that is accessible using a web browser or HTTP(s) user agent.

Page 5: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Web Application The “EASIER” Definition

If it runs on port 80 or port 443, then is probably a web application.

Page 6: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.
Page 7: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.
Page 8: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.
Page 9: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Why is Web Application Security Important?

Easiest way to compromise hosts, networks and users. Widely deployed. No Logs! (POST Request payload) Incredibly hard to defend against or detect. Most don’t think of locking down web applications. Intrusion detection is a joke. Firewall? What firewall? I don’t see no firewall… Encrypted transport layer does nothing.

How much easier can it get!? Unicode.

Page 10: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Common Web Application Security Mistakes

Trusting Client-Side Data

Unescaped Special Characters

HTML Output Character Filtering

SUID

ActiveX/JavaScript Authentication

Lack of User Authentication before performing critical task.

Page 11: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Trusting Client-Side Data

DO NOT TRUST DO NOT TRUST CLIENT-SIDE DATA!!!CLIENT-SIDE DATA!!!Trusting client-side data is #1 cause of

vulnerabilities.

Identify all input parameters that trust client-side data.

Page 12: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Unescaped Special Characters

The Level of Trust :

Searches/Queries/Templates

Path:

http://foo.com/cgi?val=string&file=/html/name.db

Or better yet…

http://www.foo.com/cgi?string=root&file=../../../../../etc/passwd

Page 13: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Unescaped Special Characters

! @ $ % ^ & * ( ) -_ + ` ~ \ | [ ] { } ; : ' " ? / , . > <

Check for:Unescaped special characters

within input strings

Page 14: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

HTML Character Filtering

Proper handling of special characters

> => &gt;< => &lt;

" => &quot;& => &amp;

Null characters should all be removed. %00

Page 15: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

More mistakes…SUID (Does a web application really need root?)

Authentication mechanisms using technologies suchas JavaScript or ActiveX.

Lack of re-authenticating the user before issuing newpasswords or performing critical tasks.

Hosting of uncontrolled data on a protected domain.

Page 16: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

WhiteHat Arsenal

GUI Web-Based Interface Session Based Discovery Utilities Active Assessment Encoding/Decoding Reporting

Page 17: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Web Application Penetration

Methodologies

Information Gathering & Discovery

Input/Output Client-Side Data Manipulation

Page 18: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Information Gathering & Discovery

Spidering /Site Map

Identifiable Characteristics

Error and Response Codes

File / Application Enumeration

Page 19: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Spidering

Page 20: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Spidering/Site Crawling

Site Map Service Map Documentation Hidden Services CGI's and Forms Email addresses

Page 21: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Identifiable Characteristics

Comment LinesURL ExtensionsMeta TagsCookiesClient-Side scripting languages

Enormous wealth of information about process flows, debug command, system types and

configurations.

Page 22: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Error and Response Codes

HTTP Response HeadersServer: IBM/Apache 1.3.19

Cookie Characteristics

Error MessagesException Messages (Java / SQL)

404 Error Pages

Failed Login

Locked Account

Database or file non-existent

Page 23: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

File/Application EnumerationCommonly referred to as “forced browsing” or “CGI Scanning”.

Page 24: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

File/Application Enumeration

Sample FilesTemplate DirectoriesTemp or Backup files

Hidden FilesVulnerable CGIs

Page 25: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Common Directories

Page 26: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Common Log Files

Page 27: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Common Backup Files

Page 28: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Input/Output Client-Side Data Manipulation

URL Manipulation CGI Parameter Tampering HTTP Client-Header Injection

Filter/Intrusion Detection Evasion

Protocol/Method Manipulation

Overflows

Page 29: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Input Manipulation Parameter Tampering

"Twiddling Bits."

Cross-Site ScriptingFilter-Bypass ManipulationOS CommandsMeta CharactersPath/Directory TraversalHidden Form Field ManipulationHTTP Headers

Page 30: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Cross-Site ScriptingBad name given to a dangerous security issue

Attack targets the user of the system rather than the system itself.

Outside client-side languages executing within the users web environment with the same level of privilege as the hosted site.

Page 31: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Client-Side Scripting Languages

DHTML (HTML, XHTML, HTML x.0)Opens all the doors.

JavaScript (1.x) Browser/DOM ManipulationJava (Applets) Malicious AppletsVBScript Browser/DOM ManipulationFlash Dangerous Third-Party InteractivityActiveX Let me count the ways…XML/XSL Another Door OpenerCSS Browser/DOM Manipulation

Page 32: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

The Scenarios

Trick a user to re-login to a spoofed page

Compromise authentication credentials

Load dangerous of malicious ActiveX

Re-Direct a user or ALL users

Crash the machine or the browser

Page 33: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

CSS Danger“The Remote Launch Pad.”

Successfully CSS a user via a protected domain.

Utilizing a Client-Side utility (JavaScript, ActiveX,VBScript, etc.), exploit a browser hole to downloada trojan/virus.

User is unknowingly infected/compromised withina single HTTP page load.

ActiveX Netcat Anyone?

Page 34: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

2 Types of CSS Click on a link to activate

<A HREF=“http://www.evil_javascript_link”>Click Here</A>

Auto-Execute by viewing HTML

<SCRIPT>run evil JavaScript</SCRIPT>

Page 35: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Dangerous HTML“HTML Bad”

<APPLET> Malicious Java Applications<BODY> Altering HTML Page Characteristics<EMBED> Embedding Third-Party Applications (Flash, etc.)<FRAME> Directly calling in other uncontrolled HTML<FRAMESET> Directly calling in other uncontrolled HTML<HTML> Altering HTML Page Characteristics<IFRAME> Directly calling in other uncontrolled HTML<IMG> SCRing Protocol attacks and other abuses<LAYER> Directly calling in other uncontrolled HTML<ILAYER> Directly calling in other uncontrolled HTML<META> META Refreshes. (Client-Redirects)<OBJECT> ActiveX (Nuff Said)<SCRIPT> JavaScript/VBScript Loading<STYLE> Style Sheet and Scripting Alterations

Page 36: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Dangerous Attributes“Attributes Bad”

ATTRIBUTE DANGER LIST (Any HTML Tag that has these attributes)

STYLE SRC

HREF TYPE

Page 37: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Power of the Dots and Slashes

piping input to the command line.

Path Directory Traversalhttp://foo.com/app.cgi?directory=/path/to/data

DotDot Slash:http://foo.com/app.cgi?dir=path/to/data../../../../etc/passwd

Dot Slash:http://foo.com/app.cgi?dir=path/to/data../../../../etc/././passwd

Double DotDot Slash:http://foo.com/app.cgi?dir=path/to/data....//….//….//etc/passwd

Page 38: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

More Filter Bypassing

Method Alteration (HEAD, PUT, POST, GET, ect.)

URL Encodehttp://www.foo.com/cgi?value=%46%72%68%86

Null Charactershttp://www.foo.com/cgi?value=file%00.html

More…Alternate Case, Unicode, String Length, Multi-Slash, etc.

Page 39: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

More Filter Bypassing

Method Alteration (HEAD, PUT, POST, GET, ect.)

URL Encodehttp://www.foo.com/cgi?value=%46%72%68%86

Null Charactershttp://www.foo.com/cgi?value=file%00.html

More…Alternate Case, Unicode, String Length, Multi-Slash, etc.

Page 40: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Authentication & Session Management

Brute/Reverse Force

Session Hi-Jacking

Session Replay

Session Forgoing

Page Sequencing

Page 41: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Reporting

XML/HTML Based

Manual Hack Attack Log w/ Descriptor

Common Directory Force Browsing

Common Log File Force Browsing

Backup File Force Browsing

Spider Log

Page 42: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Spider XML Log

Page 43: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Attempts XML Log

Page 44: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

A few quick things to help secure a web application.

Do Not Trust Client-Side Data Escape and filter all input/output data Set-up parameter and request method allow lists. Don’t use what your not expecting to receive.

Page 45: Windows Security 2002 BlackHat New Orleans WhiteHat Security “Web Application Security” and “Presenting” Jeremiah Grossman jeremiah@whitehatsec.com.

Thank You!BlackHat and Attendees

Questions?Jeremiah Grossman

[email protected]

WhiteHat Security

All presentation updates will be available on

www.whitehatsec.com

and

community.whitehatsec.com


Recommended