Skip to content

Commit

Permalink
Print target IP/Port when restoring currencies.php
Browse files Browse the repository at this point in the history
  • Loading branch information
sinn3r committed May 28, 2012
1 parent 712a217 commit d615e3b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions modules/exploits/linux/http/webid_converter.rb
Expand Up @@ -81,10 +81,11 @@ def check
end end


def on_new_session(client) def on_new_session(client)
peer = "#{client.peerhost}:#{client.peerport}"


if client.type != "meterpreter" if client.type != "meterpreter"
print_error("NOTE: you must use a meterpreter payload in order to automatically cleanup.") print_error("#{peer} - NOTE: you must use a meterpreter payload in order to automatically cleanup.")
print_error("The currencies.php won't be restored automatically.") print_error("#{peer} - The currencies.php won't be restored automatically.")
return return
end end


Expand All @@ -103,19 +104,19 @@ def on_new_session(client)
currencies_php = currencies_php.gsub(/^\t\t\t/, '') currencies_php = currencies_php.gsub(/^\t\t\t/, '')


pwd = client.fs.dir.pwd pwd = client.fs.dir.pwd
print_status("Searching currencies.php file from #{pwd}") print_status("#{peer} - Searching currencies.php file from #{pwd}")


res = client.fs.file.search(nil, "currencies.php", true, -1) res = client.fs.file.search(nil, "currencies.php", true, -1)
res.each do |hit| res.each do |hit|
filename = "#{hit['path']}/#{hit['name']}" filename = "#{hit['path']}/#{hit['name']}"
print_status("Restoring #{filename}") print_status("#{peer} - Restoring #{filename}")
client.fs.file.rm(filename) client.fs.file.rm(filename)
fd = client.fs.file.new(filename, "wb") fd = client.fs.file.new(filename, "wb")
fd.write(currencies_php) fd.write(currencies_php)
fd.close fd.close
end end


print_status("Cleanup finished") print_status("#{peer} - Cleanup finished")


end end


Expand Down

0 comments on commit d615e3b

Please sign in to comment.