CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

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