Skip to content

Commit ab94f15

Browse files
committed
Take care of modules using the 'DEBUG' option
1 parent 292087c commit ab94f15

File tree

14 files changed

+32
-68
lines changed

14 files changed

+32
-68
lines changed

modules/auxiliary/scanner/http/open_proxy.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def initialize(info = {})
3131
register_options(
3232
[
3333
Opt::RPORT(8080),
34-
OptBool.new('DEBUG', [ false, 'Enable requests debugging output', false ]),
3534
OptBool.new('MULTIPORTS', [ false, 'Multiple ports will be used : 80, 1080, 3128, 8080, 8123', false ]),
3635
OptBool.new('RANDOMIZE_PORTS', [ false, 'Randomize the order the ports are probed', false ]),
3736
OptBool.new('VERIFY_CONNECT', [ false, 'Enable test for CONNECT method', false ]),
@@ -193,10 +192,7 @@ def send_request_ripe(user_agent)
193192
end
194193

195194
def check_host(target_host,target_port,site,user_agent)
196-
197-
if datastore['DEBUG']
198-
print_status("Checking #{target_host}:#{target_port} [#{site}]")
199-
end
195+
vprint_status("Checking #{target_host}:#{target_port} [#{site}]")
200196

201197
is_valid,retcode,retvia,retsrv = send_request(site,user_agent)
202198

modules/auxiliary/scanner/http/robots_txt.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def run_host(target_host)
5656

5757
if not res.body.include?("llow:")
5858
vprint_status("[#{target_host}] #{tpath}robots.txt - Doesn't contain \"llow:\"")
59-
print_status(res.body.inspect) if datastore['DEBUG']
6059
return
6160
end
6261

modules/auxiliary/scanner/natpmp/natpmp_portscan.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ def handle_reply(host, external_addr, pkt)
9393
end
9494
else
9595
state = Msf::ServiceState::Closed
96-
print_status("#{peer} #{external_addr} - #{int}/#{protocol} #{state} because of successful mapping with matched ports") if (datastore['DEBUG'])
96+
vprint_status("#{peer} #{external_addr} - #{int}/#{protocol} #{state} because of successful mapping with matched ports")
9797
end
9898
else
9999
state = Msf::ServiceState::Closed
100-
print_status("#{peer} #{external_addr} - #{int}/#{protocol} #{state} because of code #{result} response") if (datastore['DEBUG'])
100+
vprint_status("#{peer} #{external_addr} - #{int}/#{protocol} #{state} because of code #{result} response")
101101
end
102102

103103
report_service(

modules/auxiliary/server/browser_autopwn.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def initialize(info = {})
7575
OptRegexp.new('EXCLUDE', [false,
7676
'Only attempt to use exploits whose name DOES NOT match this regex'
7777
]),
78-
OptBool.new('DEBUG', [false,
78+
OptBool.new('DEBUG_AUTOPWN', [false,
7979
'Do not obfuscate the javascript and print various bits of useful info to the browser',
8080
false
8181
]),
@@ -232,7 +232,7 @@ def setup
232232
ENDJS
233233
)
234234

235-
if (datastore['DEBUG'])
235+
if (datastore['DEBUG_AUTOPWN'])
236236
print_status("NOTE: Debug Mode; javascript will not be obfuscated")
237237
else
238238
pre = Time.now
@@ -349,7 +349,7 @@ def init_exploit(name, mod = nil, targ = 0)
349349

350350
# For testing, set the exploit uri to the name of the exploit so it's
351351
# easy to tell what is happening from the browser.
352-
if (datastore['DEBUG'])
352+
if (datastore['DEBUG_AUTOPWN'])
353353
@exploits[name].datastore['URIPATH'] = name
354354
else
355355
# randomize it manually since if a saved value exists in the user's
@@ -1056,7 +1056,7 @@ def exploit_resource(name)
10561056
end
10571057

10581058
def js_debug(msg)
1059-
if datastore['DEBUG']
1059+
if datastore['DEBUG_AUTOPWN']
10601060
return "document.body.innerHTML += #{msg};"
10611061
end
10621062
return ""

modules/auxiliary/spoof/llmnr/llmnr_response.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ def initialize
4747
OptInt.new('TTL', [ false, "Time To Live for the spoofed response", 300]),
4848
])
4949

50-
register_advanced_options([
51-
OptBool.new('Debug', [ false, "Determines whether incoming packet parsing is displayed", false])
52-
])
53-
5450
deregister_options('RHOST', 'PCAPFILE', 'SNAPLEN', 'FILTER')
5551
self.thread = nil
5652
self.sock = nil

modules/auxiliary/spoof/nbns/nbns_response.rb

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ def initialize
4646
OptRegexp.new('REGEX', [ true, "Regex applied to the NB Name to determine if spoofed reply is sent", '.*']),
4747
])
4848

49-
register_advanced_options([
50-
OptBool.new('DEBUG', [ false, "Determines whether incoming packet parsing is displayed", false])
51-
])
52-
5349
deregister_options('RHOST', 'PCAPFILE', 'SNAPLEN', 'FILTER')
5450
self.thread = nil
5551
self.sock = nil
@@ -90,20 +86,18 @@ def dispatch_request(packet, rhost, src_port)
9086

