88
VANGUARD SECURITY & COMPLIANC Philip Youn Zed Sec 39 Session # he Current State of ainframe Hacking CURITY & COMPLIANCE ONFERENCE 2016

Philip young current state of mainframe hacking - vanguard - 101016

Embed Size (px)

Citation preview

Page 1: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Philip Young Zed Sec 390

Session #1

The Current State of Mainframe Hacking

SECURITY & COMPLIANCE CONFERENCE 2016

Page 2: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

DISCLAIMER

I’m not here in the name of or on behalf of my employer. All opinions expressed here are my own.

Page 3: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Page 4: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Page 5: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Page 6: Philip young   current state of mainframe hacking - vanguard - 101016
Page 7: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Question

Who here has seen my previous talks?

Page 8: Philip young   current state of mainframe hacking - vanguard - 101016
Page 9: Philip young   current state of mainframe hacking - vanguard - 101016
Page 10: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

The Un-hackable?

Page 11: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Word on the Street

• I’ve heard all kinds of reasons why mainframes are “Un-hackable”

• Let’s walk through some of them now

Page 12: Philip young   current state of mainframe hacking - vanguard - 101016

“It’s not on the internet”

Page 13: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

“It’s not on the internet”

• 2013 Started “finding” mainframes on the internet

• Using tools called masscan, nmap and x3270

• Various techniques found: 458

Page 14: Philip young   current state of mainframe hacking - vanguard - 101016
Page 15: Philip young   current state of mainframe hacking - vanguard - 101016
Page 16: Philip young   current state of mainframe hacking - vanguard - 101016
Page 17: Philip young   current state of mainframe hacking - vanguard - 101016
Page 18: Philip young   current state of mainframe hacking - vanguard - 101016
Page 19: Philip young   current state of mainframe hacking - vanguard - 101016
Page 20: Philip young   current state of mainframe hacking - vanguard - 101016
Page 21: Philip young   current state of mainframe hacking - vanguard - 101016
Page 22: Philip young   current state of mainframe hacking - vanguard - 101016

Welp

Page 23: Philip young   current state of mainframe hacking - vanguard - 101016
Page 24: Philip young   current state of mainframe hacking - vanguard - 101016

“Well, the ESM is impenetrable”

Page 25: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

the ESM is impenetrable!

