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,10 +4,10 @@
# See the file 'doc/COPYING' for copying permission
#
class Test_beef_debug < BeEF::Core::Command
def self.options
return [
{'name' => 'msg', 'description' => 'Debug Message', 'ui_label' => 'Debug Message', 'value' => "Test string for beef.debug() function", 'type' => 'textarea', 'width' => '400px', 'height' => '50px' }
[
{ 'name' => 'msg', 'description' => 'Debug Message', 'ui_label' => 'Debug Message', 'value' => 'Test string for beef.debug() function', 'type' => 'textarea',
'width' => '400px', 'height' => '50px' }
]
end
@@ -16,5 +16,4 @@ class Test_beef_debug < BeEF::Core::Command
content['Result'] = @datastore['result']
save content
end
end

View File

@@ -4,7 +4,6 @@
# See the file 'doc/COPYING' for copying permission
#
class Test_cors_request < BeEF::Core::Command
def post_execute
content = {}
content['response'] = @datastore['response']
@@ -12,12 +11,11 @@ class Test_cors_request < BeEF::Core::Command
end
def self.options
return [
{'name' => 'method', 'ui_label' =>'Method', 'type' => 'text', 'width' => '400px', 'value' => 'GET' },
{'name' => 'url', 'ui_label' =>'URL', 'type' => 'text', 'width' => '400px', 'value' => 'http://graph.facebook.com/fql?q=SELECT%20url,total_count%20FROM%20link_stat%20WHERE%20url=%27http://beefproject.com/%27' },
{'name' => 'data', 'ui_label' =>'Data', 'type' => 'text', 'width' => '400px', 'value' => 'postdata' },
[
{ 'name' => 'method', 'ui_label' => 'Method', 'type' => 'text', 'width' => '400px', 'value' => 'GET' },
{ 'name' => 'url', 'ui_label' => 'URL', 'type' => 'text', 'width' => '400px',
'value' => 'http://graph.facebook.com/fql?q=SELECT%20url,total_count%20FROM%20link_stat%20WHERE%20url=%27http://beefproject.com/%27' },
{ 'name' => 'data', 'ui_label' => 'Data', 'type' => 'text', 'width' => '400px', 'value' => 'postdata' }
]
end
end

View File

@@ -4,23 +4,25 @@
# See the file 'doc/COPYING' for copying permission
#
class Test_dns_tunnel_client < BeEF::Core::Command
def self.options
@configuration = BeEF::Core::Configuration.instance
@configuration = BeEF::Core::Configuration.instance
return [
{'name' => 'domain', 'ui_label'=>'Domain', 'type' => 'text', 'width' => '400px', 'value' => 'browserhacker.com' },
{'name' => 'data', 'ui_label'=>'Data to send', 'type' => 'textarea', 'value' =>
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras rutrum fermentum nunc, vel varius libero pharetra a. Duis rhoncus nisi volutpat elit suscipit auctor. In fringilla est eget tortor bibendum gravida. Pellentesque aliquet augue libero, at gravida arcu. Nunc et quam sapien, eu pulvinar erat. Quisque dignissim imperdiet neque, et interdum sem sagittis a. Maecenas non mi elit, a luctus neque. Nam pulvinar libero sit amet dui suscipit facilisis. Duis sed mauris elit. Aliquam cursus scelerisque diam a fringilla. Curabitur mollis nisi in ante hendrerit pellentesque ut ac orci. In congue nunc vitae enim pharetra eleifend.',
'width' => '400px', 'height' => '300px'
}
[
{ 'name' => 'domain', 'ui_label' => 'Domain', 'type' => 'text', 'width' => '400px', 'value' => 'browserhacker.com' },
{ 'name' => 'data', 'ui_label' => 'Data to send', 'type' => 'textarea', 'value' =>
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras rutrum fermentum nunc, vel varius libero pharetra a. ' \
'Duis rhoncus nisi volutpat elit suscipit auctor. In fringilla est eget tortor bibendum gravida. Pellentesque aliquet ' \
'augue libero, at gravida arcu. Nunc et quam sapien, eu pulvinar erat. Quisque dignissim imperdiet neque, et interdum ' \
'sem sagittis a. Maecenas non mi elit, a luctus neque. Nam pulvinar libero sit amet dui suscipit facilisis. Duis sed ' \
'mauris elit. Aliquam cursus scelerisque diam a fringilla. Curabitur mollis nisi in ante hendrerit pellentesque ut ac ' \
'orci. In congue nunc vitae enim pharetra eleifend.',
'width' => '400px', 'height' => '300px' }
]
end
def post_execute
content = {}
content['dns_requests'] = @datastore['dns_requests']
save content
end
end

View File

@@ -4,9 +4,7 @@
# See the file 'doc/COPYING' for copying permission
#
class Test_get_variable < BeEF::Core::Command
def self.options
return [{'name' => 'payload_name', 'ui_label'=>'Payload Name', 'type' => 'text', 'value' => 'message', 'width' => '400px'}]
[{ 'name' => 'payload_name', 'ui_label' => 'Payload Name', 'type' => 'text', 'value' => 'message', 'width' => '400px' }]
end
end

View File

@@ -4,7 +4,6 @@
# See the file 'doc/COPYING' for copying permission
#
class Test_http_redirect < BeEF::Core::Command
def pre_send
BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind_redirect('http://beefproject.com', '/redirect')
end
@@ -14,5 +13,4 @@ class Test_http_redirect < BeEF::Core::Command
content['Result'] = @datastore['result']
save content
end
end

View File

@@ -4,7 +4,6 @@
# See the file 'doc/COPYING' for copying permission
#
class Test_network_request < BeEF::Core::Command
def post_execute
content = {}
content['response'] = @datastore['response']
@@ -15,19 +14,18 @@ class Test_network_request < BeEF::Core::Command
@configuration = BeEF::Core::Configuration.instance
beef_host = @configuration.beef_host
beef_port = @configuration.beef_port
hook_path = @configuration.get("beef.http.hook_file")
hook_path = @configuration.get('beef.http.hook_file')
return [
{'name' => 'scheme', 'ui_label'=>'Scheme', 'type' => 'text', 'width' => '400px', 'value' => 'http' },
{'name' => 'method', 'ui_label'=>'Method', 'type' => 'text', 'width' => '400px', 'value' => 'GET' },
{'name' => 'domain', 'ui_label'=>'Domain', 'type' => 'text', 'width' => '400px', 'value' => beef_host },
{'name' => 'port', 'ui_label'=>'Port', 'type' => 'text', 'width' => '400px', 'value' => beef_port },
{'name' => 'path', 'ui_label'=>'Path', 'type' => 'text', 'width' => '400px', 'value' => hook_path },
{'name' => 'anchor', 'ui_label'=>'Anchor', 'type' => 'text', 'width' => '400px', 'value' => 'irrelevant' },
{'name' => 'data', 'ui_label'=>'Query String', 'type' => 'text', 'width' => '400px', 'value' => 'query=data' },
{'name' => 'timeout', 'ui_label' => 'Timeout (s)', 'value' => '10', 'width'=>'400px' },
{'name' => 'dataType', 'ui_label'=>'Data Type', 'type' => 'text', 'width' => '400px', 'value' => 'script' },
[
{ 'name' => 'scheme', 'ui_label' => 'Scheme', 'type' => 'text', 'width' => '400px', 'value' => 'http' },
{ 'name' => 'method', 'ui_label' => 'Method', 'type' => 'text', 'width' => '400px', 'value' => 'GET' },
{ 'name' => 'domain', 'ui_label' => 'Domain', 'type' => 'text', 'width' => '400px', 'value' => beef_host },
{ 'name' => 'port', 'ui_label' => 'Port', 'type' => 'text', 'width' => '400px', 'value' => beef_port },
{ 'name' => 'path', 'ui_label' => 'Path', 'type' => 'text', 'width' => '400px', 'value' => hook_path },
{ 'name' => 'anchor', 'ui_label' => 'Anchor', 'type' => 'text', 'width' => '400px', 'value' => 'irrelevant' },
{ 'name' => 'data', 'ui_label' => 'Query String', 'type' => 'text', 'width' => '400px', 'value' => 'query=data' },
{ 'name' => 'timeout', 'ui_label' => 'Timeout (s)', 'value' => '10', 'width' => '400px' },
{ 'name' => 'dataType', 'ui_label' => 'Data Type', 'type' => 'text', 'width' => '400px', 'value' => 'script' }
]
end
end

View File

@@ -4,11 +4,9 @@
# See the file 'doc/COPYING' for copying permission
#
class Test_return_ascii_chars < BeEF::Core::Command
def post_execute
content = {}
content['Result String'] = @datastore['result_string']
save content
end
end

View File

@@ -4,11 +4,9 @@
# See the file 'doc/COPYING' for copying permission
#
class Test_return_image < BeEF::Core::Command
def post_execute
content = {}
content['image'] = @datastore['image']
save content
end
end

View File

@@ -4,19 +4,16 @@
# See the file 'doc/COPYING' for copying permission
#
class Test_return_long_string < BeEF::Core::Command
def self.options
return [
{'name' => 'repeat', 'description' => 'Times to repeat', 'ui_label' => 'Times to repeat', 'value' =>'1024'},
{'name' => 'repeat_string', 'description' => 'Strings to repeat', 'ui_label' => 'String to repeat', 'value' =>'\u00AE'}
[
{ 'name' => 'repeat', 'description' => 'Times to repeat', 'ui_label' => 'Times to repeat', 'value' => '1024' },
{ 'name' => 'repeat_string', 'description' => 'Strings to repeat', 'ui_label' => 'String to repeat', 'value' => '\u00AE' }
]
end
def post_execute
content = {}
content['Result String'] = @datastore['result_string']
save content
end
end