rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method Main has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        static void Main(string[] args)
        {
            try
            {
                if (!Environment.Is64BitProcess)

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

        scanner.scan! do |result|
          credential_data = result.to_h
          credential_data.merge!(
              module_fullname: self.fullname,
              workspace_id: myworkspace_id
    Severity: Major
    Found in modules/auxiliary/scanner/postgres/postgres_login.rb and 1 other location - About 2 hrs to fix
    modules/auxiliary/scanner/mssql/mssql_login.rb on lines 125..149

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

    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

        scanner.scan! do |result|
          credential_data = result.to_h
          credential_data.merge!(
              module_fullname: self.fullname,
              workspace_id: myworkspace_id
    Severity: Major
    Found in modules/auxiliary/scanner/mssql/mssql_login.rb and 1 other location - About 2 hrs to fix
    modules/auxiliary/scanner/postgres/postgres_login.rb on lines 109..134

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

    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::Xor
    
      def initialize
        super(
          'Name'             => 'XOR Encoder',
    Severity: Major
    Found in modules/encoders/mipsbe/longxor.rb and 1 other location - About 2 hrs to fix
    modules/encoders/mipsle/longxor.rb on lines 8..146

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

    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::Xor
    
      def initialize
        super(
          'Name'             => 'XOR Encoder',
    Severity: Major
    Found in modules/encoders/mipsle/longxor.rb and 1 other location - About 2 hrs to fix
    modules/encoders/mipsbe/longxor.rb on lines 8..146

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

    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

      def detect_input_output(sock_a, sock_b)
    
        begin
    
          # Flush any pending socket data
    Severity: Major
    Found in lib/msf/core/handler/reverse_tcp_double.rb and 1 other location - About 2 hrs to fix
    lib/msf/core/handler/reverse_tcp_double_ssl.rb on lines 178..224

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

    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

      def detect_input_output(sock_a, sock_b)
    
        begin
    
          # Flush any pending socket data
    Severity: Major
    Found in lib/msf/core/handler/reverse_tcp_double_ssl.rb and 1 other location - About 2 hrs to fix
    lib/msf/core/handler/reverse_tcp_double.rb on lines 128..174

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

    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
    
        packet =  "\x04\x00\x02\x40" # DATA MSG
        packet << rand_text_alpha_upper(18)
        packet << "\x00\x00\x00\x00" # Length
    modules/exploits/windows/misc/citrix_streamprocess_get_footer.rb on lines 60..111

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

    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
    
        packet =  "\x02\x00\x02\x40" # DATA MSG
        packet << rand_text_alpha_upper(18)
        packet << "\x00\x00\x00\x00" # Length
    modules/exploits/windows/misc/citrix_streamprocess_get_boot_record_request.rb on lines 60..111

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

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

          def parse_args_http(args = [], _type = 'http')
            opt_parser = Rex::Parser::Arguments.new(
              '-0' => [ false, 'Use HTTP 1.0' ],
              '-1' => [ false, 'Use TLSv1 (SSL)' ],
              '-2' => [ false, 'Use SSLv2 (SSL)' ],
    Severity: Major
    Found in plugins/request.rb - About 2 hrs to fix

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

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

        Method parse_response has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def parse_response(response)
            response_elements = response.split("\x68")
            response_elements.shift
            response_elements.each do |response_element|
              if response_element[5].eql?("\x64")
        Severity: Major
        Found in modules/auxiliary/client/iec104/iec104.rb - About 2 hrs to fix

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

            def run_host(ip)
              res = send_request_cgi({
                'method' => 'GET',
                'uri' => normalize_uri(target_uri.path, 'vicidial', 'admin.php'),
                'headers' => basic_auth
          Severity: Major
          Found in modules/auxiliary/scanner/http/vicidial_multiple_sqli.rb - About 2 hrs to fix

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

              def run_host(ip)
                return unless check_host(ip) == Exploit::CheckCode::Vulnerable
            
                if datastore['DOMAIN'].blank?
                  vprint_status("#{peer}: retrieving session cookie and domain name")
            Severity: Major
            Found in modules/auxiliary/scanner/http/bmc_trackit_passwd_reset.rb - About 2 hrs to fix

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

                def initialize(info = {})
                  super(merge_info(info,
                    'Name'          => 'Reverse TCP Stager',
                    'Description'   => 'Connect back to the attacker',
                    'License'       => MSF_LICENSE,
              Severity: Major
              Found in modules/payloads/stagers/linux/aarch64/reverse_tcp.rb - About 2 hrs to fix

                Method login has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def login(user, pass)
                    res = send_request_cgi(
                      {
                        'uri' => '/cgi-bin/luci',
                        'method' => 'POST',
                Severity: Major
                Found in modules/exploits/unix/http/epmp1000_ping_cmd_shell.rb - About 2 hrs to fix

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

                    def initialize(info = {})
                      super(update_info(info,
                        'Name'           => 'Tincd Post-Authentication Remote TCP Stack Buffer Overflow',
                        'Description'    => %q{
                          This module exploits a stack buffer overflow in Tinc's tincd
                  Severity: Major
                  Found in modules/exploits/multi/vpn/tincd_bof.rb - About 2 hrs to fix

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

                      def initialize(info = {})
                        super(
                          update_info(
                            info,
                            'Name' => 'Spring Framework Class property RCE (Spring4Shell)',
                    Severity: Major
                    Found in modules/exploits/multi/http/spring_framework_rce_spring4shell.rb - About 2 hrs to fix

                      Method exploit has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def exploit
                          print_status("#{peer} - Attacking #{target.name} target")
                      
                          # First, let's authenticate
                          res = send_request_cgi({
                      Severity: Major
                      Found in modules/exploits/multi/http/microfocus_ucmdb_unauth_deser.rb - About 2 hrs to fix

                        Method exploit has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def exploit
                            unless [CheckCode::Vulnerable].include? check
                              fail_with Failure::NotVulnerable, 'Target is most likely not vulnerable!'
                            end
                        
                        
                        Severity: Major
                        Found in modules/exploits/multi/http/solr_velocity_rce.rb - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language