Skip to content

Commit 2587595

Browse files
committed
Land rapid7#5556, vprint_status fix
2 parents 6ec8488 + b994801 commit 2587595

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

lib/msf/core/exploit/dhcp.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ def initialize(info = {})
3636

3737
def start_service(hash = {}, context = {})
3838
@dhcp = Rex::Proto::DHCP::Server.new(hash, context)
39-
print_status("Starting DHCP server") if datastore['VERBOSE']
39+
vprint_status("Starting DHCP server")
4040
@dhcp.start
4141
add_socket(@dhcp.sock)
4242
@dhcp
4343
end
4444

4545
def stop_service
46-
print_status("Stopping DHCP server") if datastore['VERBOSE']
46+
vprint_status("Stopping DHCP server")
4747
@dhcp.stop
4848
end
4949

lib/msf/core/exploit/tftp.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ def initialize(info = {})
2020
def start_service(tag, exe)
2121
@tftp = Rex::Proto::TFTP::Server.new
2222
@tftp.register_file(tag, exe)
23-
print_status("Starting TFTP server to host \"#{tag}\" (#{exe.length} bytes)") if datastore['VERBOSE']
23+
vprint_status("Starting TFTP server to host \"#{tag}\" (#{exe.length} bytes)")
2424
@tftp.start
2525
add_socket(@tftp.sock)
2626
@tftp
2727
end
2828

2929
def stop_service
30-
print_status("Stopping TFTP server") if datastore['VERBOSE']
30+
vprint_status("Stopping TFTP server")
3131
@tftp.stop
3232
end
3333

modules/auxiliary/spoof/replay/pcap_replay.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def run
4747
open_pcap
4848
print_status("Sending file...") unless verbose
4949
while (loop > 0 or infinity) do
50-
vprint_status("Sending file (loop : #{count = count + 1})")
50+
vprint_status("Sending file (loop: #{count = count + 1})")
5151
inject_pcap(filename, file_filter, pkt_delay )
5252
loop -= 1 unless infinity
5353
Kernel.select(nil, nil, nil, (delay * 1.0)/1000) if loop > 0 or infinity

modules/exploits/multi/http/jboss_invoke_deploy.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def check
102102
return Exploit::CheckCode::Appears if res.body =~ /SVNTag=JBoss_4_/
103103
return Exploit::CheckCode::Appears if res.body =~ /SVNTag=JBoss_5_/
104104

105-
if res.body =~ /ServletException/ # Simple check, if we caused an exception.
105+
if res.body =~ /ServletException/ # Simple check, if we caused an exception.
106106
vprint_status('Target seems vulnerable, but the used JBoss version is not supported by this exploit')
107107
return Exploit::CheckCode::Appears
108108
end
@@ -302,13 +302,13 @@ def call_uri_mtimes(uri, num_attempts = 5, verb = nil, data = nil)
302302
elsif res.code < 200 || res.code >= 300
303303
msg = "http request failed to #{uri} [#{res.code}]"
304304
elsif res.code == 200
305-
print_status("Successfully called '#{uri}'") if datastore['VERBOSE']
305+
vprint_status("Successfully called '#{uri}'")
306306
return res
307307
end
308308

309309
if attempt < num_attempts - 1
310310
msg << ', retrying in 5 seconds...'
311-
print_status(msg) if datastore['VERBOSE']
311+
vprint_status(msg)
312312
select(nil, nil, nil, 5)
313313
else
314314
print_error(msg)

