Computer Security
Computer Security
Security
CS642:
Computer
Security
Professor
Ristenpart
h9p://www.cs.wisc.edu/~rist/
rist
at
cs
dot
wisc
dot
edu
Liberal
borrowing
from
Mitchell,
Boneh,
Stanford
CS
155
University
of
Wisconsin
CS
642
Announcements
HW3
should
be
posted
tonight
or
tomorrow
Check
the
web
site
announcements
Check
email
WWW
Tim
Berners-Lee
and
Robert
Cailliau
1990
HTTP,
CERN
h9pd,
gopher
1993
Mosiac
web
browser
(UIUC,
Marc
Andreesen)
1994
W3C
WWW
ConsorQum
---
generate
standards
Gopher
started
charging
licensing
fees
(Univ
of
Minnesota)
HTTP
/
HTTPS
AJAX
PHP
Javascript
SQL
Apache
Ruby
h9p://w3schools.com/
Threat
model
network
a9acker
User
A
Internet
a9acker.com
bank.com
protocol
port
hostname
path
query
Special
characters:
+
=
space
?
=
separates
URL
from
parameters
%
=
special
characters
/
=
divides
directories,
subdirectories
#
=
bookmark
&
=
separator
between
parameters
HTTP
Request
Method
File
HTTP version
Headers
Blank line
Data none for GET
HTTP
Response
HTTP version
Status code
Reason phrase
Headers
HTTP/1.0 200 OK
Date: Sun, 21 Apr 1996 02:20:42 GMT
Server: Microsoft-Internet-Information-Server/5.0
Connection: keep-alive
Content-Type: text/html
Last-Modified: Thu, 18 Apr 1996 17:39:05 GMT
Set-Cookie:
Content-Length: 2543
<HTML> Some data... blah, blah, blah </HTML>
Cookies
Data
Browser
execuQon
Each
window
(or
tab):
Retrieve/load
content
Render
it
Process
the
HTML
Might
run
scripts,
fetch
more
content,
etc.
Respond
to
events
User
acQons:
OnClick,
OnMouseover
Rendering:
OnLoad,
OnBeforeUnload
Timing:
setTimeout(),
clearTimeout()
Scripts:
CSS:
<link
rel="stylesheet"
type="text
/css
href=//site/com/theme.css"
/>
var
so
=
new
SWFObject(//site.com/ash.swf',
);
so.addParam(allowscriptaccess',
always');
so.write('ashdiv);
</script>
From h9p://w3schools.com/htmldom/default.asp
Javascript
Qming
<html><body><img
id="test"
style="display:
none">
<script>
var
test
=
document.getElementById(test);
var
start
=
new
Date();
test.onerror
=
funcQon()
{
var
end
=
new
Date();
alert("Total
Qme:
"
+
(end
-
start));
}
test.src
=
"h9p://www.example.com/page.html";
</script>
</body></html>
scan
Malicious
Web
page
scan
Firewall
Browser
scan
Browser
isolaQon
Browser
is
running
untrusted
inputs
(a9acker
webpage)
Like
all
big,
complex
so}ware,
browser
has
security
vulnerabiliQes
Browsers
include
Rich
Internet
ApplicaQons
(RIAs)
that
increase
a9ack
surface:
e.g.,
Adobe
Flash
(see
reading
for
today
by
Blazakis)
Malicious
website
exploits
browser,
from
there
system
Browsers
PrimiQves
Document
object
model
Frames
Cookies
/
local
storage
Principals:
Origins
Mandatory
access
controls
VulnerabiliQes
Cross-site
scripQng
(XSS)
Cross-site
request
forgery
(CSRF)
Cache
history
a9acks
Same-origin
policy
Each
frame
of
page(s)
has
an
origin
protocol://host:port
Origin
is
(protocol,host,port)
Frame relaQonships
Child
Sibling
Frame
Bust
Descendant
21
Frame
policies
canScript(A,B)
and
canNavigate(A,
B)
Permissive
any
frame
can
navigate
any
other
frame
Child
only
can
navigate
if
you
are
parent
Descendent
only
can
navigate
if
you
are
ancestor
Which
do
you
think
should
be
used?
window.open("https://attacker.com/",
"awglogin");
awglogin
UI Redressing (Clickjacking)
Overlayed
frame
Do evil thing()
FramebusQng
<script
type="text/javascript">
if(top
!=
self)
top.locaQon.replace(locaQon);
</script>
Cookies:
Seng/DeleQng
GET
if
expires=NULL:
this
session
only
HTTP Header:
Set-cookie: NAME=VALUE ;
domain = (when to send) ;
scope
path = (when to send)
secure = (only send over SSL);
expires = (when expires) ;
HttpOnly
Privacy
Cookies
can
be
used
to
track
you
around
the
Internet
<script
type="text/javascript">
//<![CDATA[
var
hint
=
'mainpage';
document.write('<script
type="text/javascript"
src="h9p://ad.doubleclick.net/adj/
ostg.slashdot/pg_index_p1_leader;pg=index2;logged_in=0;Qle='+dfp_Qle
+';sz=728x90;u=;ord='+dfp_ord+'?"><\/script>');
dfp_Qle++;
//]]>
</script>
Protocol
is
HTTPS.
Elsewhere
just
HTTP
POST /login.html?name=bob&pw=12345
Cookie: AnonSessID=134fds1431
Set-Cookie: SessID=83431Adf
GET /account.html
Cookie: SessID=83431Adf
Session Hijacking
From h9p://codebutler.com/resheep