rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method generate has 100 lines of code (exceeds 25 allowed). 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 - About 4 hrs to fix

    Method exploit has 100 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def exploit
        # Forge the payload
        name = ".#{Rex::Text.rand_text_alpha(4)}"
        files =
          [
    Severity: Major
    Found in modules/exploits/multi/http/baldr_upload_exec.rb - About 4 hrs to fix

      Method get_phpinfo has 100 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def get_phpinfo
          # uses the Magento_Framework_DB_Transaction class
          serialize =  'O:13:\"Credis_Client\":22:{'
          serialize << 's:8:\"\u0000*\u0000redis\";'
          serialize << 'O:45:\"Magento\\\Sales\\\Model\\\Order\\\Payment\\\Transaction\":40:{'
      Severity: Major
      Found in modules/exploits/multi/http/magento_unserialize.rb - About 4 hrs to fix

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

          def initialize(info = {})
            super(
              update_info(
                info,
                'Name' => 'Gogs Git Hooks Remote Code Execution',
        Severity: Major
        Found in modules/exploits/multi/http/gogs_git_hooks_rce.rb - About 4 hrs to fix

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

            def create_payload(num)
              command = ""
              os = "ANYOS"
              if datastore['OS'].downcase == "linux"
                if num == 1
          modules/auxiliary/scanner/sap/sap_soap_rfc_dbmcli_sxpg_call_system_command_exec.rb on lines 57..86

          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 137.

          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 create_payload(num)
              command = ""
              os = "ANYOS"
              if datastore['OS'].downcase == "linux"
                if num == 1
          modules/auxiliary/scanner/sap/sap_soap_rfc_dbmcli_sxpg_command_exec.rb on lines 58..87

          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 137.

          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

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

            def run
              cracker = new_password_cracker(action.name)
          
              lookups = []
          
          
          Severity: Major
          Found in modules/auxiliary/analyze/apply_pot.rb - About 3 hrs to fix

            Method make_kex_init has 99 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def make_kex_init
                [0x00, 0x00, 0x03, 0x14, 0x08, 0x14, 0xff, 0x9f,
                0xde, 0x5d, 0x5f, 0xb3, 0x07, 0x8f, 0x49, 0xa7,
                0x79, 0x6a, 0x03, 0x3d, 0xaf, 0x55, 0x00, 0x00,
                0x00, 0x7e, 0x64, 0x69, 0x66, 0x66, 0x69, 0x65,
            Severity: Major
            Found in modules/auxiliary/fuzzers/ssh/ssh_kexinit_corrupt.rb - About 3 hrs to fix

              Method get_phpshell has 99 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def get_phpshell
                  s = "#{@webroot}/#{@backdoor}"
                  p = "<?php #{payload.encoded} ?>"
                  # uses the Magento_Framework_Simplexml_Config_Cache_File class
                  serialize  = 'O:13:\"Credis_Client\":22:{'
              Severity: Major
              Found in modules/exploits/multi/http/magento_unserialize.rb - About 3 hrs to fix

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

                  def initialize(info = {})
                    super(
                      update_info(
                        info,
                        'Name' => 'SaltStack Salt API Unauthenticated RCE through wheel_async client',
                Severity: Major
                Found in modules/exploits/linux/http/saltstack_salt_wheel_async_rce.rb - About 3 hrs to fix

                  Method decrypt_vbr_db has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def decrypt_vbr_db(csv_dataset)
                      current_row = 0
                      decrypted_rows = 0
                      plaintext_rows = 0
                      blank_rows = 0
                  Severity: Major
                  Found in modules/post/windows/gather/credentials/veeam_credential_dump.rb - About 3 hrs to fix

                    Method digest_auth has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def digest_auth(opts={})
                        cnonce = make_cnonce
                        nonce_count = 0
                    
                        to = opts['timeout'] || 20
                    Severity: Major
                    Found in lib/rex/proto/http/client.rb - About 3 hrs to fix

                      Method cmd_download has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def cmd_download(*args)
                          if (args.empty? or args.include? "-h")
                            cmd_download_help
                            return true
                          end
                      Severity: Major
                      Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb - About 3 hrs to fix

                        Method report_note has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def report_note(opts)
                            return if not active
                          ::ApplicationRecord.connection_pool.with_connection {
                            wspace = Msf::Util::DBManager.process_opts_workspace(opts, framework)
                            opts = opts.clone()
                        Severity: Major
                        Found in lib/msf/core/db_manager/note.rb - About 3 hrs to fix

                          Method process_propfind has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def process_propfind(cli, request)
                              path = request.uri
                              print_status("PROPFIND #{path}")
                              body = ''
                          
                          
                          Severity: Major
                          Found in modules/auxiliary/gather/ie_sandbox_findfiles.rb - About 3 hrs to fix

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

                              def run_host(ip)
                                vprint_status('Attempting user enumeration')
                                res = send_request_cgi(
                                  'uri' => normalize_uri(target_uri.path, 'api', 'index.php', 'v1', 'users'),
                                  'headers' => {
                            Severity: Major
                            Found in modules/auxiliary/scanner/http/joomla_api_improper_access_checks.rb - About 3 hrs to fix

                              Method upload_payload has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def upload_payload
                                  uri = target_uri.path
                              
                                  @filename = rand_text_alpha(8+rand(8)) + ".cfm" #numbers is a bad idea
                                  taskname = rand_text_alpha(8+rand(8)) #numbers is a bad idea
                              Severity: Major
                              Found in modules/exploits/multi/http/coldfusion_rds_auth_bypass.rb - About 3 hrs to fix

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

                                  def initialize(info = {})
                                    super(
                                      update_info(
                                        info,
                                        'Name' => 'Atlassian Confluence WebWork OGNL Injection',

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

                                    def initialize(info = {})
                                      super(
                                        update_info(
                                          info,
                                          'Name' => 'FreeBSD ip6_setpktopt Use-After-Free Privilege Escalation',
                                  Severity: Major
                                  Found in modules/exploits/freebsd/local/ip6_setpktopt_uaf_priv_esc.rb - About 3 hrs to fix

                                    Method on_request_uri has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def on_request_uri(cli, request)
                                    
                                        agent = request['User-Agent']
                                        case request['User-Agent']
                                          when /MSIE.*Windows NT 5\.1.*\.NET CLR .*/
                                    Severity: Major
                                    Found in modules/exploits/windows/browser/ms10_026_avi_nsamplespersec.rb - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language