CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/post/linux/busybox/ping_net.rb
Views: 11704
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Post
7
include Msf::Post::File
8
9
def initialize
10
super(
11
'Name' => 'BusyBox Ping Network Enumeration',
12
'Description' => %q{
13
This module will be applied on a session connected to a BusyBox shell. It will ping a range
14
of IP addresses from the router or device executing BusyBox.
15
},
16
'Author' => 'Javier Vicente Vallejo',
17
'License' => MSF_LICENSE,
18
'Platform' => ['linux'],
19
'SessionTypes' => ['shell']
20
)
21
22
register_options(
23
[
24
OptAddressRange.new('RANGE', [true, 'IP range to ping'])
25
]
26
)
27
end
28
29
def run
30
results = ''
31
Rex::Socket::RangeWalker.new(datastore['RANGE']).each do |ip|
32
vprint_status("Checking address #{ip}")
33
results << cmd_exec("ping -c 1 #{ip}")
34
end
35
36
p = store_loot('busybox.enum.network', 'text/plain', session, results, 'ping_results.txt', 'BusyBox Device Network Range Enumeration')
37
print_good("Results saved to #{p}.")
38
end
39
end
40
41