$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$""""$$$$$$$$$$$$$$""""$$$$$""""$$""""$$$$$""""$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$"" gg """""$"""""$"" gg  """  gg    gg  $""" gg $$$$$$$$$$$$$$
$$$$$$$$$$$$$$ g$g$$ $$g$g g$g$g g$g$$ g$g$g $$g$g $$$g  g$$$$ $$$$$$$$$$$$$$
$$$$$$$$$$$$$$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$    $$    $$ $$$$$$$$$$$$$$
$$$$$$$$$$$$$$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$    $$    $$ $$$$$$$$$$$$$$
$$$$$$$$$$$$$$ $$ $$ $$g$" $$ $$ $$    $$ $$ $$ $$ ggg$$ ggg$$ $$$$$$$$$$$$$$
$$$$$$$$$$$$$$ $$ $$ $$    $$ $$ $$ gg $$ $$ $$ $$ $$       gg $$$$$$$$$$$$$$
$$$$$$$$$$$$$$ $$ $$ $$ $$ $$ggg $$ $$ $$ $$ $$ $$ $$       $$ $$$$$$$$$$$$$$
$$$$$$$$$$$$$$ `$$$$ `$g$' $$    `$g$' `$g$' $$ $$ $$$$$ g$$$' $$$$$$$$$$$$$$
$$$$$$$$$$$$$$$%ssssbssss%bsss$$bssssdsbssssdsssss$sssssbxxxxxx$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$SS""""""SSS$$$$$$$$$$$$$$$$$$$S''"""'''"S$$$$$$$$$$$$$$$$$$$$$$$$$$$!
$$$"';:::... .     ""''"%S$$$$$$$$$P"            "4$$$$$$$$$$$$$$$$$$$$$""""i
$' d$;:.:. Soldier of     "'%$$$$;  S o F & B e S `$$$$$$$$$$$$$$$$$P"     :
i  $$$i. .   Fortran           "4$   p r e s e n t  ;$$$$$$$$$$$$$$$;       .
:  $$$.:.      Big Endian        `.                ,$$$SSSi$$$$$$$$$     .
   $$$.         Smalls              +.           .+'""    !""''"$$$i     .
`. $$$                                  "  -   "         ,s.     "4$     ;
  "$$$.      __  __       _        __                                    :
   $$$ "    |  \/  | __ _(_)_ __  / _|_ __ __ _ _ __ ___   ___            .
   $$$  .   | |\/| |/ _` | | '_ \| |_| '__/ _` | '_ ` _ \ / _ \             .
   $$$_.    | |  | | (_| | | | | |  _| | | (_| | | | | | |  __/
.s+$$$"     |_|  |_|\__,_|_|_|_|_|_| |_|  \__,_|_| |_|_|_|\___|
"  $$$      _   _                                 _____           _
   $$$     | | | | __ _  ___| | _(_)_ __   __ _  |_   _|__   ___ | |___
   $$$     | |_| |/ _` |/ __| |/ / | '_ \ / _` |   | |/ _ \ / _ \| / __|
.  $$$     |  _  | (_| | (__|   <| | | | | (_| |   | | (_) | (_) | \__ \
""+$$$     |_| |_|\__,_|\___|_|\_\_|_| |_|\__, |   |_|\___/ \___/|_|___/
    :                                     |___/
\.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:./
| <==========================>  [! WARNING !]  <==========================> |
| .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-|
|:::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::|
|_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'___|

 Below you will find a listing of all the kickass programs presented during
 DEFCON 23 at the Paris Hotel, Las Vegas, NV. August 11th, 2015.

 All the tools contained in these folders were writted by Soldier of Fortran
 (aka Philip Young) and Big Endian Smalls (aka Chad Rikansrud). You can con-
 act them both on twitter: SoF - @mainframed767  and BeS - @bigendiansmalls.

 All the tools were  designed for use against  IBMs z/OS mainframe operating
 system and have been tested against z/OS 1.13 and z/OS 2.1. These  next few
 sections will outline the scripts and programs contain on the CD and what's
 in each folder.
.                                                                           .
|................................ [ /NMAP ] ................................|
|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|
|.                                                                         .|
|.  This folder  introduces the first  ever LUA  TN3270 emulator, written  .|
|.  special for NMAP. It supports  screen grabbing, CICS,  VTAM and other  .|
|.  field enumeration, fuzzing and brute forcing.  On top of that it also  .|
|.  contains scripts for  Network Job Entry  port identification and node  .|
|.  name brute forcing. All in all, its what you need to get started with  .|
|.  IBM mainframe hacking from the network.                                .|
|.                                                                         .|
| .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-|
|:::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::|
|_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'___|
|.                                                                         .|
|.   L I B R A R Y :                                                       .|
|.       tn3270.lua ............ NMAP TN3270 Screen Emulator. World First! .|
|.                                                                         .|
|.   P R O F I L I N G :                                                   .|
|.       tn3270-info.nse ....... NSE to detect TN3270 capable ports        .|
|.       tn3270-screen.nse ..... Shows you the sweet EBCDIC art.           .|
|.                               (takes a mainframe screenshot)            .|
|.       tn3270-hidden.nse ..... Shows hidden fields in a TN3270 session   .|
|.                                                                         .|
|.   C I C S :                                                             .|
|.         cics-enum.nse ....... CICS Transaction ID Enumerator            .|
|.         default_cics.txt .... Known default CICS transaction IDs        .|
|.                                                                         .|
|.   N E T W O R K  J O B  E N T R Y :                                     .|
|.         nje-info.nse ........ NSE to detect NJE open ports.             .|
|.         nje-node-brute.nse .. Brute forces NJE node names.              .|
|.                                                                         .|
|.   V T A M :                                                             .|
|.      vtam-enum.nse .......... VTAM Application ID enumerator            .|
|.      vtam-macro-enum.nse .... VTAM (USS Table) macro enumerator         .|
|.      vtam_enum.txt .......... Some default VTAM applids/macros          .|
|.                                                                         .|
|.                                                                         .|
|...........................................................................|
|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|
|.                                                                         .|
|............................ [ /Exploit ] .................................|
|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|
|.                                                                         .|
|.  Since the dawn of time man  (and lots of women)  have wondered: Is it  .|
|.  possible to overflow a buffer on a mainframe? But not one  single in-  .|
|.  dividual took up the call. UNTIL NOW! Included on this  amazing CD is  .|
|.  the worlds first z/OS shellcode. Thats  right, shell code that run on  .|
|.  a mainframe! Included are examples and documentation to get you going  .|
|.  on your very own mainframe exploiting adventures!                      .|
|.                                                                         .|
|.  Included with the shellcode is a bunch of tools and some notes to get  .|
|.  you started. Next time someone says the  mainframe is un-hackable you  .|
|.  make sure and show them this code and  make sure they know you got it  .|
|.  at defcon.                                                             .|
|.                                                                         .|
| .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-|
|:::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::|
|_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'___|
|.         .......................................                         .|
|.        :                                     ::                         .|
|...:::::::       pHiLeZ                        ::                         .|
|.  ......:...............    ..................::.......................  .|
|. :                      :  :                                           : .|
|. :      buf2dc.py       :  : takes a binary blob, makes a buffer or 3! : .|
|. :                      .  :                                           : .|
|. .       decode.s          . decoder assembly stub to use with SC buffer .|
|.                           .                                           : .|
|. .  shellcode-notes.txt .         Notes on making this shit sing!      . .|
|.                           .                                           . .|
|.    exec_local_shell.c  .       Simple c code to pop a local shell       .|
|. .                         :                                             .|
|.                                                                       . .|
|............................ [ /SETn3270 ] ................................|
|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|
|.                                                                         .|
|.  Since a TN3270 emulator  was made in LUA, why  not Python? SoF  hates  .|
|.  himself enough to do it! With the TN3270 library complete it  allowed  .|
|.  SoF to create SET'n'3270. The worlds first (and only) Social Engineer- .|
|.  ing Toolkit made  specifically for TN3270 (and mainframes). This tool  .|
|.  works in three modes:                                                  .|
|.                                                                         .|
|.        1) Fake TSO Logon Screen                                         .|
|.        2) Mirror a mainframe (connects, downloads images and replay     .|
|.        3) MitM TN3270                                                   .|
|.                                                                         .|
|.  All three modes support both non-ssl and ssl support. The debug flag   .|
|.  can be  enabled to let you see what is  going on behind the scene so   .|
|.  you can learn how TN3270 works.                                        .|
|.                                                                         .|
| .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-|
|:::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::|
|_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'___|
|___________________________________________________________________________|
|%%%%%%%%%%%%{ pHILE nAME }%%%%%%%%|%%%%%%%%%%%%{ dESCRIPTION }%%%%%%%%%%%%%|
|::```````````````'''''''''''''''::| ...:::......:::......:::......:::..... |
|::::.....  SETn3270.py   ..:::::::| ...:::-->     SET'n'3270     ...:::--> |
|:::::...  setn3270_cert .....:::::| <--:::...  Self Signed Cert  <--:::... |
|:..       setn3270_key     ....:::| ...:::-->   Self Signed Key  ...:::--> |
|::::::.... tn3270lib.py ....::::::| <--:::...  TN3270 Python Lib <--:::... |
|..................................|........................................|
|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|
|.                                                                         .|
|............................ [ /iNJEctor ] ................................|
|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|
|.                                                                         .|
|.  NJE, also known as Network Job Entry allows mainframes to set up some  .|
|.  kind of trust network. Allowing mainframes to send jobs (or JCL) be-   .|
|.  tween them and also allowing Node Message Records (NMR) or in english  .|
|.  commands and their reply messages. iNJEctor allows a user, given they  .|
|.  know the node name of the target system and the system the are hoping  .|
|.  to impersonate, the ability to send JES2 command using NJE from the    .|
|.  comfort of your weird hacking den.                                     .|
|.                                                                         .|
|.  Include with iNJEctor is the first, and only, NJE python library (in   .|
|.  BETA form, just in time for DEFCON!)                                   .|
|.                                                                         .|
|:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::|
|....................[ FiLeZ ]..............................................|
|:===> iNJEctor.py       : the main iNJEctor script to be used against NJE :|
|:===> njelib.py         : the Network Job Entry python library used by    :|
|:                         iNJEctor to negotate signon send commands, etc  :|
|:===> JES2_Commands.txt : List of all JES2 commands from IBM website      :|
|...........................................................................|
|
| .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-|
|:::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::|
|_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'_____`-'___|
|                                                                           |
|     \x90\xeb\xd0\x0c\xc0\xf0\xff\xff\xff\xfe\x58\x00\xf0\x28\x58\xf0      |
|     \xf0\x2c\x58\xe0\x00\x10\x58\xee\x03\x04\x58\xee\x00\xa0\xb2\x18      |
|     \xe0\x00\xa7\xf4\x00\x07\x00\x00\x00\x10\x00\xd8\x00\x00\x00\x06      |
|     \x18\xfd\x18\xd1\x50\xf0\xd0\x04\x50\xd0\xf0\x08\x58\x10\xf0\x18      |
|                                                                           |
| .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-|
|/.::::::/.::::::/.::::::/.::::::/.::::::/.::::::/.::::::/.::::::/.::::::/.:|
|     `-'     `-'     `-'     `-'     `-'     `-'     `-'     `-'     `-'   |
|                 This is our world now... the world of the                 |
|                    electron and the switch, the beauty of the baud.       |
|                                                         - Mentor          |
|  -.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-|
|:::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::.\::::::|
|     `-'     `-'     `-'     `-'     `-'     `-'     `-'     `-'     `-'   |
|                - -- ---== SoF & BeS would like to ==--- -- -              |
|               _______ ___________________ _________ _________             |
|             _/:.  __/__:.  - _/__:.__-__/__:.__-__/__:. _  _/_            |
|        . .--\___  `   /___,     /___      /___      /___/    /--. .       |
|         \|    g\___nm/  R\_____/  E\_____/  E\_____/  T\____/   |/        |
|          |)                  the following :                   (|         |
|          /                                                      \         |
|         (|                     - pEEPS -                        |)        |
|          |)                                                    (|         |
|          /               Dominic White                          \         |
|         (|               Swedish Haker Underground              |)        |
|          |)              IBM People (you know who you are)     (|         |
|          /               Mark Wilson                            \         |
|         (|               sixteencolors.net                      |)        |
|          |)              Phrack s390 shellcode                 (|         |
|          /               DeFeNeStRaTe.c                         \         |
|         (|               DEFCON Organizers                      |)        |
|          |)              IBM Authors                           (|         |
|          /                                                      \         |
|         (|                                                      |)        |
|          |)       - aRT -                                      (|         |
|          /        s0ap0396 - 0396SOAP.MEM                       \         |
|         (|        RMRS-04  - REMORCE.NFO & WD-NW.ASC            |)        |
|          |)       blend06  - !COVER06.ANS                      (|         |
|          /                                                      \         |
|         (|                                                      |)        |
|          |)                                                    (|         |
|          /                                                      \         |
|         '`--- -                                            - ---'`        |
|                                                                           |
:.-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.:
:dEFCON23(/)dEFCON23(/)dEFCON23(/)dEFCON23(/)dEFCON23(/)dEFCON23(/)dEFCON23(:
..-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-..
                             .
    :             ..       .                            +           .
           .              .              :     .             :
                          :                                  |
                          :                           -------o------ -- -
 .--------------:---------.---------------.  .               |
 |:.            |    o    |               :|::|:   .         :
 |          .---|        :|-----------_---'  '                    .
 `\          \  |---------;      :
  _`'         `\|         |      |:::::                .
 |              |         |      :
 |             :|    .    |.    :|   ,--------------- ------.--------------.
 `--------------'         `------'   :               |  -.--':.            :
                    .                |        :      :  -'--.          .---'
      .                     \.       |          .:::::------'\          \
       :      .                      |               :  :    _`'         `\
       .      :                      |       :::     |      |              |
              |             _.       :               |      |             :|
      --------o------ -- -           ` --------------    .  `--------------'
              |                      :
              :                      .                     .
       .:.
