Path: blob/master/modules/post/linux/busybox/ping_net.rb
19669 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post6include Msf::Post::File78def initialize9super(10'Name' => 'BusyBox Ping Network Enumeration',11'Description' => %q{12This module will be applied on a session connected to a BusyBox shell. It will ping a range13of IP addresses from the router or device executing BusyBox.14},15'Author' => 'Javier Vicente Vallejo',16'License' => MSF_LICENSE,17'Platform' => ['linux'],18'SessionTypes' => ['shell']19)2021register_options(22[23OptAddressRange.new('RANGE', [true, 'IP range to ping'])24]25)26end2728def run29results = ''30Rex::Socket::RangeWalker.new(datastore['RANGE']).each do |ip|31vprint_status("Checking address #{ip}")32results << cmd_exec("ping -c 1 #{ip}")33end3435p = store_loot('busybox.enum.network', 'text/plain', session, results, 'ping_results.txt', 'BusyBox Device Network Range Enumeration')36print_good("Results saved to #{p}.")37end38end394041