Skip to content

Commit d9f4a84

Browse files
committed
Land rapid7#3548, peer rhost fix
2 parents 066a5e2 + 5ba96d6 commit d9f4a84

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

modules/auxiliary/scanner/http/mediawiki_svg_fileaccess.rb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -218,58 +218,58 @@ def read_data
218218
end
219219

220220
def accessfile(rhost)
221-
vprint_status("#{peer(rhost)} MediaWiki - Getting unauthenticated session...")
221+
vprint_status("#{peer} MediaWiki - Getting unauthenticated session...")
222222
@wiki_session_name, @wiki_session = get_first_session
223223
if @wiki_session.nil?
224-
print_error("#{peer(rhost)} MediaWiki - Failed to get unauthenticated session...")
224+
print_error("#{peer} MediaWiki - Failed to get unauthenticated session...")
225225
return
226226
end
227-
vprint_status("#{peer(rhost)} Sessioncookie: #{@wiki_session_name}=#{@wiki_session}")
227+
vprint_status("#{peer} Sessioncookie: #{@wiki_session_name}=#{@wiki_session}")
228228

229229
if @user and not @user.empty? and @password and not @password.empty?
230-
vprint_status("#{peer(rhost)} MediaWiki - Getting login token...")
230+
vprint_status("#{peer} MediaWiki - Getting login token...")
231231
@login_token = get_login_token
232232
if @login_token.nil?
233-
print_error("#{peer(rhost)} MediaWiki - Failed to get login token")
233+
print_error("#{peer} MediaWiki - Failed to get login token")
234234
return
235235
end
236-
vprint_status("#{peer(rhost)} Logintoken: #{@login_token}")
236+
vprint_status("#{peer} Logintoken: #{@login_token}")
237237

238238
if not authenticate
239-
print_error("#{peer(rhost)} MediaWiki - Failed to authenticate")
239+
print_error("#{peer} MediaWiki - Failed to authenticate")
240240
return
241241
end
242-
vprint_status("#{peer(rhost)} Userid cookie: #{@wiki_user_id_name}=#{@wiki_user_id}")
243-
vprint_status("#{peer(rhost)} Username cookie: #{@wiki_user_name_name}=#{@wiki_user_name}")
244-
vprint_status("#{peer(rhost)} Session cookie: #{@wiki_session_name}=#{@wiki_session}")
242+
vprint_status("#{peer} Userid cookie: #{@wiki_user_id_name}=#{@wiki_user_id}")
243+
vprint_status("#{peer} Username cookie: #{@wiki_user_name_name}=#{@wiki_user_name}")
244+
vprint_status("#{peer} Session cookie: #{@wiki_session_name}=#{@wiki_session}")
245245
end
246246

247-
vprint_status("#{peer(rhost)} MediaWiki - Getting edit token...")
247+
vprint_status("#{peer} MediaWiki - Getting edit token...")
248248
@edit_token = get_edit_token
249249
if @edit_token.nil?
250-
print_error("#{peer(rhost)} MediaWiki - Failed to get edit token")
250+
print_error("#{peer} MediaWiki - Failed to get edit token")
251251
return
252252
end
253-
vprint_status("#{peer(rhost)} Edittoken: #{@edit_token}")
253+
vprint_status("#{peer} Edittoken: #{@edit_token}")
254254

255-
vprint_status("#{peer(rhost)} MediaWiki - Uploading SVG file...")
255+
vprint_status("#{peer} MediaWiki - Uploading SVG file...")
256256
@svg_uri = upload_file
257257
if @svg_uri.nil?
258-
print_error("#{peer(rhost)} MediaWiki - Failed to upload SVG file")
258+
print_error("#{peer} MediaWiki - Failed to upload SVG file")
259259
return
260260
end
261-
vprint_status("#{peer(rhost)} SVG URI: #{@svg_uri}")
261+
vprint_status("#{peer} SVG URI: #{@svg_uri}")
262262

263-
vprint_status("#{peer(rhost)} MediaWiki - Retrieving remote file...")
263+
vprint_status("#{peer} MediaWiki - Retrieving remote file...")
264264
loot = read_data
265265
if loot.nil? or loot.empty?
266-
print_error("#{peer(rhost)} MediaWiki - Failed to retrieve remote file")
266+
print_error("#{peer} MediaWiki - Failed to retrieve remote file")
267267
return
268268
end
269269

270270
f = ::File.basename(datastore['RFILE'])
271271
path = store_loot('mediawiki.file', 'application/octet-stream', rhost, loot, f, datastore['RFILE'])
272-
print_status("#{peer(rhost)} MediaWiki - #{datastore['RFILE']} saved in #{path}")
272+
print_status("#{peer} MediaWiki - #{datastore['RFILE']} saved in #{path}")
273273
end
274274

275275
def run

0 commit comments

Comments
 (0)