rapid7/metasploit-framework

View on GitHub

Showing 7,301 of 22,004 total issues

Method try_user_pass has 173 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def try_user_pass(opts)
    user = opts[:user]
    pass = opts[:pass]
    auth_path = opts[:auth_path]
    inbox_path = opts[:inbox_path]
Severity: Major
Found in modules/auxiliary/scanner/http/owa_login.rb - About 6 hrs to fix

    Method on_client_data has 173 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def on_client_data(c)
        # get the client data
        data = c.get_once
        return if not data
        # split data into command and arguments
    Severity: Major
    Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 6 hrs to fix

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

        def exploit
          @uri = normalize_uri(target_uri.path)
          @uri << '/' if @uri[-1, 1] != '/'
      
          # Create user with empty credentials
      Severity: Major
      Found in modules/exploits/multi/http/hp_sitescope_uploadfileshandler.rb - About 6 hrs to fix

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

          def run
            print_status('Gathering System info ....')
            vm = nil
            dmi_info = nil
        
        
        Severity: Major
        Found in modules/post/linux/gather/checkvm.rb - About 6 hrs to fix

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

                    [ 'Automatic', { } ],
          
                    #
                    # Individual targets
                    #
          modules/exploits/windows/mssql/ms09_004_sp_replwritetovarbin.rb on lines 77..242

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

          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

                    [ 'Automatic', { } ],
          
                    #
                    # Individual targets
                    #
          modules/exploits/windows/mssql/ms09_004_sp_replwritetovarbin_sqli.rb on lines 79..244

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

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

            def generate_html(payload)
              enc_code = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
          
              custom_js = %Q|
          function check(){
          Severity: Major
          Found in modules/exploits/windows/browser/mozilla_interleaved_write.rb - About 6 hrs to fix

            Method dump_ntds_hashes has 170 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def dump_ntds_hashes
                _machine_name, domain_name, dns_domain_name = get_machine_name_and_domain_info
                return unless domain_name
            
                print_status('Dumping Domain Credentials (domain\\uid:rid:lmhash:nthash)')
            Severity: Major
            Found in modules/auxiliary/gather/windows_secrets_dump.rb - About 6 hrs to fix

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

                def run
                  # we have to overload the process_cracker_results from password_cracker.rb since LANMAN
                  # is a special case where we may need to do some combining
                  def process_cracker_results(results, cred)
                    return results if cred['core_id'].nil? # make sure we have good data
              Severity: Major
              Found in modules/auxiliary/analyze/crack_windows.rb - About 6 hrs to fix

                Method initialize has 170 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',
                      'Author'        => 'toto',
                Severity: Major
                Found in modules/payloads/stagers/netware/reverse_tcp.rb - About 6 hrs to fix

                  Method generate has 170 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def generate(_opts = {})
                  
                      dnsname        = datastore['DNSZONE']
                      wType        = 0x0010    #DNS_TYPE_TEXT (TEXT)
                      wTypeOffset    = 0x1c
                  Severity: Major
                  Found in modules/payloads/singles/windows/dns_txt_query_exec.rb - About 6 hrs to fix

                    Method get_filezilla_creds has 170 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def get_filezilla_creds(paths)
                        fs_xml = '' # FileZilla Server.xml           - Settings for the local install
                        fsi_xml = '' # FileZilla Server Interface.xml - Last server used with the interface
                        credentials = Rex::Text::Table.new(
                          'Header' => 'FileZilla FTP Server Credentials',
                    Severity: Major
                    Found in modules/post/windows/gather/credentials/filezilla_server.rb - About 6 hrs to fix

                      Method exploit_newuser has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def exploit_newuser
                      
                          # TODO: Check if option admin_role exists via admin/people/permissions/roles
                      
                          # call login page to extract tokens
                      Severity: Major
                      Found in modules/exploits/multi/http/drupal_drupageddon.rb - About 6 hrs to fix

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

                          def exploit
                            marker = rand_text_alpha(6)
                            sqli_rand = rand_text_numeric(4+rand(4))
                            sqli = "' and (select 1 from(select count(*),concat((select (select concat(0x#{marker.unpack('H*')[0]},Hex(cast(id as char)),0x#{marker.unpack('H*')[0]})) "
                            sqli << "from alienvault.sessions where login='admin' limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) and '#{sqli_rand}'='#{sqli_rand}"
                        Severity: Major
                        Found in modules/exploits/linux/http/alienvault_sqli_exec.rb - About 6 hrs to fix

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

                          function process_list() {
                              var res = new Array();
                              var wbemFlagReturnImmediately = 0x10;
                              var wbemFlagForwardOnly = 0x20;
                              var oWMI = GetObject("winmgmts:\\\\localhost\\root\\CIMV2");
                          Severity: Major
                          Found in external/source/DLLHijackAuditKit/audit.js and 1 other location - About 6 hrs to fix
                          external/source/DLLHijackAuditKit/analyze.js on lines 14..27

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

                          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

                          function process_list() {
                              var res = new Array();
                              var wbemFlagReturnImmediately = 0x10;
                              var wbemFlagForwardOnly = 0x20;
                              var oWMI = GetObject("winmgmts:\\\\localhost\\root\\CIMV2");
                          Severity: Major
                          Found in external/source/DLLHijackAuditKit/analyze.js and 1 other location - About 6 hrs to fix
                          external/source/DLLHijackAuditKit/audit.js on lines 9..22

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

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

                            def cmd_transport(*args)
                              if ( args.length == 0 or args.include?("-h") )
                                cmd_transport_help
                                return
                              end
                          Severity: Major
                          Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb - About 6 hrs to fix

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

                              def build_hta(cli)
                                var_shellobj    = rand_text_alpha(rand(5) + 5);
                                var_fsobj    = rand_text_alpha(rand(5) + 5);
                                var_fsobj_file    = rand_text_alpha(rand(5) + 5);
                                var_vbsname    = rand_text_alpha(rand(5) + 5);
                            modules/exploits/windows/browser/oracle_webcenter_checkoutandopen.rb on lines 94..168

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

                            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 build_hta(cli)
                                var_shellobj    = rand_text_alpha(rand(5) + 5);
                                var_fsobj    = rand_text_alpha(rand(5) + 5);
                                var_fsobj_file    = rand_text_alpha(rand(5) + 5);
                                var_vbsname    = rand_text_alpha(rand(5) + 5);
                            modules/exploits/windows/browser/honeywell_hscremotedeploy_exec.rb on lines 96..170

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

                            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 check
                                targ = rhost
                            
                                srv_sock = Rex::Socket.create_udp(
                                  'PeerHost' => targ,
                            Severity: Major
                            Found in modules/auxiliary/spoof/dns/bailiwicked_domain.rb and 1 other location - About 6 hrs to fix
                            modules/auxiliary/spoof/dns/bailiwicked_host.rb on lines 71..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 218.

                            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