Listen to this Post

Introduction:
Mainframes, the powerful legacy systems running critical global infrastructure, are no longer impenetrable fortresses. As Ryan Williams’ recent certification and “hack the Gibson” achievement demonstrate, offensive security skills are now essential for both attacking and defending these complex environments. This deep dive explores the tools, commands, and mindset required to secure z/OS, TSO, and CICS systems against modern threats.
Learning Objectives:
- Understand core z/OS security concepts including APF authorization and EBCDIC encoding
- Master essential TSO and ISPF commands for security auditing and penetration testing
- Develop skills to identify and exploit mainframe-specific vulnerabilities while implementing proper defenses
You Should Know:
1. z/OS System Authorization Facility (SAF) Controls
//TSO COMMANDS FOR RACF AUDITING
RLIST FACILITY IRR.RUSERMAP AUTHUSER
SETROPTS RACLIST(FACILITY) REFRESH
LISTSET RACF
Step-by-step guide: The Resource Access Control Facility (RACF) forms the core of z/OS security. The `RLIST` command displays who has authorization to critical facilities like IRR.RUSERMAP, which manages user mappings. `SETROPTS RACLIST(FACILITY) REFRESH` ensures current security settings are active, while `LISTSET RACF` provides a comprehensive view of RACF protection settings. Regular auditing of these controls is essential for maintaining system integrity.
2. APF-Authorized Library Validation
//VALIDATE APF LIBRARIES
LISTA APF,DSNAME=SYS1.
F APF,LIST
F APF,STATUS
Step-by-step guide: Authorized Program Facility (APF) libraries contain programs that bypass normal security controls. The `LISTA` command displays all APF-authorized datasets, particularly those in the critical SYS1 namespace. The `F APF,LIST` operator command shows currently active APF libraries, while `F APF,STATUS` reveals their operational status. Unauthorized APF libraries represent a critical privilege escalation vulnerability.
3. CICS Transaction Security Hardening
CEDA VIEW TRANS(TRN1) GROUP(GROUP1)
CEMT INQ TRANS(TRN1)
CEBR SUFFIX(DFHLOG)
Step-by-step guide: CICS transactions require rigorous security controls. `CEDA VIEW` examines transaction security settings within resource groups. `CEMT INQ` queries transaction status in real-time, revealing potential security bypasses. `CEBR` browses CICS logs for unauthorized transaction execution attempts. These commands help security teams validate transaction protection mechanisms.
4. z/OS UNIX System Services Security
OMVS
BPXBATCH SH ls -al /etc/
BPXBATCH SH find / -name “.profile” -exec chmod 755 {} \;
Step-by-step guide: z/OS UNIX System Services (OMVS) presents a modern attack surface. The `OMVS` command enters the UNIX shell environment. `BPXBATCH SH` executes shell commands from traditional TSO, allowing security scripts to check file permissions (ls -al /etc/) and harden configuration files (chmod on .profile files). These controls prevent UNIX-based privilege escalation attacks.
5. Database Security Auditing for DB2
-DB2 COMMANDS FOR SECURITY AUDIT-
SELECT FROM SYSIBM.SYSROUTINEAUTH;
SELECT FROM SYSIBM.SYSDBAUTH;
DISPLAY DATABASE() DETAIL;
Step-by-step guide: DB2 database security requires monitoring authorization tables. Querying `SYSIBM.SYSROUTINEAUTH` reveals who can execute stored procedures, while `SYSIBM.SYSDBAUTH` shows database administrator privileges. The `DISPLAY DATABASE` command provides real-time security status of all databases. These checks prevent SQL injection and unauthorized data access.
6. Network Security for z/OS Communications
V TCPIP,,NETSTAT,ALL
V TCPIP,,NETSTAT,CONN
V TCPIP,,NETSTAT,ROUTE
Step-by-step guide: z/OS TCP/IP services require rigorous network security monitoring. The `V TCPIP` operator commands display comprehensive network statistics (NETSTAT,ALL), active connections (NETSTAT,CONN), and routing tables (NETSTAT,ROUTE). These help identify unauthorized connections, network reconnaissance activity, and potential man-in-the-middle attacks targeting mainframe communications.
7. System Management Facility (SMF) Log Analysis
//JCL FOR SECURITY LOG EXTRACTION
IFASMFDP TYPE(30)
ICHAUDIT TYPE(AL)
IRRUT100 TYPE(AL)
Step-by-step guide: SMF logs contain critical security events. Type 30 records track RACF authorization events, while `ICHAUDIT` and `IRRUT100` utilities extract audit records for analysis. Regular review of these logs helps detect brute force attacks, privilege escalation attempts, and unauthorized access patterns through comprehensive security information and event management (SIEM) integration.
What Undercode Say:
- Mainframe offensive security training provides unparalleled defensive insights that cannot be gained through traditional blue team approaches
- Legacy systems require specialized knowledge that bridges decades of technology while addressing modern threat vectors
- The scarcity of mainframe security expertise creates both critical vulnerabilities and exceptional career opportunities
The mainframe security landscape represents a perfect storm: critical infrastructure dependent on legacy systems, increasingly sophisticated threats, and a rapidly retiring workforce with institutional knowledge. Ryan Williams’ achievement and Kev Milne’s training platform highlight that offensive security skills provide the deepest defensive capabilities. As mainframes continue running global financial, government, and industrial systems, the professionals who master both attacking and defending these systems will become the most valuable assets in cybersecurity. The “hack the Gibson” reference isn’t just nostalgia—it’s a warning that systems once considered invulnerable are now targets requiring specialized protection.
Prediction:
Within three years, mainframe-specific ransomware and state-sponsored attacks will increase by 300% as attackers recognize both the criticality of these systems and the scarcity of defense expertise. Organizations investing in mainframe offensive security training today will be uniquely positioned to prevent catastrophic breaches of systems that still process approximately $3 trillion in daily transactions. The convergence of legacy infrastructure and modern attack techniques will make mainframe security the highest-value specialization in cybersecurity.
🎯Let’s Practice For Free:
IT/Security Reporter URL:
Reported By: Ryan Williams – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅


