38
DEFCON16 Virtually Hacking 08 August 2008

DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

DEFCON16 

Virtually Hacking

08 August 2008

Page 2: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

2

Why VMware?

• Virtualisation has taken off and is here to stay

• Many of our clients are using virtualisation technologies

• Virtualisation services are being sold

• VMware is the dominant product*

• Need to be familiar with a product in order to hack it

*source ­ silicon.com

Page 3: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

3

Structure• VMware 

Different flavours Key concepts

• Hacking VMware Server + Demo

• Hacking VMware ESX + Demo

• dradis – putting it all together

• Recommendations Am I going to get owned?

Page 4: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

4

Structure• VMware 

Different flavours Key concepts

• Hacking VMware Server + Demo

• Hacking VMware ESX + Demo

• dradis – putting it all together

• Recommendations Am I going to get owned?

Page 5: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

5

Different Flavours

• Player

• Workstation

• Server (GSX)

• ESX

Page 6: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

6

Different Flavours

• Player

• Workstation

• Server (GSX)

• ESX

Page 7: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

7

Key concepts

Server Guest OS

• One server can run multiple operating systems

Page 8: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

8

Key concepts

Hardware

OS

VMware Server

Virtual Machines

Apps

OS

Apps

OS

Apps

OSVMware Server

Page 9: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

9

Key concepts

Hardware

VMware ESX

Virtual Machines

Apps

OS

Apps

OS

Apps

OSVMware ESX

Page 10: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

10

Key concepts

• Primary configuration file (.vmx)

• Virtual disk file – the virtual machines hard drive (.vmdk)

• Virtual machines snapshot (.vmsn)

• Virtual machines page file (.vmem)

Overview of the main files which make up a virtual machine

Page 11: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

11

Key concepts

• Virtual machine disk file can be mounted

• Files can therefore easily be read from the disk

• Demo...

Page 12: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

12

Structure• VMware 

Different flavours Key concepts

• Hacking VMware Server + Demo

• Hacking VMware ESX + Demo

• dradis – putting it all together

• Recommendations Am I going to get owned?

Page 13: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

13

VMware:Server

Page 14: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

14

VMware:Server

Interesting ports on 192.168.1.53:Not shown: 1707 closed portsPORT    STATE SERVICE21/tcp  open  ftp22/tcp  open  ssh80/tcp  open  http111/tcp open  rpcbind113/tcp open  auth389/tcp open  ldap902/tcp open  iss­realsecure­sensor

vmware­authd

Page 15: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

15

VMware:Server

Page 16: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

16

VMware:Server ­ Tools

• List VM's

• Get state

• Start/Stop

• Get config

• Get remote connections

• Set guest info

vmware­cmd.pl

Page 17: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

17

VMware:Server ­ Tools

• List VM's

• Power On/Off

• Login Guest

• Copy file from host to guest / guest to host

• Run program in guest

• Run script in guest

VMware VIX API

Page 18: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

18

VMware:Server ­ Tools

VMware VIX API

1: require 'ruby_vix'2: Vix.RunProgramInGuest('10.0.0.9',902,s_username,s_password,vmusername, vmpassword,'/var/vms/windows.vmx','net user vmuser vmuser /ADD',"")

• Ruby bindings

• Easily scriptable

• Equivalent to 130 lines of C

Page 19: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

19

VMware:Server ­ Demo

• Obtain credentials

• Extract information

• Own the box

Page 20: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

20

Structure• VMware 

Different flavours Key concepts

• Hacking VMware Server + Demo

• Hacking VMware ESX + Demo

• dradis – putting it all together

• Recommendations Am I going to get owned?

Page 21: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

21

VMware:ESX

Page 22: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

22

VMware:ESX

Page 23: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

23

VMware:ESX

Interesting ports on 192.168.1.58:Not shown: 65528 filtered portsPORT     STATE  SERVICE22/tcp   open   ssh80/tcp   open   http427/tcp  closed svrloc443/tcp  open   https902/tcp  open   iss­realsecure903/tcp  open   iss­console­mgr5988/tcp open   unknown5989/tcp open   unknown

Page 24: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

24

VMware:ESX

• Provides a web service (SOAP) interface• https://vmware­esx/sdk

• Web server• https://vmware­esx/ui• https://vmware­esx/mob

• Vmware authd still available on port 902• Vmware­serverd not present

• COS (Console Operating System) via SSH• Red Hat derived

Page 25: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

25

Vmware:ESX ­ Tools

• Example operations include:

• RebootGuest

• RebootHost_Task

• ScanHostPatch_Task

• CreateUser

• RemoveVirtualSwitch

VI API

Page 26: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

26

Vmware:ESX ­ Demo

• Perform checks unauthenticated

• Exploit weaknesses

Page 27: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

27

Structure• VMware 

Different flavours Key concepts

• Hacking VMware Server + Demo

• Hacking VMware ESX + Demo

• dradis – putting it all together

• Recommendations Am I going to get owned?

Page 28: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

28

dradis – A Quick Intro

• Tool for structuring information

• Client/Server architecture

• Ruby based

• Extensible Add modules

Put together a methodology

• Intercept actions/results to perform conditional operations

http://dradis.sourceforge.net

Page 29: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

29

dradis – A Quick Intro

Page 30: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

30

dradis

• Provide it with a description of the environment

• It can then provide checks or operations based on this

• e.g.

Host is ESX  ­>  Determine version

Version is 3.5  ­>  Determine services

SSH is enabled  ­>  Check for weak accounts

etc... 

Page 31: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

31

dradis

• Lets see it in action

• Demo

Page 32: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

32

Structure• VMware 

Different flavours Key concepts

• Hacking VMware Server + Demo

• Hacking VMware ESX + Demo

• dradis – putting it all together

• Recommendations Am I going to get owned?

Page 33: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

33

Am I Going to Get Owned?

• Have you followed VMware's security guidance? 

• Have you applied updates?

Page 34: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

34

Am I Going to Get Owned?

• VMware will always be a single point of failure

• Recommendation is to keep management networks separate from your core networks and guest networks

• There is nothing stopping you from hardening the installation beyond the default Don't forget things like CIScan for example Do you use all of the services running?

Page 35: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

35

Am I Going to Get Owned?

• Harden the virtual network Disable promiscuous mode Reject MAC address changes Reject traffic with a forged IP address

• Disable copy and paste between guest and host

• Can guest OS read the CD drive on the host OS?

• Am I logging enough / too much?

Page 36: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

36

Future work

• Still plenty to play with

• Still lots of VMware technologies to cover

Page 37: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

37

END

• Have a play with the tools

• Let me know what you think

• Let me know any new features you would like to see

• Tools available from: http://www.tinternet.org.uk http://www.mwrinfosecurity.com

• dradis is available from: http://dradis.sourceforge.net

Page 38: DEFCON16 Virtually Hacking › images › defcon-16 › dc16-presentations › d… · 2 Why VMware? • Virtualisation has taken off and is here to stay • Many of our clients are

38

END

• Questions?