rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def initialize(info = {})
    super(merge_info(info,
      'Name'          => 'Linux Command Shell, Reverse TCP Inline',
      'Description'   => 'Connect back to attacker and spawn a command shell',
      'Author'        => 'Ramon de C Valle',
Severity: Major
Found in modules/payloads/singles/linux/ppc/shell_reverse_tcp.rb and 1 other location - About 3 hrs to fix
modules/payloads/singles/linux/ppc64/shell_reverse_tcp.rb on lines 15..79

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

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

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name'           => 'Steamed Hams',
Severity: Major
Found in modules/exploits/multi/hams/steamed.rb - About 3 hrs to fix

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

      def initialize(info = {})
        super(
          update_info(
            info,
            'Name' => 'ManageEngine ServiceDesk Plus Unauthenticated SAML RCE',

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

        def initialize(info = {})
          super(
            update_info(
              info,
              'Name' => 'Kubernetes authenticated code execution',
      Severity: Major
      Found in modules/exploits/multi/kubernetes/exec.rb - About 3 hrs to fix

        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

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

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

                    def run
                      body = {
                        KeyStorePassword: datastore['NEW_PASSWORD'],
                        TrustStorePassword: datastore['NEW_PASSWORD']
                      }.to_json
                  Severity: Major
                  Found in modules/auxiliary/admin/http/whatsup_gold_sqli.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 = 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 exploit has 96 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
                                Severity
                                Category
                                Status
                                Source
                                Language