Modules: Resolve many Rubocop violations

This commit is contained in:
Brendan Coles
2022-01-22 12:46:42 +00:00
parent bbe805f017
commit a64480dfab
317 changed files with 3238 additions and 3965 deletions

View File

@@ -4,16 +4,15 @@
# See the file 'doc/COPYING' for copying permission
#
class Get_internal_ip_java < BeEF::Core::Command
def pre_send
BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind('/modules/host/get_internal_ip_java/get_internal_ip.class', '/get_internal_ip', 'class')
end
#def self.options
# def self.options
# return [
# { 'name' => 'applet_name', 'description' => 'Applet Name', 'ui_label'=>'Number', 'value' =>'5551234','width' => '200px' },
# ]
#end
# end
def post_execute
content = {}
@@ -22,20 +21,17 @@ class Get_internal_ip_java < BeEF::Core::Command
BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.unbind('/get_internal_ip.class')
configuration = BeEF::Core::Configuration.instance
if configuration.get("beef.extension.network.enable") == true
return unless configuration.get('beef.extension.network.enable') == true
session_id = @datastore['beefhook']
session_id = @datastore['beefhook']
# save the network host
if @datastore['results'] =~ /^([\d\.]+)$/
ip = $1
if BeEF::Filters.is_valid_ip?(ip)
print_debug("Hooked browser has network interface #{ip}")
BeEF::Core::Models::NetworkHost.create(:hooked_browser_id => session_id, :ip => ip)
end
end
# save the network host
return unless @datastore['results'] =~ /^([\d.]+)$/
ip = Regexp.last_match(1)
if BeEF::Filters.is_valid_ip?(ip)
print_debug("Hooked browser has network interface #{ip}")
BeEF::Core::Models::NetworkHost.create(hooked_browser_id: session_id, ip: ip)
end
end
end