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

    sploit =  "SSH-2.0-OpenSSH_3.9p1"
    sploit << "\x0a\x00\x00\x4f\x04\x05\x14\x00\x00\x00\x00\x00\x00\x00"
Severity: Major
Found in modules/exploits/windows/ssh/freeftpd_key_exchange.rb and 1 other location - About 1 hr to fix
modules/exploits/windows/ssh/freesshd_key_exchange.rb on lines 54..73

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

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 unshadow(pf, sf)
    unshadowed = ''

    sf.each_line do |sl|
      pass = sl.scan(/^\w*:([^:]*)/).join
Severity: Major
Found in modules/post/bsd/gather/hashdump.rb and 1 other location - About 1 hr to fix
modules/post/linux/gather/hashdump.rb on lines 79..95

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

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

    instance.split(/,/).each do |item|
      start, stop = item.split(/-/).map { |p| p.to_i }

      start ||= 0
      stop ||= item.match(/-/) ? 99 : start
Severity: Major
Found in modules/auxiliary/scanner/sap/sap_router_portscanner.rb and 1 other location - About 1 hr to fix
modules/auxiliary/scanner/sap/sap_service_discovery.rb on lines 64..74

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

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

    static_ports = [
      '21212', '21213', '59975', '59976', '4238', '4239','4240', '4241', '3299',
      '3298', '515', '7200', '7210', '7269', '7270', '7575', '3909', '8200',
      '8210', '8220', '8230', '4363', '4444', '4445', '9999', '20003', '20004',
      '20005', '20006', '20007', '31596', '31597', '31602', '31601', '31604',
Severity: Major
Found in modules/auxiliary/scanner/sap/sap_service_discovery.rb and 1 other location - About 1 hr to fix
modules/auxiliary/vsploit/malware/dns/dns_zeus.rb on lines 30..47

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

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 unshadow(pf, sf)
    unshadowed = ''
    sf.each_line do |sl|
      pass = sl.scan(/^\w*:([^:]*)/).join

Severity: Major
Found in modules/post/linux/gather/hashdump.rb and 1 other location - About 1 hr to fix
modules/post/bsd/gather/hashdump.rb on lines 73..90

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

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

    instances.split(/,/).each do |item|
      start, stop = item.split(/-/).map do |p|
        p.to_i
      end

Severity: Major
Found in modules/auxiliary/scanner/sap/sap_service_discovery.rb and 1 other location - About 1 hr to fix
modules/auxiliary/scanner/sap/sap_router_portscanner.rb on lines 62..70

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

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 initialize(info = {})
    super(update_info(info,
      'Name'        => 'Applocker Evasion - Microsoft Workflow Compiler',
      'Description' => %(
         This module will assist you in evading Microsoft
modules/evasion/windows/applocker_evasion_regasm_regsvcs.rb on lines 8..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 52.

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 initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'OS X Gather Adium Enumeration',
Severity: Major
Found in modules/post/osx/gather/enum_adium.rb and 1 other location - About 1 hr to fix
modules/post/osx/gather/enum_colloquy.rb on lines 9..39

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

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

    sploit =  "SSH-2.0-OpenSSH_3.9p1"
    sploit << "\x0a\x00\x00\x4f\x04\x05\x14\x00\x00\x00\x00\x00\x00\x00"
Severity: Major
Found in modules/exploits/windows/ssh/freesshd_key_exchange.rb and 1 other location - About 1 hr to fix
modules/exploits/windows/ssh/freeftpd_key_exchange.rb on lines 56..75

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

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 create_session_key has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def self.create_session_key(ntlmssp_flags, server_ntlmssp_flags, user, pass, domain, challenge_key,
            client_challenge = '', ntlm_cli_challenge = '' , opt = {} )
Severity: Major
Found in lib/rex/proto/ntlm/utils.rb - About 1 hr to fix

    Method initialize has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def initialize(port = 80, listen_host = '0.0.0.0', ssl = false, context = {},
                     comm = nil, ssl_cert = nil, ssl_compression = false,
                     ssl_cipher = nil, ssl_version = nil)
    Severity: Major
    Found in lib/rex/proto/http/server.rb - About 1 hr to fix

      Method parse_zip_report has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def parse_zip_report(report, wspace, bl, allow_yaml, btag, args, basedir, host_info, &block)
      Severity: Major
      Found in lib/msf/core/db_manager/import/metasploit_framework/zip.rb - About 1 hr to fix

        Method parse_zip_host has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def parse_zip_host(host, wspace, bl, allow_yaml, btag, args, basedir, host_info, &block)
        Severity: Major
        Found in lib/msf/core/db_manager/import/metasploit_framework/zip.rb - About 1 hr to fix

          Method parse_zip_loot has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def parse_zip_loot(loot, wspace, bl, allow_yaml, btag, args, basedir, host_info, &block)
          Severity: Major
          Found in lib/msf/core/db_manager/import/metasploit_framework/zip.rb - About 1 hr to fix

            Method parse_zip_task has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def parse_zip_task(task, wspace, bl, allow_yaml, btag, args, basedir, host_info, &block)
            Severity: Major
            Found in lib/msf/core/db_manager/import/metasploit_framework/zip.rb - About 1 hr to fix

              Method request_service_ticket has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def request_service_ticket(session_key, tgt_ticket, realm, client_name, etypes, expiry_time, now, sname, options = {})
              Severity: Major
              Found in lib/msf/core/exploit/remote/kerberos/service_authenticator/base.rb - About 1 hr to fix

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

                    def test_vulnerable
                      random_string_len = @truncation_length ? [rand(2..10), @truncation_length].min : rand(2..10)
                      random_string = Rex::Text.rand_text_alphanumeric(random_string_len)
                      query_string = "'#{random_string}'"
                      query_string = @encoder[:encode].sub(/\^DATA\^/, query_string) if @encoder
                Severity: Major
                Found in lib/msf/core/exploit/sqli/mysqli/common.rb and 3 other locations - About 1 hr to fix
                lib/msf/core/exploit/sqli/mssqli/common.rb on lines 182..189
                lib/msf/core/exploit/sqli/postgresqli/common.rb on lines 189..196
                lib/msf/core/exploit/sqli/sqlitei/common.rb on lines 143..150

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

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

                    def test_vulnerable
                      random_string_len = @truncation_length ? [rand(2..10), @truncation_length].min : rand(2..10)
                      random_string = Rex::Text.rand_text_alphanumeric(random_string_len)
                      query_string = "'#{random_string}'"
                      query_string = @encoder[:encode].sub(/\^DATA\^/, query_string) if @encoder
                Severity: Major
                Found in lib/msf/core/exploit/sqli/postgresqli/common.rb and 3 other locations - About 1 hr to fix
                lib/msf/core/exploit/sqli/mssqli/common.rb on lines 182..189
                lib/msf/core/exploit/sqli/mysqli/common.rb on lines 197..204
                lib/msf/core/exploit/sqli/sqlitei/common.rb on lines 143..150

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

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

                    def test_vulnerable
                      random_string_len = @truncation_length ? [rand(2..10), @truncation_length].min : rand(2..10)
                      random_string = Rex::Text.rand_text_alphanumeric(random_string_len)
                      query_string = "'#{random_string}'"
                      query_string = @encoder[:encode].sub(/\^DATA\^/, query_string) if @encoder
                Severity: Major
                Found in lib/msf/core/exploit/sqli/mssqli/common.rb and 3 other locations - About 1 hr to fix
                lib/msf/core/exploit/sqli/mysqli/common.rb on lines 197..204
                lib/msf/core/exploit/sqli/postgresqli/common.rb on lines 189..196
                lib/msf/core/exploit/sqli/sqlitei/common.rb on lines 143..150

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

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

                    def test_vulnerable
                      random_string_len = @truncation_length ? [rand(2..10), @truncation_length].min : rand(2..10)
                      random_string = Rex::Text.rand_text_alphanumeric(random_string_len)
                      query_string = "'#{random_string}'"
                      query_string = @encoder[:encode].sub(/\^DATA\^/, query_string) if @encoder
                Severity: Major
                Found in lib/msf/core/exploit/sqli/sqlitei/common.rb and 3 other locations - About 1 hr to fix
                lib/msf/core/exploit/sqli/mssqli/common.rb on lines 182..189
                lib/msf/core/exploit/sqli/mysqli/common.rb on lines 197..204
                lib/msf/core/exploit/sqli/postgresqli/common.rb on lines 189..196

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

                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

                Severity
                Category
                Status
                Source
                Language