9187
vprint_good("#{rhost.ljust 16} nbns - #{nbnsq_decodedname} matches regex, responding with #{spoof}")
9288

93-
if datastore['DEBUG']
94-
print_status("transid: #{nbnsq_transid.unpack('H4')}")
95-
print_status("tlags: #{nbnsq_flags.unpack('B16')}")
96-
print_status("questions: #{nbnsq_questions.unpack('n')}")
97-
print_status("answerrr: #{nbnsq_answerrr.unpack('n')}")
98-
print_status("authorityrr: #{nbnsq_authorityrr.unpack('n')}")
99-
print_status("additionalrr: #{nbnsq_additionalrr.unpack('n')}")
100-
print_status("name: #{nbnsq_name} #{nbnsq_name.unpack('H34')}")
101-
print_status("full name: #{nbnsq_name.slice(1..-2)}")
102-
print_status("decoded: #{decoded}")
103-
print_status("decoded name: #{nbnsq_decodedname}")
104-
print_status("type: #{nbnsq_type.unpack('n')}")
105-
print_status("class: #{nbnsq_class.unpack('n')}")
106-
end
89+
vprint_status("transid: #{nbnsq_transid.unpack('H4')}")
90+
vprint_status("tlags: #{nbnsq_flags.unpack('B16')}")
91+
vprint_status("questions: #{nbnsq_questions.unpack('n')}")
92+
vprint_status("answerrr: #{nbnsq_answerrr.unpack('n')}")
93+
vprint_status("authorityrr: #{nbnsq_authorityrr.unpack('n')}")
94+
vprint_status("additionalrr: #{nbnsq_additionalrr.unpack('n')}")
95+
vprint_status("name: #{nbnsq_name} #{nbnsq_name.unpack('H34')}")
96+
vprint_status("full name: #{nbnsq_name.slice(1..-2)}")
97+
vprint_status("decoded: #{decoded}")
98+
vprint_status("decoded name: #{nbnsq_decodedname}")
99+
vprint_status("type: #{nbnsq_type.unpack('n')}")
100+
vprint_status("class: #{nbnsq_class.unpack('n')}")
107101

108102
# time to build a response packet - Oh YEAH!
109103
response = nbnsq_transid +

modules/exploits/linux/local/pkexec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def initialize(info = {})
5757
OptString.new("WritableDir", [ true, "A directory where we can write files (must not be mounted noexec)", "/tmp" ]),
5858
OptInt.new("Count", [true, "Number of attempts to win the race condition", 500 ]),
5959
OptInt.new("ListenerTimeout", [true, "Number of seconds to wait for the exploit", 60]),
60-
OptBool.new("DEBUG", [ true, "Make the exploit executable be verbose about what it's doing", false ])
60+
OptBool.new("DEBUG_EXPLOIT", [ true, "Make the exploit executable be verbose about what it's doing", false ])
6161
])
6262
end
6363

@@ -327,7 +327,7 @@ def exploit
327327
main.gsub!(/shellcode_size = 0/, "shellcode_size = #{payload.encoded.length}")
328328
main.gsub!(/cmd_path = ""/, "cmd_path = \"#{executable_path}\"")
329329
main.gsub!(/COUNT/, datastore["Count"].to_s)
330-
main.gsub!(/#define dprintf/, "#define dprintf printf") if datastore['DEBUG']
330+
main.gsub!(/#define dprintf/, "#define dprintf printf") if datastore['DEBUG_EXPLOIT']
331331

332332
cpu = nil
333333
if target['Arch'] == ARCH_X86

modules/exploits/multi/browser/firefox_svg_plugin.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def initialize(info = {})
8383
register_options(
8484
[
8585
OptString.new('CONTENT', [ false, "Content to display inside the HTML <body>.", '' ] ),
86-
OptBool.new('DEBUG', [false, "Display some alert()'s for debugging the payload.", false])
86+
OptBool.new('DEBUG_JS', [false, "Display some alert()'s for debugging the payload.", false])
8787
], Auxiliary::Timed)
8888

8989
end
@@ -110,7 +110,7 @@ def flash_trigger
110110
# @return [String] containing javascript that will alert a debug string
111111
# if the DEBUG is set to true
112112
def js_debug(str, quote="'")
113-
if datastore['DEBUG'] then "alert(#{quote}#{str}#{quote})" else '' end
113+
if datastore['DEBUG_JS'] then "alert(#{quote}#{str}#{quote})" else '' end
114114
end
115115

116116
# @return [String] HTML that is sent in the first response to the client

modules/exploits/windows/http/hp_nnm_ovbuildpath_textfile.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,6 @@ def exploit
235235

236236
if res and res.code != 502
237237
print_error("Eek! We weren't expecting a response, but we got one")
238-
if datastore['DEBUG']
239-
print_line()
240-
print_error(res.to_s)
241-
end
242238
end
243239

244240
handler

modules/exploits/windows/http/hp_nnm_webappmon_execvp.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,6 @@ def exploit
157157

158158
if res and res.code != 502
159159
print_error("Eek! We weren't expecting a response, but we got one")
160-
if datastore['DEBUG']
161-
print_error('')
162-
print_error(res.to_s)
163-
end
164160
end
165161

166162
handler

0 commit comments

Comments
 (0)