Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/payloads/singles/cmd/mainframe/generic_jcl.rb
Views: 11780
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45##6# This is a prototype JCL command payload for z/OS - mainframe.7# It submits the IEFBR14 standard z/OS program, which does nothing8# but complete successfully and return code 0.9#10# See http://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ieab500/hpropr.htm?lang=en11# for more information on IEFBR1412##131415module MetasploitModule16CachedSize = 15017include Msf::Payload::Single18include Msf::Payload::Mainframe19include Msf::Sessions::CommandShellOptions2021def initialize(info = {})22super(merge_info(info,23'Name' => 'Generic JCL Test for Mainframe Exploits',24'Description' => 'Provide JCL which can be used to submit25a job to JES2 on z/OS which will exit and return 0. This26can be used as a template for other JCL based payloads',27'Author' => 'Bigendian Smalls',28'License' => MSF_LICENSE,29'Platform' => 'mainframe',30'Arch' => ARCH_CMD,31'Handler' => Msf::Handler::None,32'Session' => Msf::Sessions::MainframeShell,33'PayloadType' => 'cmd',34'RequiredCmd' => 'jcl',35'Payload' =>36{37'Offsets' => {},38'Payload' => ''39}))40register_options(41[42OptString.new('ACTNUM', [true, "Accounting info for JCL JOB card", "MSFUSER-ACCTING-INFO"]),43OptString.new('PGMNAME', [true, "Programmer name for JCL JOB card", "programmer name"]),44OptString.new('JCLASS', [true, "Job Class for JCL JOB card", "A"]),45OptString.new('NOTIFY', [false, "Notify User for JCL JOB card", ""]),46OptString.new('MSGCLASS', [true, "Message Class for JCL JOB card", "Z"]),47OptString.new('MSGLEVEL', [true, "Message Level for JCL JOB card", "(0,0)"])48],49self.class50)51register_advanced_options(52[53OptBool.new('NTFYUSR', [true, "Include NOTIFY Parm?", false]),54OptString.new('JOBNAME', [true, "Job name for JCL JOB card", "DUMMY"])55],56self.class57)58end5960##61# Construct Payload62##63def generate(_opts = {})64super + command_string65end6667##68# Setup replacement vars from options if need be69##70def command_string71jcl_jobcard +72"// EXEC PGM=IEFBR14\n"73end74end757677