Skip to content

Commit ff96101

Browse files
author
Brent Cook
committed
Land rapid7#5218, fix rapid7#3816, remove print_debug / DEBUG
2 parents 27f6adc + 3db0e12 commit ff96101

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+158
-224
lines changed

lib/msf/core/exploit/http/server.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,7 @@ def print_good(msg='')
9292
def print_error(msg='')
9393
(cli) ? super("#{cli.peerhost.ljust(16)} #{self.shortname} - #{msg}") : super
9494
end
95-
# :category: print_* overrides
96-
# Prepends client and module name if inside a thread with a #cli
97-
def print_debug(msg='')
98-
(cli) ? super("#{cli.peerhost.ljust(16)} #{self.shortname} - #{msg}") : super
99-
end
95+
10096
#
10197
# :category: print_* overrides
10298
# Prepends client and module name if inside a thread with a #cli
@@ -126,11 +122,6 @@ def vprint_error(msg='')
126122
end
127123
# :category: print_* overrides
128124
# Prepends client and module name if inside a thread with a #cli
129-
def vprint_debug(msg='')
130-
(cli) ? super("#{cli.peerhost.ljust(16)} #{self.shortname} - #{msg}") : super
131-
end
132-
# :category: print_* overrides
133-
# Prepends client and module name if inside a thread with a #cli
134125
def vprint_warning(msg='')
135126
(cli) ? super("#{cli.peerhost.ljust(16)} #{self.shortname} - #{msg}") : super
136127
end

lib/msf/core/exploit/remote/browser_exploit_server.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def get_bad_requirements(profile)
219219

220220
@requirements.each do |k, v|
221221
expected = k != :vuln_test ? v : 'true'
222-
vprint_debug("Comparing requirement: #{k}=#{expected} vs #{k}=#{profile[k.to_sym]}")
222+
vprint_status("Comparing requirement: #{k}=#{expected} vs #{k}=#{profile[k.to_sym]}")
223223

224224
if k == :activex
225225
bad_reqs << k if has_bad_activex?(profile[k.to_sym])
@@ -334,7 +334,7 @@ def process_browser_info(source, cli, request)
334334
when :script
335335
# Gathers target data from a POST request
336336
parsed_body = CGI::parse(Rex::Text.decode_base64(request.body) || '')
337-
vprint_debug("Received sniffed browser data over POST: \n#{parsed_body}.")
337+
vprint_status("Received sniffed browser data over POST: \n#{parsed_body}.")
338338
parsed_body.each { |k, v| update_profile(target_info, k.to_sym, v.first) }
339339
when :headers
340340
# Gathers target data from headers

lib/msf/core/module/ui/message/verbose.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
module Msf::Module::UI::Message::Verbose
2-
# Verbose version of #print_debug
3-
def vprint_debug(msg)
4-
print_debug(msg) if datastore['VERBOSE'] || framework.datastore['VERBOSE']
5-
end
6-
72
# Verbose version of #print_error
83
def vprint_error(msg)
94
print_error(msg) if datastore['VERBOSE'] || framework.datastore['VERBOSE']

lib/msf/core/plugin.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,6 @@ def print_good(msg='')
119119
output.print_good(msg) if (output)
120120
end
121121

122-
#
123-
# Prints a 'debug' message.
124-
#
125-
def print_debug(msg='')
126-
output.print_debug(msg) if (output)
127-
end
128-
129122
#
130123
# Prints a status line.
131124
#

lib/msf/core/post/windows/registry.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ def meterpreter_registry_loadkey(key, file)
331331
begin
332332
client.sys.config.getprivs()
333333
root_key, base_key = session.sys.registry.splitkey(key)
334-
#print_debug("Loading file #{file}")
335334
begin
336335
loadres = session.sys.registry.load_key(root_key, base_key, file)
337336
rescue Rex::Post::Meterpreter::RequestError => e
@@ -349,7 +348,6 @@ def meterpreter_registry_loadkey(key, file)
349348
#print_error("An unknown error has occurred: #{loadres.to_s}")
350349
return false
351350
else
352-
#print_debug("Registry Hive Loaded Successfully: #{key}")
353351
return true
354352
end
355353
end
@@ -377,7 +375,6 @@ def meterpreter_registry_unloadkey(key)
377375
#print_error("An unknown error has occurred: #{unloadres.to_s}")
378376
return false
379377
else
380-
#print_debug("Registry Hive Unloaded Successfully: #{key}")
381378
return true
382379
end
383380
end

lib/msf/http/typo3/login.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ def typo3_backend_login(user, pass)
3232
end
3333
n = n_match[1]
3434

35-
vprint_debug("e: #{e}")
36-
vprint_debug("n: #{n}")
35+
vprint_status("e: #{e}")
36+
vprint_status("n: #{n}")
3737
rsa_enc = typo3_helper_login_rsa(e, n, pass)
38-
vprint_debug("RSA Hash: #{rsa_enc}")
38+
vprint_status("RSA Hash: #{rsa_enc}")
3939
# make login request
4040
vars_post = {
4141
'n' => '',
@@ -58,10 +58,10 @@ def typo3_backend_login(user, pass)
5858
})
5959
if res_login
6060
if res_login.body =~ /<!-- ###LOGIN_ERROR### begin -->(.*)<!-- ###LOGIN_ERROR### end -->/im
61-
vprint_debug(strip_tags($1))
61+
vprint_status(strip_tags($1))
6262
return nil
6363
elsif res_login.body =~ /<p class="t3-error-text">(.*?)<\/p>/im
64-
vprint_debug(strip_tags($1))
64+
vprint_status(strip_tags($1))
6565
return nil
6666
else
6767
cookies = res_login.get_cookies

lib/rex/io/bidirectional_pipe.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ def print_good(msg='')
8787
print_line('[+] ' + msg)
8888
end
8989

90-
def print_debug(msg='')
91-
print_line('[!] ' + msg)
92-
end
93-
9490
def flush
9591
end
9692

lib/rex/ui/output.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ def print_error(msg='')
3030
def print_good(msg='')
3131
end
3232

33-
def print_debug(msg='')
34-
end
35-
3633
#
3734
# Prints a status line.
3835
#

lib/rex/ui/subscriber.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,6 @@ def print_good(msg='')
5656
end
5757
end
5858

59-
#
60-
# Wraps user_output.print_debug
61-
#
62-
def print_debug(msg='')
63-
if (user_output)
64-
print_blank_line if user_output.prompting?
65-
user_output.print_debug(msg)
66-
end
67-
end
68-
6959
#
7060
# Wraps user_output.print_warning
7161
#

lib/rex/ui/text/output.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ def print_good(msg = '')
5555
print_line("%bld%grn[+]%clr #{msg}")
5656
end
5757

58-
def print_debug(msg = '')
59-
print_line("%bld%cya[!]%clr #{msg}")
60-
end
61-
6258
def print_status(msg = '')
6359
print_line("%bld%blu[*]%clr #{msg}")
6460
end

0 commit comments

Comments
 (0)