Skip to content

Instantly share code, notes, and snippets.

View mainframed's full-sized avatar

Soldier of FORTRAN mainframed

View GitHub Profile
import tn3270lib,time,sys
# This requires the tn3270lib library available here: https://github.com/zedsec390/tn3270lib
host = sys.argv[1]
port = int(sys.argv[2])
print "Simple Python Script to find LUs"
# Copyright Philip Young
tn3270 = tn3270lib.TN3270()
for i in range(0,99):
# Change 'CICSLU' to whatever your LU is
//USERIDJ JOB (GREP),'Job to search a PDS for passwords',
// NOTIFY=&SYSUID,
// MSGCLASS=H,
// MSGLEVEL=(1,1),
// REGION=0M
//GREP EXEC PGM=ISRSUPC,
// PARM=(SRCHCMP,ANYC,IDPFX,NOPRTCC)
//NEWDD DD DSN=USER.OPS.JCL,DISP=OLD
//* Add further DD datasets here
//* DD DSN=HLQ1.PDS.FILE,DISP=OLD
*rexx*/
/*********************************************/
/* REXX Script to Ping all hosts in class C */
/* By: Soldier of Fortran (@mainframed767) */
/*********************************************/
trace "o"
PARSE SOURCE NAME
Say 'Enter /24 to scan (e.g 10.10.10):'
pull IP
DO OCTET = 1 TO 255
#!/bin/bash
echo "[+] Mainframe Upload Script"
if [ "$#" -ne 5 ]; then
echo "[!] Usage:" $0 "host username password PDS filename"
exit -1
fi
echo "[>] Connecting to" $1 " as" $2 "and uploading"
echo "[>] Uploading" $5 "to PDS" $4
ftp -n <<EOF
@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
#
#!/bin/bash
# Nmap can crash when scanning large ranges
# To use this script, start your scan with whatever
# nmap options you want making sure you use -oA <filename>
# or -oG <filename> (you need the gnmap file) then cancel
# the scan. replace <filename> below and run this script.
# It will also record when it failed to a file called failed.txt
until nmap --resume <filename>.gnmap
@mainframed
mainframed / INFO.REXX
Created November 8, 2017 18:40
Quick REXX script to show user attributes. Used for demos.
/* REXX */
/* Quick REXX script to print LU info nicely */
A = OUTTRAP('OUT.')
ADDRESS TSO "LU"
B = OUTTRAP('OFF')
say WORD(OUT.1,1)
say WORD(OUT.2,1)
SAY OUT.3
#!/bin/sh
#
# This little script will list a lot of datasets and their members
# You need to install tsocmd from ibm (but most people have already)
#
# By SoF
echo " CATList by SoF"
echo ""
echo " [+] Getting Catalog"
@mainframed
mainframed / LISTAPF.REXX
Created January 30, 2018 23:19
Simple rexx script to list APF authorized datasets
/* REXX */
/* Thanks to FILE221 on CBT Tape for mapping this out */
/* Lists APF Authorized datasets */
numeric digits 20 /* need this for D2X/C2D */
CVT = C2D(STORAGE(10,4)) /* CVT Pointer */
CVTAUTHL = C2D(STORAGE(D2X(CVT + 484),4))
IF CVTAUTHL = C2D('7FFFF001'x) THEN DO
/* The APF Table is Dynamic, not Static */
CVTECVT = C2D(STORAGE(D2X(CVT + 140),4))
ECVTCSVT = C2D(STORAGE(D2X(CVTECVT + 228),4))
/* REXX */
/* Maps Storage to find UNIX UID/GID location */
ASCB_PTR = C2X(STORAGE(D2X(X2D("224")),4))
ASXB_PTR = C2X(STORAGE(D2X(X2D(ASCB_PTR) + X2D("6C")),4))
ACEE_PTR = C2X(STORAGE(D2X(X2D(ASXB_PTR) + X2D("C8")),4))
ACEE_LEN = C2D(STORAGE(D2X(X2D(ACEE_PTR) + X2D("14")),1))
ACEE_UID = STORAGE(D2X(X2D(ACEE_PTR) + X2D("15")),ACEE_LEN)
ACEEOCOX = C2X(STORAGE(D2X(X2D(ACEE_PTR) + X2D("98")),4))
ACEX = STORAGE(D2X(X2D(ACEEOCOX)),76)
USP = C2X(STORAGE(D2X(X2D(ACEEOCOX) + X2D("48")),4))