Path: blob/master/modules/network/ping_sweep/module.rb
1154 views
#1# Copyright (c) 2006-2025 Wade Alcorn - [email protected]2# Browser Exploitation Framework (BeEF) - https://beefproject.com3# See the file 'doc/COPYING' for copying permission4#5class Ping_sweep < BeEF::Core::Command6def post_execute7content = {}8content['result'] = @datastore['result']9save content1011configuration = BeEF::Core::Configuration.instance12return unless configuration.get('beef.extension.network.enable') == true1314# log the network service15return unless @datastore['results'] =~ /^ip=(.+)&ping=(\d+)ms$/1617ip = Regexp.last_match(1)18# ping = Regexp.last_match(2)19session_id = @datastore['beefhook']20if BeEF::Filters.is_valid_ip?(ip)21print_debug("Hooked browser found host #{ip}")22BeEF::Core::Models::NetworkHost.create(hooked_browser_id: session_id, ip: ip)23end24end2526def self.options27[28{ 'name' => 'rhosts', 'ui_label' => 'Scan IP range (C class)', 'value' => 'common' },29{ 'name' => 'threads', 'ui_label' => 'Workers', 'value' => '3' }30]31end32end333435