Skip to content

Instantly share code, notes, and snippets.

View mainframed's full-sized avatar

Soldier of FORTRAN mainframed

View GitHub Profile
@mainframed
mainframed / COMPILE.JCL
Created February 16, 2019 01:50
Used to compile HLASM in TEST mode so you can use TSO TEST
//SOF1C JOB (ASSY),'COMPILE IT',CLASS=A,MSGCLASS=Y,
// NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//* Use this JCL to compile HLASM in TEST mode
//* So you can use TSO TEST to debug
// SET FILE=APFLISTC
//ASM EXEC PROC=HLASMCL,PARM.L=(TEST),PARM.C=(TEST)
//SYSIN DD DSN=SOF.ASM.SOURCE(&FILE),DISP=(SHR)
//C.SYSLIB DD DISP=SHR,DSN=SYS1.MACLIB
// DD DISP=SHR,DSN=SYS1.MODGEN
//L.SYSLMOD DD DSN=SOF.ASM.BIN(&FILE),DISP=(SHR)
@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
#!/usr/bin/env python
import tweepy
import sys
# argument 1 is the tweet, argument 2 is the path to the image
def get_api(cfg):
auth = tweepy.OAuthHandler(cfg['consumer_key'], cfg['consumer_secret'])
auth.set_access_token(cfg['access_token'], cfg['access_token_secret'])
return tweepy.API(auth)
S.No Clist Command Its USE
1 &DATATYPE &DATATYPE is used to determine the data type of an expression.
2 &EVAL &EVAL forces numeric evaluation of the expression that is passed to the function.
3 &LASTCC The &LASTCC variable contains the return code from the last TSO command,subcommand, CLIST statement, or nested CLIST that was executed.
4 &LENGTH The &LENGTH function returns the number of bytes occupied by an expression or character string.
5 &MAXCC The &MAXCC variable contains the highest return code from any TSO command,subcommand, CLIST statement, or nested CLIST that was executed while the current CLIST is active.
6 &NRSTR The &NRSTR function defines a non-rescannable string.
7 &STR The &STR function is used to pass character data to a CLIST without any CLIST language evaluation being done on the data.
8 &SUBSTR The &SUBSTR function is used to extract a character string from within another character string. 
9 &SYS_VARIABLES TSO/E contains certain control variables which are available for use in CLISTs
@mainframed
mainframed / fake_credit.py
Created June 6, 2019 21:04
Generate fake credit card profiles for DB2
#!/usr/bin/env python
from faker import Faker
fake = Faker()
for i in xrange(1000000):
x = fake.credit_card_full().splitlines()
a = fake.address().splitlines()
print x[1] + " " + x[2] + ' ' + x[3].split()[1] + " " + a[0] + " " + a[1]
@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)
@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 / 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 / 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":"#