rapid7/metasploit-framework

View on GitHub

Showing 22,177 of 22,177 total issues

File capture.rb has 440 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Msf

###
#
# This module provides methods for sending and receiving
Severity: Minor
Found in lib/msf/core/exploit/capture.rb - About 6 hrs to fix

    File vbulletin_getindexablecontent.rb has 439 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class MetasploitModule < Msf::Exploit::Remote
      Rank = ManualRanking
    
      include Msf::Exploit::Remote::HttpClient
      prepend Msf::Exploit::Remote::AutoCheck
    Severity: Minor
    Found in modules/exploits/multi/http/vbulletin_getindexablecontent.rb - About 6 hrs to fix

      Method run_host has 163 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def run_host(target_host)
          conn = true
          ecode = nil
          emesg = nil
      
      
      Severity: Major
      Found in modules/auxiliary/scanner/http/svn_scanner.rb - About 6 hrs to fix

        Method initialize has 163 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def initialize
            super(
              'Name'             => 'SSH User Code Execution',
              'Description'      => %q(
                This module connects to the target system and executes the necessary
        Severity: Major
        Found in modules/exploits/multi/ssh/sshexec.rb - About 6 hrs to fix

          File dns_fuzzer.rb has 438 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'bindata'
          
          class MetasploitModule < Msf::Auxiliary
            include Msf::Exploit::Remote::Udp
            include Msf::Exploit::Remote::Tcp
          Severity: Minor
          Found in modules/auxiliary/fuzzers/dns/dns_fuzzer.rb - About 6 hrs to fix

            File weblogic_deserialize_rawobject.rb has 438 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            class MetasploitModule < Msf::Exploit::Remote
              Rank = ExcellentRanking
            
              include Msf::Exploit::Remote::Tcp
              include Msf::Exploit::JavaDeserialization
            Severity: Minor
            Found in modules/exploits/multi/misc/weblogic_deserialize_rawobject.rb - About 6 hrs to fix

              Method cmd_portfwd has 162 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def cmd_portfwd(*args)
                  args.unshift('list') if args.empty?
              
                  # For clarity's sake.
                  lport = nil
              Severity: Major
              Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb - About 6 hrs to fix

                Method netsparker_vulnerability_map has 162 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def netsparker_vulnerability_map(vuln)
                    res = {
                      :risk => 1,
                      :name  => 'Information Disclosure',
                      :blame => 'System Administrator',
                Severity: Major
                Found in lib/msf/core/db_manager/import/netsparker.rb - About 6 hrs to fix

                  Method backdoor_apk has 162 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def backdoor_apk(apkfile, raw_payload, signature = true, manifest = true, apk_data = nil, service = true)
                      unless apk_data || apkfile && File.readable?(apkfile)
                        usage
                        raise RuntimeError, "Invalid template: #{apkfile}"
                      end
                  Severity: Major
                  Found in lib/msf/core/payload/apk.rb - About 6 hrs to fix

                    Method run has 161 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def run
                    
                        print_status("Trying to find the service desk service strong name...")
                        service_desk = get_service_desk_strong_name
                        if service_desk.nil?
                    Severity: Major
                    Found in modules/auxiliary/admin/hp/hp_imc_som_create_account.rb - About 6 hrs to fix

                      Method execute_command has 161 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def execute_command(cmd, _opts = {})
                          # Get the user's inbox folder's ID and change key ID.
                          print_status("Getting the user's inbox folder's ID and ChangeKey ID...")
                          xml_getfolder_inbox = %(<?xml version="1.0" encoding="utf-8"?>
                          <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

                        Method initialize has 161 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def initialize(info = {})
                            super(
                              update_info(
                                info,
                                'Name' => 'Docker Container Escape Via runC Overwrite',
                        Severity: Major
                        Found in modules/exploits/linux/local/docker_runc_escape.rb - About 6 hrs to fix

                          Method run has 161 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def run
                              print_status("Upgrading session ID: #{datastore['SESSION']}")
                          
                              # Try hard to find a valid LHOST value in order to
                              # make running 'sessions -u' as robust as possible.
                          Severity: Major
                          Found in modules/post/multi/manage/shell_to_meterpreter.rb - About 6 hrs to fix

                            Method run_host has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def run_host(_ip)
                                res = send_request_raw(
                                  {
                                    'method' => 'GET',
                                    'uri' => '/'
                            Severity: Minor
                            Found in modules/auxiliary/admin/http/tomcat_administration.rb - About 6 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Method run_host has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def run_host(ip)
                                unless wordpress_and_online?
                                  fail_with Failure::NotVulnerable, "#{ip} - Server not online or not detected as wordpress"
                                end
                            
                            
                            Severity: Minor
                            Found in modules/auxiliary/scanner/http/wp_total_upkeep_downloader.rb - About 6 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Method run_host has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def run_host(ip)
                            
                                conn = false
                            
                                timeout = datastore['TIMEOUT']
                            Severity: Minor
                            Found in modules/auxiliary/scanner/http/brute_dirs.rb - About 6 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Method run_host has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def run_host(ip)
                                extensions = [
                                  '.null',
                                  '.backup',
                                  '.bak',
                            Severity: Minor
                            Found in modules/auxiliary/scanner/http/files_dir.rb - About 6 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Method exploit has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def exploit
                                #
                                # Connect and grab the banner
                                #
                                ehlo = datastore['EHLO_NAME']
                            Severity: Minor
                            Found in modules/exploits/unix/smtp/exim4_string_format.rb - About 6 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Method check has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def check
                                res = send_request_cgi(
                                  'method' => 'GET',
                                  'uri' => normalize_uri(target_uri.path, 'login'),
                                  'keep_cookies' => true
                            Severity: Minor
                            Found in modules/exploits/multi/http/bitbucket_env_var_rce.rb - About 6 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Method decrypt_pref has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def decrypt_pref(file_name)
                                file_contents = read_file(file_name)
                                if file_contents.nil? || file_contents.empty?
                                  print_status "Skipping empty file: #{file_name}"
                                  return []
                            Severity: Minor
                            Found in modules/post/windows/gather/credentials/plsql_developer.rb - About 6 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Severity
                            Category
                            Status
                            Source
                            Language