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

          ::Timeout.timeout(poll_timeout) do
            loop do
              if File.exist?(tmp_file)
                # read file
                contents = File.read(tmp_file)
Severity: Major
Found in modules/post/osx/manage/webcam.rb and 1 other location - About 2 hrs to fix
modules/post/osx/manage/record_mic.rb on lines 83..103

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

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 cmd_upload(*args)
            if args.include?('-h') || args.include?('--help')
              cmd_upload_help
              return
            end
Severity: Major
Found in lib/rex/post/smb/ui/console/command_dispatcher/shares.rb and 1 other location - About 2 hrs to fix
lib/rex/post/smb/ui/console/command_dispatcher/shares.rb on lines 417..451

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

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

      host = {}
      host[:created_at] = h.created_at.to_i
      host[:address] = h.address.to_s
      host[:mac] = h.mac.to_s
      host[:name] = h.name.to_s
Severity: Major
Found in lib/msf/core/rpc/v10/rpc_db.rb and 1 other location - About 2 hrs to fix
lib/msf/core/rpc/v10/rpc_db.rb on lines 408..421

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

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_host(target_host)

    begin
      res = send_request_cgi({
        'uri'          => normalize_uri(datastore['PATH']),
Severity: Major
Found in modules/auxiliary/scanner/http/webdav_website_content.rb and 1 other location - About 2 hrs to fix
modules/auxiliary/scanner/http/webdav_internal_ip.rb on lines 33..71

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

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

    super(update_info(info,
      'Name'        => 'Computer Associates License Client GETCONFIG Overflow',
      'Description'    => %q{
          This module exploits a vulnerability in the CA License Client
        service. This exploit will only work if your IP address can be
Severity: Major
Found in modules/exploits/windows/license/calicclnt_getconfig.rb and 1 other location - About 2 hrs to fix
modules/exploits/windows/license/calicserv_getconfig.rb on lines 12..59

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

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

    super(update_info(info,
      'Name' => 'Computer Associates License Server GETCONFIG Overflow',
      'Description'    => %q{
          This module exploits an vulnerability in the CA License Server
        network service. By sending an excessively long GETCONFIG
Severity: Major
Found in modules/exploits/windows/license/calicserv_getconfig.rb and 1 other location - About 2 hrs to fix
modules/exploits/windows/license/calicclnt_getconfig.rb on lines 12..66

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

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 cmd_download(*args)
            if args.include?('-h') || args.include?('--help')
              cmd_download_help
              return
            end
Severity: Major
Found in lib/rex/post/smb/ui/console/command_dispatcher/shares.rb and 1 other location - About 2 hrs to fix
lib/rex/post/smb/ui/console/command_dispatcher/shares.rb on lines 369..403

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

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

      host = {}
      host[:created_at] = h.created_at.to_i
      host[:address] = h.address.to_s
      host[:mac] = h.mac.to_s
      host[:name] = h.name.to_s
Severity: Major
Found in lib/msf/core/rpc/v10/rpc_db.rb and 1 other location - About 2 hrs to fix
lib/msf/core/rpc/v10/rpc_db.rb on lines 734..747

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

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

          ::Timeout.timeout(poll_timeout) do
            loop do
              if File.exist?(tmp_file)
                # read file
                contents = File.read(tmp_file)
Severity: Major
Found in modules/post/osx/manage/record_mic.rb and 1 other location - About 2 hrs to fix
modules/post/osx/manage/webcam.rb on lines 92..112

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

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_host(target_host)

    begin
      res = send_request_cgi({
        'uri'          => normalize_uri(datastore['PATH']),
Severity: Major
Found in modules/auxiliary/scanner/http/webdav_internal_ip.rb and 1 other location - About 2 hrs to fix
modules/auxiliary/scanner/http/webdav_website_content.rb on lines 29..67

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

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

  def authenticate
   res = send_request_cgi({
     'uri' => normalize_uri(target_uri.path, 'index.php')
   })

Severity: Major
Found in modules/auxiliary/gather/zabbix_toggleids_sqli.rb - About 2 hrs to fix

    Method print_vulnerable_cert_info has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def print_vulnerable_cert_info
        vuln_certificate_details = @vuln_certificate_details.select do |_key, hash|
          select = true
          select = false unless datastore['REPORT_PRIVENROLLABLE'] || hash[:certificate_enrollment_sids].any? do |sid|
            # compare based on RIDs to avoid issues language specific issues
    Severity: Major
    Found in modules/auxiliary/gather/ldap_esc_vulnerable_cert_finder.rb - About 2 hrs to fix

      Method check has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def check
          # Set up variables
          os_release = ''
          os_release_file = '/etc/os-release'
      
      
      Severity: Major
      Found in modules/auxiliary/admin/sap/sap_igs_xmlchart_xxe.rb - About 2 hrs to fix

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

          def on_request_uri(cli, request)
            response = create_response(200, 'OK')
            response.body = 'Received'
            cli.send_response(response)
        
        
        Severity: Major
        Found in modules/auxiliary/admin/sap/cve_2020_6207_solman_rce.rb - About 2 hrs to fix

          Method get_creds has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def get_creds
              res = send_request_cgi({
                'uri' => '/BRS_netgear_success.html',
                'method' => 'GET'
              })
          Severity: Major
          Found in modules/auxiliary/admin/http/netgear_wnr2000_pass_recovery.rb - About 2 hrs to fix

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

              def run
                # No point to continue if directory is not specified
                if datastore['DIRECTORY'].empty?
                  print_error('Please supply the path of the directory you want to list.')
                  return
            Severity: Major
            Found in modules/auxiliary/admin/http/manageengine_dir_listing.rb - About 2 hrs to fix

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

                def run
                  print_status("Logging into #{target_url('dashboard')}...")
                  res = send_request_cgi(
                    'method' => 'POST',
                    'uri' => normalize_uri(target_uri.path, 'dashboard', 'authenticate'),
              Severity: Major
              Found in modules/auxiliary/admin/http/cfme_manageiq_evm_pass_reset.rb - About 2 hrs to fix

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

                  def run
                    return if not check_dependencies
                
                    name  = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
                    rand1 = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
                Severity: Major
                Found in modules/auxiliary/sqli/oracle/dbms_export_extension.rb - About 2 hrs to fix

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

                    def run_host(ip)
                      client = datastore['CLIENT']
                      data = '<?xml version="1.0" encoding="utf-8" ?>'
                      data << '<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'
                      data << '<env:Body>'
                  Severity: Major
                  Found in modules/auxiliary/scanner/sap/sap_soap_rfc_ping.rb - About 2 hrs to fix

                    Method verify_target has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def verify_target(target_host,target_port,target_method,check_url,target_proxy_headers)
                    
                        vprint_status("#{peer} - Sending a web request... [#{target_method}][#{check_url}]")
                    
                        datastore['RPORT'] = target_port
                    Severity: Major
                    Found in modules/auxiliary/scanner/http/open_proxy.rb - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language