Kuboid
Open Luck·Kuboid.in

The Immortal Retrofuturism of Mainframe Computers

DEFCONConference591 views25:47over 1 year ago

This talk demonstrates how to perform reconnaissance and exploit vulnerabilities in mainframe environments by leveraging insecure network configurations and mismanaged access controls. The speaker illustrates how web-based applications can serve as an entry point to interact with mainframe systems, bypassing traditional authentication boundaries. The presentation highlights the importance of auditing mainframe-specific security tools and configurations to prevent unauthorized data access. A practical demonstration shows how to extract sensitive information from a mainframe via a web browser by manipulating network requests.

Mainframe Security Is Not Dead: How Web Apps Are Bypassing Your Perimeter

TLDR: Mainframes remain critical infrastructure for global finance and healthcare, yet they are often treated as isolated, impenetrable black boxes. This research demonstrates that modern web applications frequently serve as the primary attack vector, allowing unauthorized access to mainframe data through insecure network configurations and poor access control. Pentesters should prioritize auditing the integration points between web-facing applications and backend mainframe services to identify potential data exfiltration paths.

Mainframes are not relics of the 1980s. They are the backbone of the global economy, processing billions of transactions daily. Despite the common misconception that these systems are inherently secure due to their age and obscurity, they are increasingly exposed through modern web-based interfaces. When a web application connects to a mainframe, it creates a bridge that often bypasses the traditional, hardened security boundaries of the mainframe environment. If you are performing a penetration test or a bug bounty engagement, you need to stop treating the mainframe as an out-of-scope target and start looking at the integration points.

The Myth of the Isolated Mainframe

Security researchers often fall into the trap of assuming that mainframes are disconnected from the modern web. In reality, the push for digital transformation has forced organizations to expose mainframe data to web applications to support real-time analytics and customer-facing services. This shift has significantly expanded the attack surface.

The OWASP Top 10 remains as relevant here as it is in any other environment. Specifically, A01:2021-Broken Access Control is the most common failure point. When a web application is configured to interact with a mainframe, it often uses a service account with excessive privileges. If the web application itself is vulnerable to A03:2021-Injection, an attacker can leverage that flaw to execute commands or query databases on the backend mainframe without ever needing to authenticate directly to the mainframe environment.

Exploiting the Web-to-Mainframe Bridge

During a recent engagement, the research highlighted how a simple web-based request could be manipulated to extract sensitive data. The attack flow is straightforward: identify a web application that communicates with a backend mainframe, intercept the traffic, and modify the request to access unauthorized resources.

In the demonstration, the target was an application running on Apache Tomcat that acted as a gateway to a mainframe. By observing the network traffic in the browser's developer tools, it was possible to see the POST requests being sent to the backend. The application did not properly validate the input, allowing for the manipulation of the file path requested from the mainframe.

POST /api/v1/data/fetch HTTP/1.1
Host: 172.19.111.2:8080
Content-Type: application/json

{
  "file_path": "/opt/secrets/ssh_key"
}

By changing the file_path parameter to a sensitive file, the application returned the contents of that file in the HTTP response. This is a classic example of how a lack of input validation at the web layer can lead to a full compromise of the backend data. The mainframe itself was not "hacked" in the traditional sense; rather, the web application was used as a proxy to bypass the intended access controls.

Why Pentesters Should Care

If you are on an engagement, your reconnaissance should include mapping the entire network topology, not just the web server. Look for services that communicate with backend systems like DB2 or use RACF, Top Secret, or ACF2 for access management. These are the tools that should be protecting the data, but they are only effective if the integration points are secure.

During your testing, look for:

  • Insecure Protocols: Are the connections between the web app and the mainframe using unencrypted protocols like FTP?
  • Default Configurations: Are there default credentials or misconfigured permissions on the mainframe side that allow for command execution?
  • Excessive Privileges: Does the service account used by the web application have more access than it needs?

Defensive Measures for the Blue Team

Defenders must treat the mainframe as a first-class citizen in their security architecture. This means implementing strict network segmentation to ensure that only authorized applications can communicate with the mainframe. Furthermore, organizations should adopt the NIST SP 800-53 controls to ensure that their security posture is aligned with industry standards.

Regular auditing is non-negotiable. You cannot secure what you do not understand. If your organization relies on a mainframe, your security team must have the expertise to audit the mainframe-specific configurations and the web applications that interact with them. Relying on automated scanners is not enough; you need manual penetration testing that specifically targets the integration points between your modern web stack and your legacy backend.

Mainframes are not going anywhere, and as long as they remain connected to the web, they will be a target. The next time you are on an engagement, don't ignore the "old" iron in the server room. It might just be the most interesting part of your target's infrastructure.

Talk Type
talk
Difficulty
intermediate
Category
red team
Has Demo Has Code Tool Released


DEF CON 32

260 talks · 2024
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in