Skip to content
Access control Write-up Advanced

Simple IBM I (AS/400) Hacking

A low-privileged user could escape a restricted initial program by sending the Attention Interrupt key over TN5250, then escalate privileges by impersonating a user profile that had *USE authority granted to *PUBLIC, and finally gain *SECADM by impersonating another profile. The attacker could also execute CL commands remotely over the DDM service, which was not protected by exit programs.

pz Follow

Published on blog.silentsignal.eu

When you get the chance to take a look at the IT systems of financial institutions, telcos, and other big companies, where availability has been a key business concern for decades, you’ll find, that some critical operations run through some obscure systems, in many cases accessed via nostalgic green-on-black…

pz, on blog.silentsignal.eu

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 combination of an initial program that could be bypassed with the ATTN key, user profiles with *USE authority granted to *PUBLIC, and an unprotected DDM service.

Impact

The attacker could execute arbitrary CL commands with *ALLOBJ and then *SECADM authority, and could also run commands remotely over DDM even if the green screen was unavailable.

What the attacker needed

Network access to TN5250; a low-privileged account; DDM service reachable

The fix

Administrators should restrict the ATTN key handling, remove *PUBLIC *USE authority from sensitive user profiles, and protect the DDM service with exit programs.

How it was found

  1. Connect to the TN5250 service with the low-privileged account.
  2. Send the Attention Interrupt key to break out of the initial program.
  3. Press F9 to reach the CL command prompt.
  4. Use WRKUSRPRF and WRKOBJ to find a user profile with *ALLOBJ and *USE authority for *PUBLIC.
  5. Compile and run a CL program that calls QSYGETPH and QWTSETP to switch to the target profile.
  6. Query the user database with SQL to find a profile with *SECADM and repeat the impersonation.

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 a midrange computer system used by banks and other large organisations. The tester had a limited account that was supposed to only run a menu program, but by pressing a special key on the terminal they reached a command prompt. From there they could run commands as other users because those user profiles were configured to allow anyone to use them, and they could also run commands over a network service that the administrators had forgotten to protect.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by pz

View all

12 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.