Exploit development for IBM i
The DDM/DRDA service on IBM i accepted crafted packets that let an unauthenticated attacker run CL commands, and the authors extended this blind execution into an interactive shell and an SQL-based path that evaded exit programs. An attacker could run arbitrary commands on the host and, with the added techniques, get command output back.
At TROOPERS24, we demonstrated how IBM i systems – still widely used in enterprise environments – can be compromised in both authenticated and unauthenticated scenarios, using only built-in services and a basic understanding of the underlying mechanisms. Despite being labeled “legacy,” these systems remain active in…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the DDM/DRDA server processed command and SQL requests without proper authentication or authorisation checks, and exit programs only watched the command interface, not the SQL path.
Impact
An unauthenticated attacker could execute arbitrary commands on the IBM i host and, with the added techniques, obtain an interactive shell even in restricted networks, while SQL-wrapped commands could bypass exit-program monitoring.
What the attacker needed
Network access to the DRDA port; no credentials needed
The fix
IBM i should be patched with the latest PTFs, and administrators should not rely on exit programs alone.
How it was found
- Connect to the DRDA port and replay the fixed EXCSAT, ACCSEC and SECCHK handshake packets
- Send a fourth packet containing the desired CL command encoded in EBCDIC
- Upload a Java bind shell source file through the same channel using a shell command
- Compile it with the EBCDIC encoding option and launch it
- Connect to the listening port to get an interactive shell
- Alternatively, wrap the command in an SQL CALL to QCMDEXC over DRDA to avoid exit-program detection
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
IBM i is an older IBM operating system still used for business workloads. Its remote database service would accept commands from anyone who could reach it, without asking for a login. The researchers also found a way to run the same commands through SQL so that the administrator's monitoring rules did not notice.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.