rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

      when '88' # LDAP
        host = row[1]
        username = row[2].match(/-D %22(.*?)%22/)[1]
        password = row[2].match(/-P %22(.*?)%22/)[1]

Severity: Major
Found in modules/post/linux/gather/enum_nagios_xi.rb and 2 other locations - About 45 mins to fix
modules/post/linux/gather/enum_nagios_xi.rb on lines 189..205
modules/post/linux/gather/enum_nagios_xi.rb on lines 225..241

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

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 3 locations. Consider refactoring.
Open

  def initialize(info = {})
    super(update_info(info,
      "Name" => "Printer File Download Scanner",
      "Description" => %q{
        This module downloads a file from a set of printers using the
Severity: Major
Found in modules/auxiliary/scanner/printer/printer_download_file.rb and 2 other locations - About 45 mins to fix
modules/auxiliary/scanner/printer/printer_delete_file.rb on lines 13..36
modules/auxiliary/scanner/printer/printer_list_dir.rb on lines 13..36

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

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 3 locations. Consider refactoring.
Open

    def process_vultr_sd_configs(job_name, vultr_sd_configs)
      username, password = process_authorization(vultr_sd_configs['authorization'])
      cred = credential_data
      cred[:port] = ''
      cred[:address] = ''
Severity: Major
Found in lib/msf/core/auxiliary/prometheus.rb and 2 other locations - About 45 mins to fix
lib/msf/core/auxiliary/prometheus.rb on lines 231..247
lib/msf/core/auxiliary/prometheus.rb on lines 318..334

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

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 3 locations. Consider refactoring.
Open

      when '76' # POSTGRES
        host = row[1]
        username = row[2].match(/--dbuser=(.*?)\s/)[1]
        password = row[2].match(/--dbpass=%22(.*?)%22/)[1]

Severity: Major
Found in modules/post/linux/gather/enum_nagios_xi.rb and 2 other locations - About 45 mins to fix
modules/post/linux/gather/enum_nagios_xi.rb on lines 189..205
modules/post/linux/gather/enum_nagios_xi.rb on lines 263..279

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

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 3 locations. Consider refactoring.
Open

  def initialize(info = {})
    super(update_info(info,
      "Name" => "Printer File Deletion Scanner",
      "Description" => %q{
        This module deletes a file on a set of printers using the
Severity: Major
Found in modules/auxiliary/scanner/printer/printer_delete_file.rb and 2 other locations - About 45 mins to fix
modules/auxiliary/scanner/printer/printer_download_file.rb on lines 13..36
modules/auxiliary/scanner/printer/printer_list_dir.rb on lines 13..36

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

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 3 locations. Consider refactoring.
Open

    super(update_info(
      info,
      'Name'           => 'Wordpress SlideShow Gallery Authenticated File Upload',
      'Description'    => %q{
          The Wordpress SlideShow Gallery plugin contains an authenticated file upload
Severity: Major
Found in modules/exploits/unix/webapp/wp_slideshowgallery_upload.rb and 2 other locations - About 45 mins to fix
modules/exploits/unix/webapp/wp_frontend_editor_file_upload.rb on lines 13..39
modules/exploits/unix/webapp/wp_optimizepress_upload.rb on lines 16..42

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

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

Avoid deeply nested control flow statements.
Open

                    if name[-4:] == '.asm':
                        build(name[:-4])
            for root, dirs, files in os.walk('./src/stage/'):
Severity: Major
Found in external/source/shellcode/windows/x64/build.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

        } else if WebRequestCodeResponse(url5) == 401 {
            urlToHarvest = url5
        } else if WebRequestCodeResponse(url6) == 401 {
            urlToHarvest = url6
        } else {
    Severity: Major
    Found in modules/auxiliary/scanner/msmail/shared/src/msmail/msmail.go - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if name[-4:] == '.asm':
                              build(name[:-4])
                  for root, dirs, files in os.walk('./src/single/'):
      Severity: Major
      Found in external/source/shellcode/windows/x64/build.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            for name in files:
                                build(name[:-4])
                        for root, dirs, files in os.walk('./src/stage/'):
        Severity: Major
        Found in external/source/shellcode/windows/x86/build.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if name[-4:] == '.asm':
                                  build(name[:-4])
                  else:
          Severity: Major
          Found in external/source/shellcode/windows/x64/build.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                for name in files:
                                    build(name[:-4])
                            for root, dirs, files in os.walk('./src/single/'):
            Severity: Major
            Found in external/source/shellcode/windows/x86/build.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                              for (var x=0; x < procs.length; x++) {
                                  if (nprocs[i] == procs[x]) {
                                      found = true;
                                      break;
                                  }
              Severity: Major
              Found in external/source/DLLHijackAuditKit/analyze.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    for name in files:
                                        build(name[:-4])
                            else:
                Severity: Major
                Found in external/source/shellcode/windows/x86/build.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if name[-4:] == '.asm':
                                          build(name[:-4])
                              for root, dirs, files in os.walk('./src/stager/'):
                  Severity: Major
                  Found in external/source/shellcode/windows/x64/build.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        for name in files:
                                            build(name[:-4])
                                    for root, dirs, files in os.walk('./src/migrate/'):
                    Severity: Major
                    Found in external/source/shellcode/windows/x86/build.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          for name in files:
                                              build(name[:-4])
                                      for root, dirs, files in os.walk('./src/kernel/'):
                      Severity: Major
                      Found in external/source/shellcode/windows/x86/build.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        if (found) continue;
                        Severity: Major
                        Found in external/source/DLLHijackAuditKit/analyze.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              for name in files:
                                                  build(name[:-4])
                                          for root, dirs, files in os.walk('./src/stager/'):
                          Severity: Major
                          Found in external/source/shellcode/windows/x86/build.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if not data:
                                                        break
                                                    output_file.write(data)
                            Severity: Major
                            Found in data/exploits/vmware_view_planner_4_6_uploadlog_rce/log_upload_wsgi.py - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language