====== Developer/Security 542 Web App Penetration Testing and Ethical Hacking ======
March 7-12, 2011
Instructor: Kevin Johnson
* 5000 facebook accounts
* Has twin brother Keith
* Worked with Matt Carpener
* graduated H.S. 1991
Elluminate being used for video broadcast to about 30 remote students
Sponsers:
* Aruba Networks
* FireEye
* IBM
Quote from a tee shirt: I am a bomb Technician, if you see me running, try to keep up.
Breaks:
* 1030-1050
* 1500-1520
Lunch:
* 12-1330
Randy's Cell 250-7681
===== Day 1 The Attacker's View of the Web =====
==== Why the Web ..1.3 ====
Open Source Vulnerability Bulletin Board, OSVBB
==== Web App Pen Testing ..1.8 ====
Security Testing should be part of Job description
==== Web Site Server Architecture ..1.13 ====
==== The HTTP Protocol ..3.20 ====
HTTP/1.1 defined in RFC 2616
http://tools.ietf.org/rfc2616
original design considerations
http://www.w3.org/Protocols/DesignIssues.html
== Example HTTP Request ..1.22 ==
GET http://www.google.com HTTP/1.1
Accept: */*
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; NET CLR 1.1.4322; .NET CLR 2.0.50727) Paros/3.2.13
Host: www.google.com
Proxy-Connection: Keep-Alive
Cookie:PREF=ID=6aa36b...:LM=11198...:GM=1:S=CZy0...
Content-length:0
== User-Agent ..1.23 ==
Mozilla/4.0 - This signifies that the browser is compliant with the standards set by netscape
MSIE 7.0 - Internet Explorer 7.0 is the software type
Windows NT 5.1 - This browser is running on Windows XP
NET CLR 1.1.4322; .NET CLR 2.0.50727 - These two versions of the .NET client are supported
Paros/3.2.13 - added by Paros
* Windows NT 6.0 - Windows Vista; Windows server 2008
* Windows NT 5.2 - Windows Server 2003; Windows XP x64 Edition
* Windows NT 5.1 - Windows XP
* Windows NT 5.01 - Windows 2000, Service Pack 1 (SP1)
* Windows NT 5.0 - Windows 2000
* Windows NT 4.0 - Windows NT
* Win 9x 4.90 - Windows Millennium Edition (Windows Me)
* Windows 98 - Windows 98
* Windows 95 - Windows 95
* Windows CE - Windows CE
* McAffee dropp(ed) App Firewall if "scanalert" (is)was in the user agent field
== Origin Server ..1.25 ==
rfc2616
== Same Origin Policy ..1.26 ==
Prevents scripts from running code from another site.
== HTTP Request Methods ..1.31 ==
GET
POST
HEAD
TRACE
OPTIONS
CONNECT
PUT
DELETE
Check if OPTIONS is enabled - it is not necessary.
== HTTP Response Codes ..1.36 ==
* 1xx Informational
* 100 Continue
* 2xx Success
* 200 OK
* 3xx Redirection
* 302 Redirect
* 304 Not modified
* 4xx Client Error
* 401 Unauthorized
* 404 Not Found
* 5xx Server Error
* 500 Server Error
* 502 Bad Gateway
=== Exercise: Examining HTTP Requests and Responses ..1.38 ===
$ nc www.sec542.org 80
POST /form_auth/login.php HTTP/1.0
Content-Length: 42
user=testuser&pass=opensesame&button=Login
=== Client Authentication ..1.46 ===
* Basic ..1.49
* Digest ..1.51
* HTTP Client Certificate Authentication ..1.54
* Windows Integrated Authentication ..1.57
* Forms Based ..1.60
paros - as a simple proxy - a new fork is zap by owasp
examples use this for Authentication
=== Exercise: Client Authentication ..1.64 ===
cd /usr/bin/samurai/paros
java -jar paros.jar
=== Session Tracking ..1.74 ===
* Client Side vs. Server Side ..1.77
* Session ID
* Cookies ..1.78
* URL Encoding ..1.79
* Hidden form fields ..1.80
=== SSL ..1.82 ===
SSL v2, turn it off
=== Exercise: Analyzing SSL ..1.88 ===
* Wireshark on Web server
* import key to decrypt Data
==== Penetration Testing Types and Methods ..1.94 ====
* Black Box ..1.95
* Crystal Box ..1.96
* Grey Box ..1.97
==== Web App Pen Test Components ..1.102 ====
* Preparation ..1.103
* Mananging ..1.104
* Scope ..1.105
* Gathering Information ..1.106
* Rules of Engagement ..1.107
* Identifying Tester Traffic ..1.108
* Time ..1.109
* Communications Planning ..1.110
==== Reporting and Presenting Findings ..1.111 ====
- Executive summary ..1.114
- Introduction ..1.115
- Methodology ..1.116
- Findings - includes recommendations ..1.117
- Conclusions .. 1.118
Chris Dickerson - Just released a sample report
* twitter ID indi303
* exotic liability podcast
== Data Collection Tools ..1.120 ==
* CAL9000
* OWASP Project written in HTML and JavaScript that runs in browser
* Freemind
* mind mapping
* Wiki
==== Attack Methodology ..1.125 ====
* Reconnaissance ..1.127
* Begin with Zone Transfer
* Mapping ..1.130
* Spidering
* Burp
* w3af
* Discovery ..1.132
* finding issues, not exploiting them
* Exploitation ..1.133
* actually attacking flaws
==== Types of Flaws ..1.135 ====
* Information Leakage ..1.126
* Configuration Flaws ..1.137
* Bypass Flaws ..1.138
* Authentication bypass
* Authorization bypass
* File control bypass
* Front-end bypass
* Injection Flaws ..1.139
* Command injection
* Code Injection
* SQL Injection
* Cross Site Scripting (XSS)
* HTTP Response Splitting
* Cross Site Request Forgery (CSRF)
* targets the trust a site has in the user. For Example, performing bank transactions on the target's behalf.
==== JavaScript for Pen Testers ..1.140 ====
Inline HTML
as a script tag
as part of an HTML item
loaded from another document
Test index.html
Change to
Create a file called attack.js and put in it:
alert("Hello World!");
Test index.html
change attack.js to
function formChange() {
document.forms[1].action="http://www.sec542.org/"
document.forms[1].sushi.value="Toro"
}
In the index.html file: