Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
CNT 5410 - Computer and Network Security: Web Security
Professor Kevin Butler Fall 2015
CNT 5410 - Computer and Network Security: Web Security Professor - - PowerPoint PPT Presentation
CNT 5410 - Computer and Network Security: Web Security Professor Kevin Butler Fall 2015 Southeastern Security for Enterprise and Infrastructure (SENSEI) Center Network vs. Web Security Southeastern Security for Enterprise and Infrastructure
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
Professor Kevin Butler Fall 2015
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
2
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
services used to distribute content
technology, …
3
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
confidentiality, and availability of content and user information is maintained
4
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
5
http://a.com/<img> http://c.com/ <img> http:// b.com/ <img>
Webpage
http:// d.com/ <IMG> http:// e.com/ <IMG> <body>
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
state to browsers
6
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
mistakes, committed attackers
Many security problems arise out of a technology built for one thing incorrectly applied to something else.
7
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
8
9
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
10
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
Client Server
11
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
Participants: Alice/A (client) and Bob/B (server) Crypto Elements : Random R, Certificate C, k+
i Public Key (of i)
Crypto Functions : Hash function H(x), Encryption E(k, d), Decryption D(k, d), Keyed MAC HMAC(k, d) 1. Alice → Bob RA 2. Bob → Alice RB, CB Alice pick pre-master secret S Alice calculate master secret K = H(S, RA, RB) 3. Alice → Bob E(k+
B, S), HMAC(K,0 CLNT 0 + [#1, #2])
Bob recover pre-master secret S = D(k
B, E(k+ B, S))
Bob calculate master secret K = H(S, RA, RB) 4. Bob → Alice HMAC(K,0 SRV R0 + [#1, #2]) Note: Alice and Bob : IV Keys, Encryption Keys, and Integrity Keys 6 keys,where each key ki = gi(K, RA, RB), and gi is key generator function.
12
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center 13
13
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center 14
(Never Called)
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
client applications, providing certificate handling.
15
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
memory
talking to are patched?
16
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
struct { HeartbeatMessageType type; uint16 payload_length;
} HeartbeatMessage;
17
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
2412 /* Read type and payload length first */ 2413 hbtype = *p++; 2414 n2s(p, payload); 2415 pl = p; 2416 2417 if (s->msg_callback) 2418 s->msg_callback(0, s->version, TLS1_RT_HEARTBEAT, 2419 &s->s3->rrec.data[0], s->s3->rrec.length, 2420 s, s->msg_callback_arg); 2421 2422 if (hbtype == TLS1_HB_REQUEST) 2423 { 2424 unsigned char *buffer, *bp; 2425 int r; 2426 2427 /* Allocate memory for the response, size is 1 bytes 2428 * message type, plus 2 bytes payload length, plus 2429 * payload, plus padding 2430 */ 2431 buffer = OPENSSL_malloc(1 + 2 + payload + padding); 2432 bp = buffer; 2433 2434 /* Enter response type, length and copy payload */ 2435 *bp++ = TLS1_HB_RESPONSE; 2436 s2n(payload, bp); 2437 memcpy(bp, pl, payload); 2438 2439 r = ssl3_write_bytes(s, TLS1_RT_HEARTBEAT, buffer, 3 + payload + padding);
18
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
/* Read type and payload length first */ + if (1 + 2 + 16 > s->s3->rrec.length) + return 0; /* silently discard */ + hbtype = *p++; + n2s(p, payload); + if (1 + 2 + payload + 16 > s->s3->rrec.length) + return 0; /* silently discard per RFC 6520 sec. 4 */ + pl = p;
19
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
20
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
server
Web Server Client Shell
Script (e.g., PHP, ASP, Perl, Python )
21
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
upon request and output returned in content
22
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
to process content
23
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
someone to install something on their own (spyware/adware)
their friends, …
knowledge or consent, and does its damage from there...
24
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
25
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
26
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
machine, but I worry about security
that you trust.
27
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
to sophisticated distributed application platform providing:
28
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
images, and stylized by cascading style sheets (CSS)
29
http://a.com/<Script> http://c.com/ <Script> http:// b.com/ <Script>
Webpage
http:// d.com/ <IMG> http:// e.com/ <IMG> <body> CCS-stylized
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
webpages to be interactive, change, etc.
30
Webpage
Banner Script Onclick Script Periodic Refresh Script
Web-server 1 Web-server 2 Web-server 3
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
frame in the content of another page.
attempting to delivery content that exploits browser vulnerabilities.
webserver and places a IFRAME in legitimate content
IFRAMEs
31
<iframe src=http://[REMOVED].info/counter style=display:none></iframe>
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
extension APIs to which developers can build ...
server
(URL, fields, etc.)
C code)
32 Web Server Domain App 1 Domain App 2 Domain App 3 Domain App 4 Domain App 5 Domain App 6 Domain App 7 Domain App 8
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
that implement a web application
the nasty details of HTTP/HTML
implements a web application by processing incoming URLs
renders them via internal API
such as JavaScript
33
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
34
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
message board on your favorite website: Hello message board. <SCRIPT>malicious code</SCRIPT> This is the end of my message.
content generator) uses the input to create a webpage (e.g., blogger nonsense).
35
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
36
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
than “<script>” to avoid filtering. Are there
<script>Hello</script>
in general?
37
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
control it in subtle ways
then you can run arbitrary code on the browser …
application, then you can manipulate the host
input or input URLS, e.g., hidden POST fields
38
$INPUT = “Alice\;mail($to, $subject, $body);” <FORM METHOD=POST ACTION="../cgi-bin/mycgi.pl"> <INPUT TYPE="hidden" VALUE="~/.profile" NAME="LOGFILE"> </FORM>
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
applications are
and costly in web history.
vulnerable to SQL injection in 2007
39
SELECT email, login, last_name FROM user_table WHERE email = 'x'; DROP TABLE members; --';
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
40
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
finding unsafe input code and (dynamic tools) to track the use of inputs within the web application lifetime.
41
$sql = "select * from some_table where some_col = ?"; $sth = $dbh->prepare( $sql ); $sth->execute( $input ); $sql = "select * from some_table where some_col = $input"; $sth = $dbh->prepare( $sql ); $sth->execute;
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
technique used to detect and prevent injection attacks
tracking)
“a = b + c” causes “a” to be tainted
looks for tainted input
42
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
url, then a malicious attacker can simply keep trying session IDs until gets a good one.
attacker has full control over that account.
that are tied to individual host address (see cookies)
43
http://www.mybank.com/loggedin?sessionid=11
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
44
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
we have to try other things ...
, Chrome
45
Process 1
http://a.com/<img> http://c.com/ <img> http:// b.com/ <img>
TAB 1
http:// d.com/ <IMG> http:// e.com/ <IMG> <body>
Process 2
http://a.com/<img> http://c.com/ <img> http:// b.com/ <img>
TAB 2
http:// d.com/ <IMG> http:// e.com/ <IMG> <body>
Process 3
http://a.com/<img> http://c.com/ <img> http:// b.com/ <img>
TAB 3
http:// d.com/ <IMG> http:// e.com/ <IMG> <body>
Main Browser Process
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
46
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
47
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
48
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
49
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
50
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
51
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
52
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
53
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
54
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
55
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
56
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
57
Southeastern Security for Enterprise and Infrastructure (SENSEI) Center
58