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/windows_meterpreter_specs.rb
Views: 11778
1
module MsfTest
2
module WindowsMeterpreterSpecs
3
## This file is intended to be used in conjunction with a harness,
4
## such as meterpreter_win32_spec.rb
5
6
def self.included(base)
7
base.class_eval do
8
it "should not error when uploading a file to a windows box" do
9
upload_success_strings = [
10
'uploading',
11
'uploaded'
12
]
13
14
## create a file to upload
15
filename = "/tmp/whatever"
16
if File.exist?(filename)
17
FileUtils.rm(filename)
18
end
19
hlp_string_to_file("owned!", filename)
20
21
## run the upload / quit commands
22
hlp_run_command_check_output("upload", "upload #{filename} C:\\", upload_success_strings)
23
# hlp_run_command_check_output("quit","quit")
24
25
## clean up
26
FileUtils.rm(filename)
27
end
28
29
it "should show the priv commands when running help" do
30
success_strings = [
31
'Priv: Elevate Commands',
32
'Priv: Password database Commands',
33
'Priv: Timestomp Commands'
34
]
35
36
hlp_run_command_check_output("help_shortcut", "help", success_strings)
37
end
38
39
it "should not error when taking a screenshot" do
40
success_strings = [ 'Screenshot saved to' ]
41
hlp_run_command_check_output("screenshot", "screenshot", success_strings)
42
end
43
end
44
end
45
end
46
end
47
48