Path: blob/master/spec/lib/msf/base/sessions/mainframe_shell_spec.rb
24767 views
# -*- coding:binary -*-1require 'spec_helper'23##4#5# A quick test that MainframeShell is operable6# Author: Bigendian Smalls7#8RSpec.describe Msf::Sessions::MainframeShell do9it 'extends Msf::Sessions::CommandShell to include EBCDIC cp1047 codepage translation' do10args=[0,11{:datastore=>12{"VERBOSE"=>false,13"WfsDelay"=>0,14"EnableContextEncoding"=>false,15"DisablePayloadHandler"=>false,16"ConnectTimeout"=>10,17"TCP::max_send_size"=>0,18"TCP::send_delay"=>0,19"RPORT"=>4444,20"payload"=>"mainframe/shell_reverse_notranslate_tcp",21"LPORT"=>5555,22"LHOST"=>"127.0.0.1",23"RHOST"=>"127.0.0.2",24"CPORT"=>0,25"ReverseConnectRetries"=>5,26"ReverseAllowProxy"=>false,27"ReverseListenerThreaded"=>false,28"InitialAutoRunScript"=>"",29"AutoRunScript"=>"",30"ReverseListenerBindPort"=>0,31"TARGET"=>0},32:expiration=>0,33:comm_timeout=>0,34:retry_total=>0,35:retry_wait=>0}]36expect(described_class.name).to eq('Msf::Sessions::MainframeShell')37mfshell = Msf::Sessions::MainframeShell.new(args)38expect(mfshell.platform).to eq('mainframe')39expect(mfshell.arch).to eq('zarch')40expect(mfshell.respond_to?(:translate_1047))41end42end434445