modules/post/multi/manage/shell_to_meterpreter.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ def run
7878
lplat = [Msf::Platform::Windows]
7979
larch = [ARCH_X86]
8080
psh_arch = 'x86'
81-
print_status("Platform: Windows") if datastore['VERBOSE']
81+
vprint_status("Platform: Windows")
8282
when /osx/i
8383
platform = 'python'
8484
payload_name = 'python/meterpreter/reverse_tcp'
85-
print_status("Platform: OS X") if datastore['VERBOSE']
85+
vprint_status("Platform: OS X")
8686
when /solaris/i
8787
platform = 'python'
8888
payload_name = 'python/meterpreter/reverse_tcp'
89-
print_status("Platform: Solaris") if datastore['VERBOSE']
89+
vprint_status("Platform: Solaris")
9090
else
9191
# Find the best fit, be specific with uname to avoid matching hostname or something else
9292
target_info = cmd_exec('uname -mo')
@@ -96,16 +96,16 @@ def run
9696
payload_name = 'linux/x86/meterpreter/reverse_tcp'
9797
lplat = [Msf::Platform::Linux]
9898
larch = [ARCH_X86]
99-
print_status("Platform: Linux") if datastore['VERBOSE']
99+
vprint_status("Platform: Linux")
100100
elsif cmd_exec('python -V') =~ /Python (2|3)\.(\d)/
101101
# Generic fallback for OSX, Solaris, Linux/ARM
102102
platform = 'python'
103103
payload_name = 'python/meterpreter/reverse_tcp'
104-
print_status("Platform: Python [fallback]") if datastore['VERBOSE']
104+
vprint_status("Platform: Python [fallback]")
105105
end
106106
end
107107
payload_name = datastore['PAYLOAD_OVERWRITE'] if datastore['PAYLOAD_OVERWRITE']
108-
print_status("Upgrade payload: #{payload_name}") if datastore['VERBOSE']
108+
vprint_status("Upgrade payload: #{payload_name}")
109109

110110
if platform.blank?
111111
print_error("Shells on the the target platform, #{session.platform}, cannot be upgraded to Meterpreter at this time.")
@@ -129,26 +129,26 @@ def run
129129
case platform
130130
when 'win'
131131
if (have_powershell?) && (datastore['WIN_TRANSFER'] != 'VBS')
132-
print_status("Transfer method: Powershell") if datastore['VERBOSE']
132+
vprint_status("Transfer method: Powershell")
133133
psh_opts = { :prepend_sleep => 1, :encode_inner_payload => true, :persist => false }
134134
cmd_exec(cmd_psh_payload(payload_data, psh_arch, psh_opts))
135135
else
136136
print_error('Powershell is not installed on the target.') if datastore['WIN_TRANSFER'] == 'POWERSHELL'
137-
print_status("Transfer method: VBS [fallback]") if datastore['VERBOSE']
137+
vprint_status("Transfer method: VBS [fallback]")
138138
exe = Msf::Util::EXE.to_executable(framework, larch, lplat, payload_data)
139139
aborted = transmit_payload(exe)
140140
end
141141
when 'python'
142-
print_status("Transfer method: Python") if datastore['VERBOSE']
142+
vprint_status("Transfer method: Python")
143143
cmd_exec("python -c \"#{payload_data}\"")
144144
else
145-
print_status("Transfer method: Bourne shell [fallback]") if datastore['VERBOSE']
145+
vprint_status("Transfer method: Bourne shell [fallback]")
146146
exe = Msf::Util::EXE.to_executable(framework, larch, lplat, payload_data)
147147
aborted = transmit_payload(exe)
148148
end
149149

150150
if datastore['HANDLER']
151-
print_status("Cleaning up handler") if datastore['VERBOSE']
151+
vprint_status("Cleaning up handler")
152152
cleanup_handler(listener_job_id, aborted)
153153
end
154154
return nil
@@ -188,7 +188,7 @@ def transmit_payload(exe)
188188
total_bytes = 0
189189
cmds.each { |cmd| total_bytes += cmd.length }
190190

191-
print_status("Starting transfer...") if datastore['VERBOSE']
191+
vprint_status("Starting transfer...")
192192
begin
193193
#
194194
# Run the commands one at a time
@@ -230,7 +230,7 @@ def cleanup_handler(listener_job_id, aborted)
230230
framework.threads.spawn('ShellToMeterpreterUpgradeCleanup', false) {
231231
if !aborted
232232
timer = 0
233-
print_status("Waiting up to #{HANDLE_TIMEOUT} seconds for the session to come back") if datastore['VERBOSE']
233+
vprint_status("Waiting up to #{HANDLE_TIMEOUT} seconds for the session to come back")
234234
while !framework.jobs[listener_job_id].nil? && timer < HANDLE_TIMEOUT
235235
sleep(1)
236236
timer += 1

modules/post/windows/gather/credentials/spark_im.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def run
131131
end
132132

133133
hash = pass.split("password").join.chomp
134-
print_status("Spark password hash: #{hash}") if datastore['VERBOSE']
134+
vprint_status("Spark password hash: #{hash}")
135135

136136
# call method to decrypt hash
137137
decrypt(hash)

0 commit comments

Comments
 (0)