Skip to content

Instantly share code, notes, and snippets.

View mainframed's full-sized avatar

Soldier of FORTRAN mainframed

View GitHub Profile
/* 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
@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:
@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 / conver_machine_carriage_to_md.py
Created August 15, 2021 19:02
Convert ANSI carriage control characters to markdown/text
#!/usr/bin/env python3
import sys
# ANSI carriage control characters
# Some MVS documents use 0/1/+/- as carriage control. This python will
# convert them to markdown/text. The standard ANSI characters are:
#
# - `space` Single space the line and print.
# - `0` Double space the line and print.
@mainframed
mainframed / docker usstable
Created August 15, 2021 15:04
Docker USS Table/HLASM
[+] ANSi to EBCDiC Starting
[+] Arguments:
ANSi File: /home/phil/Downloads/docker.ans
Type: z/OS USSTable (VTAM)
Jobname: AWESOME
Dataset: ANSI.ART
Member: ANSIART
Cursor: (IC)
Location: 22,68
#!/usr/bin/env bash
# Download Xresources from https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/Xresources
# Then use this USSTABLE: https://github.com/mainframed/usstable/blob/master/demo_screen.jcl
pro=~/.x3270pro
# Change delay time if you need to
SLEEPY=1
echo "[+] Xresources folder:" $1
@mainframed
mainframed / google_totp.rexx
Created July 29, 2021 02:54
Google TOTP Authenticator in REXX
/* Rexx */
/* z/OS Google Authenticator TOTP POC */
/* Argument: base32 secret key */
/* Output: TOTP Token */
/* Q License */
/* Author Phil 'Soldier of FORTRAN' Young */
NUMERIC DIGITS 10
parse ARG secretkey
@mainframed
mainframed / BASE64.rx
Last active March 20, 2021 09:55
Rexx script to base64 encode files in TSO, OMVS and IXRJCL
/* REXX */
/* Script to base64 encode files on mainframes */
/* -D prints debug messages */
/* In tso: */
/* BASE64 IN.DATA.SET */
/* BASE64 IN.DATA.SET(MEMBER) */
/* BASE64 IN.DATA.SET(MEMBER) OUT.SEQ.DATA.SET <-- MUST BE SEQUENTIAL*/
/* BASE64 IN.DATA.SET(MEMBER) OUT.SEQ.DATA.SET -D */
/* BASE64 IN.DATA.SET(MEMBER) -D */
/* With IXRJCL: */
@mainframed
mainframed / recursive-unxmit-2.0.sh
Created September 17, 2020 20:34
Use rdrprep and recv370 to extract XMI files
#!/bin/bash
#A files with XMI header?
TEMP=$1
XMIT=$2
if [ $# -eq 0 ]
then
echo "[!] Temp dataset argument for XMIT extract required"