Files
metasploit-gs/modules/post/linux/busybox/ping_net.rb
T

39 lines
1.1 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Post
include Msf::Post::File
def initialize
super(
2015-08-28 09:53:31 -05:00
'Name' => 'BusyBox Ping Network Enumeration',
'Description' => %q{
This module will be applied on a session connected to a BusyBox shell. It will ping a range
of IP addresses from the router or device executing BusyBox.
},
'Author' => 'Javier Vicente Vallejo',
'License' => MSF_LICENSE,
'Platform' => ['linux'],
2015-08-28 09:53:31 -05:00
'SessionTypes' => ['shell']
)
register_options(
[
2015-08-28 09:53:31 -05:00
OptAddressRange.new('RANGE', [true, 'IP range to ping'])
])
end
def run
2015-08-28 09:53:31 -05:00
results = ''
Rex::Socket::RangeWalker.new(datastore['RANGE']).each do |ip|
vprint_status("Checking address #{ip}")
results << cmd_exec("ping -c 1 #{ip}")
end
2015-08-28 09:53:31 -05:00
p = store_loot('busybox.enum.network', 'text/plain', session, results, 'ping_results.txt', 'BusyBox Device Network Range Enumeration')
print_good("Results saved to #{p}.")
end
end