introduction to csrf attacks & defense

19
Introduction to CSRF Attacks &defenses.

Upload: surya-subhash

Post on 08-May-2015

1.494 views

Category:

Technology


0 download

DESCRIPTION

It's the PPT of the presentation at Null Hyd June 2014 meet. I tried to make it as simple as i can :) Share if you like and please let me know your suggestions :)

TRANSCRIPT

Page 1: Introduction to CSRF Attacks & Defense

Introduction to CSRFAttacks &defenses.

Page 2: Introduction to CSRF Attacks & Defense

Who Am I ?

I’m P.B.Surya.Subhash, a 17 Year old Coder, Hacker and a student.

Certified by Microsoft and was offered a job by Yahoo, Dell , Slideshare and a couple of other MNC’s

Helped USA.Gov, Nic.in, NCSL, Netherlands.

[email protected]

@pbssubhashFb.me/pbssubhash

Linkedin.com/in/pbssubhash

Page 3: Introduction to CSRF Attacks & Defense

And many more…

Page 4: Introduction to CSRF Attacks & Defense

• What’s CSRF ?

• Impact of CSRF

• How to test websites for CSRF ?

• Real time attack scenario of CSRF.

• Defenses against CSRF

• How to Bypass those defenses ?

• Using CSRF to compromise DSL Routers

• Conclusion

Agenda

Page 5: Introduction to CSRF Attacks & Defense

What’s this CSRF ?

•Cross site request forgery abbreviated as CSRF and also known as Session Riding.

•Forces an end user to execute unwanted actions on a web application in which he/she is currently authenticated.

Page 6: Introduction to CSRF Attacks & Defense

Impact

A successful CSRF exploit can compromise end user data and operation in case of normal user.

If the targeted end user is the administrator account, this can compromise the entire web application.

Page 7: Introduction to CSRF Attacks & Defense

That’s all ?

• Anything an authenticated user can do

• No restriction from same origin policy, except…

• Attackers cannot read responses from other origins

• Limited on what can be done with data

• Severe impact on accountability - Log entries reflect the actions a victim was tricked into executing

Page 8: Introduction to CSRF Attacks & Defense

How to find these ? So lets break it !(root@null: rm –rf

/root/earth/security/)

Page 9: Introduction to CSRF Attacks & Defense

Let’s Exploit it !

Page 10: Introduction to CSRF Attacks & Defense

Killer Combination !

• Persistent Script Injection + CSRF = PWN3D

Page 11: Introduction to CSRF Attacks & Defense

defenses The simplest one is to validate the Referrer header in the HTTP Request preventing the

request from unknown sources.

The most popular one remains the token.

Custom HTTP Header like X-Requested-By: My Site.com – Not so popular…

Same Orgin Policy.

Re-authentication

Captcha

Page 12: Introduction to CSRF Attacks & Defense

Common Mistakes :-

• Not validating the token ..

• Not applying captcha properly.

Example :-

http://www.youtube.com/watch?v=zl0ARKQhoLA

Page 13: Introduction to CSRF Attacks & Defense

Misconceptions – Defenses That Don’t Work

Only accept POST

Stops simple link-based attacks (IMG, frames, etc.)

But hidden POST requests can be created with frames, scripts, etc…

Referrer checking

Some users prohibit referrers, so you can’t just require referrer headers

Techniques to selectively create HTTP request without referrers exist

Requiring multi-step transactions

CSRF attack can perform each step in order

None of these approaches will sufficiently protect against CSRF!

Page 14: Introduction to CSRF Attacks & Defense

Intro on How to Bypass those defenses ?

• Clickjacking

• Bypassing SOP • Insecure CrossDomain.XML

• Openly available exploits

• Bypassing the captcha

• Checking Token Validation

• Checking header Validation

• Converting POST based requests to GET based requests.

Page 15: Introduction to CSRF Attacks & Defense

CSRF to compromise DSL Routers ?

• Home DSL routers aren't secure from specialized CSRF attacks. Once the DSL router is owned, attackers can have their way with

the internal network.

Initiate a connection to the new DSL router.Turn on remote management.Add a password to the Admin user account.

Page 16: Introduction to CSRF Attacks & Defense

Demo Time

Page 18: Introduction to CSRF Attacks & Defense

Anything to ask ?

Page 19: Introduction to CSRF Attacks & Defense

Bye !

Please drop your suggestions at @pbssubhash (or) [email protected]

Thank You!