Python shells on Z & a Patch to Ported Tools

Rocket Software (@rocket on twitter, links below) has a great set of ported tools for System Z.  One of them is Python 2.7.6    Python is in ever penetration tester’s toolkit, and one of my favorite uses for it is to get a “clean” shell once you have gotten connectivity to a system.

Mainframe is no different;  using the old one liner

One can change an ugly shell (perhaps gained by Java app, or some other means:  e.g. netcat, exploit, etc) into one with proper TTY / shell settings, as show in this simple gif:


The Gist below patches Rocket’s port of Python to make this work on System Z ( the – one line fix to match the naming conventions on mainframe).

Gist for patching python

Rocket Ported tools @ SHARE

Rocket Ported Tools Download

DEF CON 23 – Slides & Code

If you are interested (and why wouldn’t you be?)   Here are is a link to the presentation posted below, given by myself and Soldier of Fortran (@mainframed767) at this year’s DEF CON23.   Enjoy!

The link to all the tools and code in the presentation can be found here.