• This is true! • Lot’sof(memoneyandtes(nginvestedin‘hackproofing’ACF2,RACF,TopSecret

• Other impenetrable Security Products • MicrosoBAc(veDirectory• SELinux

Page 26: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

the ESM is impenetrable!

• Misses the point

• Organic growth over decades

• I only need 1 malformed entitlement out of 600,000+

Page 27: Philip young   current state of mainframe hacking - vanguard - 101016

“You can’t just download a mainframe file and read it!”

Page 28: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Reading EBCDIC

• EBCDIC is easy to read with python!

print ’"%s"' % d.decode('EBCDIC-CP-BE').encode('ascii')

• Multiple tools exist to read XMI files, find strings in large files and decode EBCDIC.

• Fixed length makes this even easier

Page 29: Philip young   current state of mainframe hacking - vanguard - 101016
Page 30: Philip young   current state of mainframe hacking - vanguard - 101016
Page 31: Philip young   current state of mainframe hacking - vanguard - 101016

“IBM doesn’t publish vulnerabilities”

Page 32: Philip young   current state of mainframe hacking - vanguard - 101016

http://seclists.org/fulldisclosure/2016/Oct/43

Page 33: Philip young   current state of mainframe hacking - vanguard - 101016
Page 34: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Vulnerabilities

• This doesn’t make it safer.

• Please sign up for the IBM Security Portal

• I can understand IBMs position

Page 35: Philip young   current state of mainframe hacking - vanguard - 101016

“There’s never been a successful hack”

Page 36: Philip young   current state of mainframe hacking - vanguard - 101016
Page 37: Philip young   current state of mainframe hacking - vanguard - 101016
Page 38: Philip young   current state of mainframe hacking - vanguard - 101016
Page 39: Philip young   current state of mainframe hacking - vanguard - 101016
Page 40: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Stole

• $6,000 • Entire ‘social security’ database • Witness protection DB • Federal Tax source code

Page 41: Philip young   current state of mainframe hacking - vanguard - 101016

http://bit.ly/zbreach

Page 42: Philip young   current state of mainframe hacking - vanguard - 101016
Page 43: Philip young   current state of mainframe hacking - vanguard - 101016

Current State

Page 44: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

New Tools!

• Network Job Entry Testing • Nmap (VTAM, TSO, CICS) • Metasploit • CICSpwn

Page 45: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Network Job Entry

• Used all over the world

• Facilitates management of different LPARs

• Allows transferring files, JCL

Page 46: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Configuration

• Declare ‘nodes’ in SYS1.PARMLIB(JES2PARM)

• Start NJE • Connect two systems together • Default port 175 • More Info: POC||GTFO #12

Page 47: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Attacking

• Identify port

• Identify OHOST/RHOST

• Emulate

Page 48: Philip young   current state of mainframe hacking - vanguard - 101016
Page 49: Philip young   current state of mainframe hacking - vanguard - 101016
Page 50: Philip young   current state of mainframe hacking - vanguard - 101016
Page 51: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Nmap Additions

• Service Identification • TN3270 Library:

• VTAMApplica(onEnumera(on• CICSTransac(onIDEnumera(on• TSOUserEnumera(on/Bruteforce• CICSUserEnumera(on(ACF2/TSS/RACF!)

Page 52: Philip young   current state of mainframe hacking - vanguard - 101016
Page 53: Philip young   current state of mainframe hacking - vanguard - 101016
Page 54: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Nmap TN3270 Library

• Nmap has a very powerful scripting engine • Uses LUA and custom libraries • Created a TN3270 emulator in LUA • Created it in to a library for Nmap • Opens up multiple possibilities!!

Page 55: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

VTAM Enumeration

• VTAM allows a few commands: IBMTEST LOGON LOGOFF

Page 56: Philip young   current state of mainframe hacking - vanguard - 101016
Page 57: Philip young   current state of mainframe hacking - vanguard - 101016
Page 58: Philip young   current state of mainframe hacking - vanguard - 101016
Page 59: Philip young   current state of mainframe hacking - vanguard - 101016
Page 60: Philip young   current state of mainframe hacking - vanguard - 101016
Page 61: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

CICS Transaction ID

• Using the same technique:

Page 62: Philip young   current state of mainframe hacking - vanguard - 101016
Page 63: Philip young   current state of mainframe hacking - vanguard - 101016
Page 64: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

TSO User Enumeration

• TSO logon process allows for user enumeration

• Very slow by hand • Automate with Nmap!

Page 65: Philip young   current state of mainframe hacking - vanguard - 101016
Page 66: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

TSO User Enumeration

• IBM has issued a fix!

• Turn PASSWORDPREPROMPT ON

• I’ve heard ACF2 and TopSecret have also resolved this!

Page 67: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

CICS User Enumeration

• CICS logon process has same issue

• All three SAFs affected: • RACF• ACF2• TopSecret

Page 68: Philip young   current state of mainframe hacking - vanguard - 101016
Page 69: Philip young   current state of mainframe hacking - vanguard - 101016
Page 70: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Metasploit

• Used for penetration testing • Helps with centralized exploit management

• JCL libraries and first ‘exploit’ added to metasploit this year!

Page 71: Philip young   current state of mainframe hacking - vanguard - 101016

Source: http://securityweekly.com/2015/08/26/episode-431-interview-with-phil-young-and-chad-rikansrud/

Page 72: Philip young   current state of mainframe hacking - vanguard - 101016

Source:h*ps://github.com/rapid7/metasploit-framework/pull/6834

Page 73: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Chad Rikansrud

• Added support for FTP + JCL execution to Metasploit

• Added JCL library to Metasploit • Currently working on TN3270 library

Page 74: Philip young   current state of mainframe hacking - vanguard - 101016
Page 75: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

CICSpwn

• New Tool!

• Python tool for attacking CICS

Page 76: Philip young   current state of mainframe hacking - vanguard - 101016
Page 77: Philip young   current state of mainframe hacking - vanguard - 101016
Page 78: Philip young   current state of mainframe hacking - vanguard - 101016
Page 79: Philip young   current state of mainframe hacking - vanguard - 101016
Page 80: Philip young   current state of mainframe hacking - vanguard - 101016

What Can I Do?

Page 81: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Hardest Challenges

• Compliance

• Secure Coding Guidelines

• Attack correlation

Page 82: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Compliance

• No clear industry best practice

• What does exist may be old and not inclusive

• Security Requirements written by non experts

Page 83: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Compliance

• Base yours on best practice •  Redbooks–all11kpages•  DoDDISASTIG

• Continuous Assessments •  Ensureaccidents/maliciousac(vi(esaredetected•  Appeasesauditors/audits

• Use available tools

Page 84: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Secure Coding

• Rare for widely used languages • PL/I• REXX• COBOL• HLASM

• Despite vulnerabilities existing!

Page 85: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Logging / Monitoring

• Export the logs • Real time monitoring a MUST! • Current monitoring process vs. Open Systems

• Use available tools!

Page 86: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Develop with me!

• New Tools and Techniques • New Best Practice • Better Audit Guides • Better Tutorials

Page 87: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Contact

• Twitter: @mainframed767 • Email: [email protected] • More Talks:

• VanguardSessionCST08• SHARESanJose

Page 88: Philip young   current state of mainframe hacking - vanguard - 101016

VANGUARD SECURITY & COMPLIANCE 2016

Thank you!

SECURITY & COMPLIANCE CONFERENCE 2016