Skip to content

Instantly share code, notes, and snippets.

View mainframed's full-sized avatar

Soldier of FORTRAN mainframed

View GitHub Profile

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
/* REXX */
parse arg len
SAY "LISTUSER RACF User Enumeration Tool"
SAY "VER 1"
/* License: GPLv3 */
ALPHANUM = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'
DO I=1 to 36
S1 = RIGHT(LEFT(ALPHANUM,I),1)
DO J=1 to 36
#!/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
@mainframed
mainframed / dosbox_ppp.sh
Last active February 19, 2023 02:23
This script lets you connect Windows 3.11 to the internet with PPP and Trumpet WinSock in DOSBox
#!/bin/bash
#
# Heavily Modified from: https://www.dosbox.com/wiki/PPP_configuration_on_linux_host
#
# Usage:
# sudo ./isp.sh
#
# This script makes it so you can browse the net with DOSBox and Trumpet Winsock in
# Windows 3.11
#
@mainframed
mainframed / XMITRCV.MVSCE.JCL
Created February 1, 2023 05:13
NJE38 TRANSMIT & RECIEVE
//NJE38 JOB (TSO),
// 'Install NJE38',
// CLASS=A,
// MSGCLASS=H,
// MSGLEVEL=(1,1),
// USER=IBMUSER,
// PASSWORD=SYS1
/*JOBPARM LINES=1000
//*
//* This JCL does 4 things:
//SKELLY JOB (ASSY),'SKELLY',CLASS=A,MSGCLASS=Y, 00010000
// 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
@mainframed
mainframed / BSidesSD.jcl
Created October 25, 2022 14:56
BSidesSD NETSOL EBCDIC ART
[+] ANSi to EBCDiC Starting
[+] Arguments:
ANSi File: bsdiesSD.ans
Jobname: AWESOME
Dataset: ANSI.ART
Member: ANSIART
Cursor: (IC)
Location: 22,20
Input length: 20
@mainframed
mainframed / xdo2horizon.sh
Last active June 24, 2022 23:51
Powershell in Horizon
#!/bin/bash
#set -x
WID=$(xdotool search --class "vmware"|tail -1)
echo "[+] Found WID of Horizon client $WID"
xdotool windowactivate $WID
POS=$(xdotool getwindowgeometry $WID | awk -F "[, ]" 'NR==2{print $4 " " $5}')
GEO=$(xdotool getwindowgeometry $WID | awk -F "[x]" 'NR==3{print $1 " " $2}')
GEO=${GEO:13}
echo "[+] Horizon Client Geometry $GEO"
echo "[+] Horizon Client Position $POS"
@mainframed
mainframed / upload_compile.sh
Created February 16, 2019 01:54
bash script to upload then compile your hlasm with JCL. Could use EOF and tmp files but good enough for now
#!/bin/bash
echo "[+] Uploading and Compiling"
HLASM=`echo $1|awk -F. '{print $1}'`
JCL=$2
HOST='SMOG'
echo "[+] HLASM File: $1 to $HLASM"
echo "[+] JCL File: $JCL"
echo "[+] Host: $HOST"
ftp -iv $HOST <<END_SCRIPT
passive
@mainframed
mainframed / add_racf_user.py
Last active June 3, 2022 16:10
A really poorly comments/edited Python 2.7 script to add users to ADCD z/OS expects a file name with users and name
#!/usr/bin/python
# To use this program:
# ./add_racf_user.py users.txt
# users.txt has either a username (max 7 chars, must start with a letter)
# or a name (two words seperated by a space)
from ftplib import FTP #For FTP stuff
import time #needed for sleep
import os #to manipulate people... uh I mean files