rapid7/metasploit-framework

View on GitHub

Showing 21,757 of 21,757 total issues

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

  def run
    case session.platform
    when 'windows'
      listing = cmd_exec('netsh wlan show networks mode=bssid')
      if listing.nil?
Severity: Major
Found in modules/post/multi/gather/wlan_geolocate.rb - About 3 hrs to fix

    Method end_element has 97 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def end_element(name=nil)
        block = @block
        case name
        when 'name'
          if in_tag('result')
    Severity: Major
    Found in lib/rex/parser/openvas_document.rb - About 3 hrs to fix

      Method extract_host_info has 97 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def extract_host_info(report_file)
          @hosts.each do |h|
            report_file.write("  <host>\n")
            host_id = h.attributes["id"]
      
      
      Severity: Major
      Found in lib/msf/core/db_export.rb - About 3 hrs to fix

        Method asm_reverse_tcp has 97 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def asm_reverse_tcp(opts={})
        
            retry_count  = [opts[:retry_count].to_i, 1].max
            encoded_port = "0x%.8x" % [opts[:port].to_i,2].pack("vn").unpack("N").first
            encoded_host = "0x%.8x" % Rex::Socket.addr_aton(opts[:host]||"127.127.127.127").unpack("V").first
        Severity: Major
        Found in lib/msf/core/payload/windows/reverse_tcp.rb - About 3 hrs to fix

          Method parse_sessionsetup has 97 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def parse_sessionsetup(pkt, s)
              payload = pkt.payload.dup
              ntlmpayload = payload[/NTLMSSP\x00.*/m]
              if ntlmpayload
                ntlmmessagetype = ntlmpayload[8,4].unpack("V")[0]
          Severity: Major
          Found in data/exploits/psnuffle/smb.rb - About 3 hrs to fix

            File adobe_flashplayer_newfunction.rb has 328 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'zlib'
            
            class MetasploitModule < Msf::Exploit::Remote
              Rank = NormalRanking
            
            
            Severity: Minor
            Found in modules/exploits/windows/fileformat/adobe_flashplayer_newfunction.rb - About 3 hrs to fix

              File smb_relay.rb has 328 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              class MetasploitModule < Msf::Exploit::Remote
                Rank = ExcellentRanking
                include ::Msf::Exploit::Remote::SocketServer
              
                include ::Msf::Exploit::Remote::SMB::Server::HashCapture
              Severity: Minor
              Found in modules/exploits/windows/smb/smb_relay.rb - About 3 hrs to fix

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

                  def run
                
                    # Connect in order to get the server-assigned user-id
                    connect(versions: [1])
                    smb_login
                Severity: Major
                Found in modules/auxiliary/fuzzers/smb/smb_tree_connect_corrupt.rb and 1 other location - About 3 hrs to fix
                modules/auxiliary/fuzzers/smb/smb_create_pipe_corrupt.rb on lines 37..84

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

                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

                      auth << "\x00\x00\x00\x00\x00\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
                      auth << "\x00\x00\x00\x00\x00\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
                      auth << "\x00\x00\x00\x00\x00\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
                      auth << "\x00\x00\x00\x00\x00\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
                      auth << "\x00\x00\x00\x00\x00\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
                Severity: Major
                Found in modules/exploits/windows/misc/hp_dataprotector_new_folder.rb and 1 other location - About 3 hrs to fix
                modules/exploits/windows/misc/hp_dataprotector_new_folder.rb on lines 199..225

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

                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 run
                
                    # Connect in order to get the server-assigned user-id/tree-id
                    connect(versions: [1])
                    smb_login
                Severity: Major
                Found in modules/auxiliary/fuzzers/smb/smb_create_pipe_corrupt.rb and 1 other location - About 3 hrs to fix
                modules/auxiliary/fuzzers/smb/smb_tree_connect_corrupt.rb on lines 42..89

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

                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

                      auth << "\x00\x00\x00\x00\x41\x64\x6d\x69" << "\x6e\x00\x00\x00\x00\x00\x00\x00"
                      auth << "\x00\x00\x00\x00\x00\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
                      auth << "\x00\x00\x00\x00\x00\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
                      auth << "\x00\x00\x00\x00\x00\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
                      auth << "\x00\x00\x00\x00\x00\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
                Severity: Major
                Found in modules/exploits/windows/misc/hp_dataprotector_new_folder.rb and 1 other location - About 3 hrs to fix
                modules/exploits/windows/misc/hp_dataprotector_new_folder.rb on lines 171..197

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

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

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

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

                    def run_host(ip)
                  
                      conn = false
                  
                      dm = datastore['NoDetailMessages']
                  Severity: Major
                  Found in modules/auxiliary/scanner/http/replace_ext.rb - About 3 hrs to fix

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

                      def initialize(info = {})
                        super(
                          update_info(
                            info,
                            'Name' => 'Pentaho Business Server Auth Bypass and Server Side Template Injection RCE',

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

                        def initialize(info = {})
                          super(update_info(info,
                            'Name'        => 'Wireshark LWRES Dissector getaddrsbyname_request Buffer Overflow',
                            'Description' => %q{
                                The LWRES dissector in Wireshark version 0.9.15 through 1.0.10 and 1.2.0 through
                      Severity: Major
                      Found in modules/exploits/multi/misc/wireshark_lwres_getaddrbyname.rb - About 3 hrs to fix

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

                          def exploit
                            if !datastore['ForceExploit'] && is_root?
                              fail_with(Failure::BadConfig, 'Session already has root privileges. Set ForceExploit to override.')
                            end
                        
                        
                        Severity: Major
                        Found in modules/exploits/linux/local/vmware_alsa_config.rb - About 3 hrs to fix

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

                            def initialize(info = {})
                              super(
                                update_info(
                                  info,
                                  'Name' => 'Zyxel chained RCE using LFI and weak password derivation algorithm',
                          Severity: Major
                          Found in modules/exploits/linux/http/zyxel_lfi_unauth_ssh_rce.rb - About 3 hrs to fix

                            Method load_module has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def load_module(parent_path, type, module_reference_name, options = {})
                                options.assert_valid_keys(:count_by_type, :force, :recalculate_by_type, :reload, :cached_metadata)
                                force = options[:force] || false
                                reload = options[:reload] || false
                            
                            
                            Severity: Major
                            Found in lib/msf/core/modules/loader/base.rb - About 3 hrs to fix

                              Method exec_shellcode_source has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def exec_shellcode_source
                                  %Q|
                                    var execShellcode = function(shellcode, bytes) {
                                      Components.utils.import("resource://gre/modules/ctypes.jsm");
                              
                              
                              Severity: Major
                              Found in lib/msf/core/exploit/remote/firefox_privilege_escalation.rb - About 3 hrs to fix

                                Method build_pac has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            def build_pac(opts = {})
                                              user_name = opts[:client_name] || ''
                                              user_id = opts[:user_id] || Rex::Proto::Kerberos::Pac::DEFAULT_ADMIN_RID
                                              primary_group_id = opts[:group_id] || Rex::Proto::Kerberos::Pac::DOMAIN_USERS
                                              group_ids = opts[:group_ids] || [Rex::Proto::Kerberos::Pac::DOMAIN_USERS]
                                Severity: Major
                                Found in lib/msf/core/exploit/remote/kerberos/client/pac.rb - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language