rapid7/metasploit-framework

View on GitHub

Showing 21,960 of 21,960 total issues

Class Encoder has 32 methods (exceeds 20 allowed). Consider refactoring.
Open

class Encoder < Module

  #
  # The type set that encoders can fall within.  This classifies the type of
  # output generated by the encoder in terms of the general character set
Severity: Minor
Found in lib/msf/core/encoder.rb - About 4 hrs to fix

    File oats_weblogic_console.rb has 333 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class MetasploitModule < Msf::Exploit::Remote
      Rank = ExcellentRanking
    
      include Msf::Exploit::Remote::HttpClient
      include Msf::Auxiliary::Report
    Severity: Minor
    Found in modules/exploits/windows/http/oats_weblogic_console.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

      File cachedump.rb has 332 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'English'
      class MetasploitModule < Msf::Post
        include Msf::Post::Windows::Priv
        include Msf::Post::Windows::Registry
      
      
      Severity: Minor
      Found in modules/post/windows/gather/cachedump.rb - About 4 hrs to fix

        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 exploit has 99 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def exploit
                  downfile = datastore['DOWNFILE'] || rand_text_alpha(8+rand(8))
                  @uri = '/tools_vct.htm'
                  user = datastore['USERNAME']
                  pass = datastore['PASSWORD']
              Severity: Major
              Found in modules/exploits/linux/http/dlink_dir615_up_exec.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

                          File darkcomet_filedownloader.rb has 331 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          class MetasploitModule < Msf::Auxiliary
                            include Msf::Exploit::Remote::Tcp
                            include Msf::Auxiliary::Report
                          
                            def initialize(info = {})
                          Severity: Minor
                          Found in modules/auxiliary/gather/darkcomet_filedownloader.rb - About 3 hrs to fix

                            File splunk_xslt_authenticated_rce.rb has 331 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            class MetasploitModule < Msf::Exploit::Remote
                              Rank = ExcellentRanking
                            
                              include Msf::Exploit::Remote::HttpClient
                              prepend Msf::Exploit::Remote::AutoCheck
                            Severity: Minor
                            Found in modules/exploits/unix/http/splunk_xslt_authenticated_rce.rb - About 3 hrs to fix

                              File webkit_trident.rb has 331 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              class MetasploitModule < Msf::Exploit::Remote
                                Rank = ManualRanking
                              
                                include Msf::Exploit::Remote::HttpServer::HTML
                              
                              
                              Severity: Minor
                              Found in modules/exploits/apple_ios/browser/webkit_trident.rb - About 3 hrs to fix

                                File exchange_chainedserializationbinder_rce.rb has 331 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                require 'nokogiri'
                                
                                class MetasploitModule < Msf::Exploit::Remote
                                
                                  Rank = ExcellentRanking

                                  File virustotal.rb has 331 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  begin
                                  msfbase = __FILE__
                                  while File.symlink?(msfbase)
                                    msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
                                  end
                                  Severity: Minor
                                  Found in tools/exploit/virustotal.rb - About 3 hrs to fix

                                    File file_system.rb has 331 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    module Msf
                                      class Post
                                        module Windows
                                          module FileSystem
                                            include Msf::Exploit::Windows_Constants
                                    Severity: Minor
                                    Found in lib/msf/core/post/windows/file_system.rb - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language