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 vim_powerOFF_vm(vm_ref)
    soap_data = vim_soap_envelope(vim_soap_power_off_vm(vm_ref))
    res = vim_send_soap_request(soap_data)
    if res.class == Hash
      task_id = res['PowerOffVM_TaskResponse']['returnval']
Severity: Major
Found in lib/msf/core/exploit/remote/vim_soap.rb and 1 other location - About 2 hrs to fix
lib/msf/core/exploit/remote/vim_soap.rb on lines 512..539

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

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

class MetasploitModule < Msf::Auxiliary
  include Msf::Exploit::Remote::Tcp
  include Msf::Auxiliary::Scanner
  include Msf::Auxiliary::Report

Severity: Major
Found in modules/auxiliary/scanner/printer/printer_env_vars.rb and 1 other location - About 2 hrs to fix
modules/auxiliary/scanner/printer/printer_version_info.rb on lines 8..56

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

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

class MetasploitModule < Msf::Encoder::Alphanum
  Rank = ManualRanking

  def initialize
    super(
Severity: Major
Found in modules/encoders/x86/unicode_upper.rb and 1 other location - About 2 hrs to fix
modules/encoders/x86/unicode_mixed.rb on lines 8..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 93.

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

class MetasploitModule < Msf::Auxiliary
  include Msf::Exploit::Remote::Tcp
  include Msf::Auxiliary::Scanner
  include Msf::Auxiliary::Report

Severity: Major
Found in modules/auxiliary/scanner/printer/printer_version_info.rb and 1 other location - About 2 hrs to fix
modules/auxiliary/scanner/printer/printer_env_vars.rb on lines 8..56

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

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

class MetasploitModule < Msf::Encoder::Alphanum
  Rank = ManualRanking

  def initialize
    super(
Severity: Major
Found in modules/encoders/x86/unicode_mixed.rb and 1 other location - About 2 hrs to fix
modules/encoders/x86/unicode_upper.rb on lines 8..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 93.

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

        for i in sorted(modules):
            if i not in docs:
                missings += 1
                print_or_write('+ [ ] %s' %(make_link(i.split('metasploit-framework')[1])))
Severity: Major
Found in tools/docs/issue_finder.py and 1 other location - About 2 hrs to fix
tools/docs/issue_finder.py on lines 84..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 56.

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

        for i in sorted(docs):
            if i not in modules:
                problems += 1
                print_or_write('+ [ ] %s' %(make_link(i.split('metasploit-framework')[1])))
Severity: Major
Found in tools/docs/issue_finder.py and 1 other location - About 2 hrs to fix
tools/docs/issue_finder.py on lines 77..80

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

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

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

    if opts[:host] or opts[:address]
      host = opts[:host] || opts[:address]
      hent = wspace.hosts.find_by_address(host)
      return { :result => 'failed' } if hent == nil or hent.class != ::Mdm::Host
      hosts << hent
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 1419..1431

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

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

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

    if opts[:host] or opts[:address]
      host = opts[:host] || opts[:address]
      hent = wspace.hosts.find_by_address(host)
      return { :result => 'failed' } if hent == nil or hent.class != ::Mdm::Host
      hosts << hent
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 1345..1357

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

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

module Payload::Windows::Rc4_x64
  #
  # Register rc4 specific options
  #
  def initialize(*args)
Severity: Major
Found in lib/msf/core/payload/windows/x64/rc4_x64.rb and 1 other location - About 2 hrs to fix
lib/msf/core/payload/windows/rc4.rb on lines 11..94

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

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


    req = xkeyboard_key

    req << @xtest_opcode
    req << "\x02" # Extension minor: 2 (FakeInput)
Severity: Major
Found in modules/exploits/unix/x11/x11_keyboard_exec.rb and 1 other location - About 2 hrs to fix
modules/exploits/unix/x11/x11_keyboard_exec.rb on lines 176..211

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

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


    req = xkeyboard_key

    req << @xtest_opcode
    req << "\x02" # Extension minor: 2 (FakeInput)
Severity: Major
Found in modules/exploits/unix/x11/x11_keyboard_exec.rb and 1 other location - About 2 hrs to fix
modules/exploits/unix/x11/x11_keyboard_exec.rb on lines 137..172

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

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

module Payload::Windows::Rc4
  #
  # Register rc4 specific options
  #
  def initialize(*args)
Severity: Major
Found in lib/msf/core/payload/windows/rc4.rb and 1 other location - About 2 hrs to fix
lib/msf/core/payload/windows/x64/rc4_x64.rb on lines 11..93

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

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

  def dump_cached_hashes(windows_reg, nlkm_key)
    print_status('Dumping cached hashes')

    cache_infos = windows_reg.cached_infos(nlkm_key)
    if cache_infos.nil? || cache_infos.empty?
Severity: Major
Found in modules/auxiliary/gather/windows_secrets_dump.rb - About 2 hrs to fix

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

      def run
        vprint_status('Attempting login')
        login
        vprint_good('Login successful, querying APIs')
        [
    Severity: Major
    Found in modules/auxiliary/gather/rancher_authenticated_api_cred_exposure.rb - About 2 hrs to fix

      Method cmd_exec_run has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def cmd_exec_run(the_cookie)
          # Verify backdoor 'root' shell url exists
          root_shell = (ssl ? 'https' : 'http').to_s + '://' + "#{rhost}:#{rport}" + '/adm/syscmd.asp'
          print_status("#{rhost}:#{rport} - Checking backdoor 'root' shell...")
      
      
      Severity: Major
      Found in modules/auxiliary/admin/http/cnpilot_r_cmd_exec.rb - About 2 hrs to fix

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

          def initialize(info = {})
            super(
              update_info(
                info,
                'Name' => 'Kerberos Silver/Golden/Diamond/Sapphire Ticket Forging',
        Severity: Major
        Found in modules/auxiliary/admin/kerberos/forge_ticket.rb - About 2 hrs to fix

          Method extractabap has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def extractabap(rhost)
              print_status("#{rhost}:#{rport} [SAP] Connecting to SAP Management Console SOAP Interface")
              success = false
          
              soapenv = 'http://schemas.xmlsoap.org/soap/envelope/'
          Severity: Major
          Found in modules/auxiliary/scanner/sap/sap_mgmt_con_abaplog.rb - About 2 hrs to fix

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

              def run_host(_ip)
                internal_api = '/api/v3/internal'
                check = normalize_uri(target_uri.path, internal_api, 'check')
            
                print_status('Sending GitLab version request...')
            Severity: Major
            Found in modules/auxiliary/scanner/http/gitlab_user_enum.rb - About 2 hrs to fix

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

                def initialize(info = {})
                  super(merge_info(info,
                    'Name'          => 'Apple iOS aarch64 Command Shell, Reverse TCP Inline',
                    'Description'   => 'Connect back to attacker and spawn a command shell',
                    'License'       => MSF_LICENSE,
              Severity: Major
              Found in modules/payloads/singles/apple_ios/aarch64/shell_reverse_tcp.rb - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language