rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method inject_payload has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def inject_payload(payload)
    if session.type == 'meterpreter'
      socket_subsystem, socket = open_tcp_connection

      tcp_conversation = {
Severity: Major
Found in modules/exploits/linux/local/exim4_deliver_message_priv_esc.rb - About 2 hrs to fix

    Method prepare_setup has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def prepare_setup
        print_status('Registering new user...')
        body = {
          name: datastore['USERNAME'],
          email: datastore['EMAIL'],
    Severity: Major
    Found in modules/exploits/linux/http/traccar_rce_upload.rb - About 2 hrs to fix

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

        def initialize(info = {})
          super(
            update_info(
              info,
              'Name' => 'MobileIron MDM Hessian-Based Java Deserialization RCE',
      Severity: Major
      Found in modules/exploits/linux/http/mobileiron_mdm_hessian_rce.rb - About 2 hrs to fix

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

          def initialize(info = {})
            super(update_info(info,
              'Name'           => 'Hak5 WiFi Pineapple Preconfiguration Command Injection',
              'Description'    => %q{
              This module exploits a command injection vulnerability on WiFi Pineapples version 2.0 <= pineapple < 2.4.
        Severity: Major
        Found in modules/exploits/linux/http/pineapple_preconfig_cmdinject.rb - About 2 hrs to fix

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

            def initialize(info = {})
              super(
                update_info(
                  info,
                  'Name' => 'Fortinet FortiOS, FortiProxy, and FortiSwitchManager authentication bypass.',

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

              def initialize(info = {})
                super(
                  update_info(
                    info,
                    'Name' => 'F5 BIG-IP iControl CSRF File Write SOAP API',

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

                def initialize(info = {})
                  super(
                    update_info(
                      info,
                      'Name' => 'Apache Druid 0.20.0 Remote Command Execution',
              Severity: Major
              Found in modules/exploits/linux/http/apache_druid_js_rce.rb - About 2 hrs to fix

                Method brute_exploit has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def brute_exploit(target_addrs)
                    print_status("Trying to exploit Samba with address 0x%.8x..." % target_addrs['libgcrypt_base'])
                    datastore['DCERPC::fake_bind_multi'] = false
                    datastore['DCERPC::max_frag_size'] = 4248
                    datastore['DCERPC::smb_pipeio'] = 'trans'
                Severity: Major
                Found in modules/exploits/linux/samba/setinfopolicy_heap.rb - About 2 hrs to fix

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

                    def initialize(info = {})
                      super(
                        update_info(
                          info,
                          'Name' => 'SuiteCRM Log File Remote Code Execution',
                  Severity: Major
                  Found in modules/exploits/linux/http/suitecrm_log_file_rce.rb - About 2 hrs to fix

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

                      def initialize(info = {})
                        super(
                          update_info(
                            info,
                            'Name' => 'TP-Link Archer A7/C7 Unauthenticated LAN Remote Code Execution',
                    Severity: Major
                    Found in modules/exploits/linux/misc/tplink_archer_a7_c7_lan_rce.rb - About 2 hrs to fix

                      Method parse has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def self.parse(args)
                            options = {}
                            parser = OptionParser.new do |opt|
                              opt.banner = "Usage: #{__FILE__} [options]\nExample: #{__FILE__} -f python -e W00T"
                              opt.separator ''
                      Severity: Major
                      Found in tools/exploit/egghunter.rb - About 2 hrs to fix

                        Method parse has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def self.parse(args)
                            options = {}
                        
                            opts = OptionParser.new do |opts|
                              opts.banner = "Usage: #{__FILE__} [options]"
                        Severity: Major
                        Found in tools/exploit/virustotal.rb - About 2 hrs to fix

                          Method to_executable has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def self.to_executable(framework, arch, plat, code = '', opts = {})
                              if elf? code or macho? code
                                return code
                              end
                          
                          
                          Severity: Major
                          Found in lib/msf/util/exe.rb - About 2 hrs to fix

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

                                  def initialize(info = {})
                                    super(info)
                            
                                    register_advanced_options(
                                      [
                            Severity: Major
                            Found in lib/msf/base/sessions/meterpreter_options.rb - About 2 hrs to fix

                              Method report_host has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def report_host(opts)
                              
                                  return if !active
                                  addr = opts.delete(:host) || return
                              
                              
                              Severity: Major
                              Found in lib/msf/core/db_manager/host.rb - About 2 hrs to fix

                                Method report_web_vuln has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def report_web_vuln(opts)
                                    return if not active
                                  ::ApplicationRecord.connection_pool.with_connection {
                                    opts = opts.clone() # protect the original caller's opts
                                    wspace = Msf::Util::DBManager.process_opts_workspace(opts, framework)
                                Severity: Major
                                Found in lib/msf/core/db_manager/web.rb - About 2 hrs to fix

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                          def powershell_upload_exec(exe, debug=false)
                                            # hex converter
                                            hex = exe.unpack("H*")[0]
                                            # create random alpha 8 character names
                                            #var_bypass  = rand_text_alpha(8)
                                  Severity: Major
                                  Found in lib/rex/proto/mssql/client.rb and 1 other location - About 2 hrs to fix
                                  lib/msf/core/exploit/remote/mssql_sqli.rb on lines 105..130

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 96.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def powershell_upload_exec(exe, debug=false)
                                  
                                      # hex converter
                                      hex = exe.unpack("H*")[0]
                                      # create random alpha 8 character names
                                  Severity: Major
                                  Found in lib/msf/core/exploit/remote/mssql_sqli.rb and 1 other location - About 2 hrs to fix
                                  lib/rex/proto/mssql/client.rb on lines 602..626

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 96.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    when HASH_MODE
                                      if not srvchal
                                        $stderr.puts "[*] Server challenge must be provided with this type"
                                        exit
                                      end
                                  Severity: Major
                                  Found in tools/password/lm2ntcrack.rb and 1 other location - About 2 hrs to fix
                                  tools/password/lm2ntcrack.rb on lines 794..826

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 96.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def generate(opts={})
                                      cmd             = datastore['CMD'] || ''
                                      nullfreeversion = datastore['NullFreeVersion']
                                  
                                      if cmd.empty?
                                  Severity: Major
                                  Found in modules/payloads/singles/linux/x64/exec.rb and 1 other location - About 2 hrs to fix
                                  modules/payloads/singles/linux/x86/exec.rb on lines 45..146

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 96.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language