ftp_anonymous: Store loot
This commit is contained in:
@@ -25,6 +25,7 @@ class MetasploitModule < Msf::Auxiliary
|
|||||||
register_options(
|
register_options(
|
||||||
[
|
[
|
||||||
Opt::RPORT(21),
|
Opt::RPORT(21),
|
||||||
|
OptBool.new('STORE_LOOT', [false, 'Store the directory listing as loot', true])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@@ -51,6 +52,20 @@ class MetasploitModule < Msf::Auxiliary
|
|||||||
version = banner.gsub(/^\d{3}[\s-]/, '').gsub(/\A\(|\)\z/, '').strip
|
version = banner.gsub(/^\d{3}[\s-]/, '').gsub(/\A\(|\)\z/, '').strip
|
||||||
print_good("Anonymous #{access_type} access (#{version})")
|
print_good("Anonymous #{access_type} access (#{version})")
|
||||||
|
|
||||||
|
if datastore['STORE_LOOT']
|
||||||
|
vprint_status("Listing directory contents")
|
||||||
|
listing = send_cmd_data(['LS'], nil)
|
||||||
|
if listing.nil?
|
||||||
|
print_warning('Could not retrieve directory listing (data connection failed)')
|
||||||
|
elsif listing[1].nil? || listing[1].empty?
|
||||||
|
vprint_status('Directory listing: (empty)')
|
||||||
|
else
|
||||||
|
vprint_status("Directory listing:\n#{listing[1]}")
|
||||||
|
path = store_loot('ftp.anonymous', 'text/plain', rhost, listing[1], 'ftp_anonymous.txt', 'Anonymous FTP directory listing')
|
||||||
|
print_good("Directory listing stored to: #{path}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
report_ftp_service(banner)
|
report_ftp_service(banner)
|
||||||
report_vuln(
|
report_vuln(
|
||||||
host: rhost,
|
host: rhost,
|
||||||
|
|||||||
Reference in New Issue
Block a user