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/test/functional/meterpreter/meterpreter_specs.rb
Views: 11780
1
module MsfTest
2
module MeterpreterSpecs
3
def self.included(base)
4
base.class_eval do
5
it "should not error when running each command" do
6
commands = [
7
"?",
8
"background",
9
"bgkill",
10
"bglist",
11
"bgrun",
12
"channel",
13
"close",
14
"exit",
15
"help",
16
"interact",
17
# "irb",
18
"migrate",
19
# "quit",
20
"read",
21
"run",
22
"use",
23
"write",
24
"cat",
25
"lcat",
26
"cd",
27
"del",
28
"download",
29
# "edit",
30
"getlwd",
31
"getwd",
32
"lcd",
33
"lpwd",
34
"ls",
35
"mkdir",
36
"pwd",
37
"rm",
38
"rmdir",
39
"search",
40
"upload",
41
"ipconfig",
42
"portfwd",
43
"route",
44
"clearev",
45
"drop_token",
46
"execute",
47
"getpid",
48
"getprivs",
49
"getuid",
50
"kill",
51
"ps",
52
# "reboot",
53
"reg",
54
"rev2self",
55
# "shell",
56
# "shutdown",
57
"steal_token",
58
"sysinfo",
59
"enumdesktops",
60
"getdesktop",
61
"idletime",
62
"keyscan_dump",
63
"keyscan_start",
64
"keyscan_stop",
65
"screenshot",
66
"setdesktop",
67
"uictl",
68
"getsystem",
69
"hashdump",
70
"timestomp"
71
]
72
73
## Run each command, check for execeptions
74
commands.each do |command|
75
hlp_run_command_check_output("basic_#{command}", command)
76
end
77
end
78
79
it "should not error when running help" do
80
success_strings = [
81
'Core Commands',
82
'Stdapi: File system Commands',
83
'Stdapi: Networking Commands',
84
'Stdapi: System Commands',
85
'Stdapi: User interface Commands'
86
]
87
88
hlp_run_command_check_output("help", "help", success_strings)
89
end
90
91
it "should not error when running the help shortcut" do
92
success_strings = [
93
'Core Commands',
94
'Stdapi: File system Commands',
95
'Stdapi: Networking Commands',
96
'Stdapi: System Commands',
97
'Stdapi: User interface Commands'
98
]
99
100
hlp_run_command_check_output("help_shortcut", "?", success_strings)
101
end
102
103
it "should not error when checking for background channels" do
104
success_strings = [ 'No active channels.' ]
105
hlp_run_command_check_output("channel_list_empty", "channel -l", success_strings)
106
end
107
end
108
end
109
end
110
end
111
112