Skip to content

Instantly share code, notes, and snippets.

View mainframed's full-sized avatar

Soldier of FORTRAN mainframed

View GitHub Profile
@mainframed
mainframed / recursive-unxmit.sh
Created September 15, 2020 20:55
Takes an XMIT file and recursively extracts all embedded xmit files inside
#!/usr/bin/env bash
echo "Recursive unxmit"
while grep -anorb $'\xc9\xd5\xd4\xd9\xf0\xf1' ./|grep -a ":1:2:" ; do
for f in `grep -anorb $'\xc9\xd5\xd4\xd9\xf0\xf1' ./|grep -a ":1:2:"|awk -F: '{print $1}'`; do
folder=`realpath $f`
file=`basename $f`
mkdir -p $folder-dir/bin
mkdir -p $folder-dir/asc
mv $folder $folder-dir
../../recv390/recV390 +binary xpath=$folder-dir/bin $folder-dir/$file
@mainframed
mainframed / JCL
Created July 21, 2020 18:56
wakeupneo.hlasm.jcl
//HELLONEO JOB (ASSY),'WAKE UP NE',CLASS=A,MSGCLASS=Y, 00010001
// NOTIFY=&SYSUID,MSGLEVEL=(1,1) 00020000
//ASM EXEC PROC=HLASMCL 00030000
//SYSIN DD * 00040000
CLR70 TITLE 'C L E A R - TSO' 00050000
PRINT ON,DATA,GEN 00060000
CLEAR CSECT 00080000
* SETUP registers and save areas thanks @bigendiansmalls * 00110000
MAIN STM 14,12,12(13) # Save caller reg 00140000
LR 8,15 # Base register 00150000
[Configuration]
FontName=DejaVu Sans Mono 9
MiscAlwaysShowTabs=FALSE
MiscBell=FALSE
MiscBellUrgent=FALSE
MiscBordersDefault=TRUE
MiscCursorBlinks=FALSE
MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK
MiscDefaultGeometry=120x42
MiscInheritGeometry=FALSE
#!/usr/bin/env python3
from datetime import datetime
import sys
import re
if len(sys.argv) < 6:
print("\nTK4- ANSI art to HLASM Tool\n\nUsage:")
usage = '''{} ansi_file tk4_user source_file_member cursor_x cursor_y > JCL_FILE\n

Simple (LOL) CICS DOGE "Good Morning" screen (i.e. overly complicated hello world)

CICS is like this mystery wrapped in an enigma wrapped in a riddle. Sure you've heard about it, your company might even rely on it day to day for some really important transactions. But if you wanted to quickly learn how to write and deploy a CICS transaction (or application) its basically impossible. Sure you could grab the Murach book, which is great, but its not a 101 level tutorial, they don't even comment about how to use CEDA to install your cics program and mention compiling COBOL and assembling maps in passing.

Throughout this writeup I'm going to refer to CICS like a web server. Yes, i know its the proto-webserver. I don't care, its the roaring 20's. With that in mind, some quick terminology:

  • Transaction: 4 characters long, think of this like a URL. We'll use DOGE as our transaction.
  • Region: This is like "servers". Imagine you had 3 tomcat servers running on different ports, same deal here, except we call th
//COBCOMP JOB 'Compile COBOL',NOTIFY=&SYSUID
//IBMLIB JCLLIB ORDER=DFH520.CICS.SDFHPROC
//* make sure that the PROGLIB in the DFHYITVL is pointed
//* to your CICS loadlib. If you are not sure about this
//* you can go to The JESJCL of the job for your CICS
//* region in Spool and check for DFHRPL dd statement.
//CPLSTP EXEC DFHYITVL,PROGLIB='USER.CICSLOAD',
// INDEX='DFH520.CICS',
// DSCTLIB='DFH520.CICS.SDFHCOB',
// AD370HLQ='IGY520',
@mainframed
mainframed / x3270pro_color_scheme.py
Created November 8, 2019 00:19
Python script to convert the .Xresources color schemes from https://ciembor.github.io/4bit/# to .x3270pro format
#!/usr/bin/env python3
import json
import re
import math
import sys
# From http://jonasjacek.github.io/colors/
map = '[{"colorId":0,"hexString":"#000000","rgb":{"r":0,"g":0,"b":0},"hsl":{"h":0,"s":0,"l":0},"name":"Black"},{"colorId":1,"hexString":"#800000","rgb":{"r":128,"g":0,"b":0},"hsl":{"h":0,"s":100,"l":25},"name":"Maroon"},{"colorId":2,"hexString":"#008000","rgb":{"r":0,"g":128,"b":0},"hsl":{"h":120,"s":100,"l":25},"name":"Green"},{"colorId":3,"hexString":"#808000","rgb":{"r":128,"g":128,"b":0},"hsl":{"h":60,"s":100,"l":25},"name":"Olive"},{"colorId":4,"hexString":"#000080","rgb":{"r":0,"g":0,"b":128},"hsl":{"h":240,"s":100,"l":25},"name":"Navy"},{"colorId":5,"hexString":"#800080","rgb":{"r":128,"g":0,"b":128},"hsl":{"h":300,"s":100,"l":25},"name":"Purple"},{"colorId":6,"hexString":"#008080","rgb":{"r":0,"g":128,"b":128},"hsl":{"h":180,"s":100,"l":25},"name":"Teal"},{"colorId":7,"hexString":"#c0c0c0","rgb":{"r":192,"g":192,"b":192},"hsl":{"h":0,"s":0,"l":75},"name":"Silver"},{"colorId":8,"hexString":"#
@mainframed
mainframed / OMVSenum.sh
Created October 23, 2019 01:05
OMVSenum.sh
#!/bin/sh
# Special Thanks: @bigendiansmalls for some commands and help
# Mainframe hackers 4 lyfe
# based on LinEnum.sh
#Config
useful="nc netcat wget nmap gcc python curl"
compilers="c89 c99 c++ xlc cc javac"
username=`logname`
@mainframed
mainframed / nmap_stuff.sh
Created October 3, 2019 22:57
Quick little nmap things for red team engagements
# Taken straight from https://youtu.be/kf829-tm0VM?t=1181
alias nmap='sudo nmap -g53 --randomize-hosts --script-args http.useragent="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0i" '
@mainframed
mainframed / markdown_to_ispf.py
Last active June 3, 2022 16:10
Python script to create an ISPF panel from markdown
#!/usr/bin/env python
import os
import re
def make_header(name):
return ''')ATTR DEFAULT(%+_)
% type(text) intens(high)
~ type(text) intens(high) caps(off) just(asis ) color(red)
+ type(text) color(turq) caps(off)
` type(text) intens(high) caps(off) just(asis) color(yellow)