rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Avoid deeply nested control flow statements.
Open

              if (loc['flags'] & 0x01) > 0

                @data_out += "\tShortcut file is on a local volume.\n"

                lnk_file.sysseek(offset + loc['vol_ofs'], ::IO::SEEK_SET)
Severity: Major
Found in modules/post/windows/gather/dumplinks.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

              next if ['.', '..'].include?(file)
    Severity: Major
    Found in modules/post/windows/gather/get_bookmarks.rb - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                if !imap_use_spa.nil? # Account for SPA (NTLM auth)
                  print_status('     Secure Password Authentication (SPA): Enabled')
                end
      Severity: Major
      Found in modules/post/windows/gather/credentials/outlook.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if http_server_url.include? "h\x00t\x00t\x00p\x00s"
                      portnum = 443
                    else
                      portnum = 80
                    end
        Severity: Major
        Found in modules/post/windows/gather/credentials/outlook.rb - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                        if loc['base_ofs'] > 0
                          @data_out += get_target_path(loc['base_ofs'] + offset, lnk_file)
                        elsif loc['path_ofs'] > 0
                          @data_out += get_target_path(loc['path_ofs'] + offset, lnk_file)
                        end
          Severity: Major
          Found in modules/post/windows/gather/dumplinks.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                          if (loc['flags'] & 0x02) > 0
            
                            @data_out += "\tFile is on a network share.\n"
            
                            lnk_file.sysseek(offset + loc['network_ofs'], ::IO::SEEK_SET)
            Severity: Major
            Found in modules/post/windows/gather/dumplinks.rb - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                      next unless user['Favorites']
              Severity: Major
              Found in modules/post/windows/gather/get_bookmarks.rb - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          if imap_password.nil?
                            print_status('     User Password: <not stored>')
                          else
                            imap_password.slice!(0, 1)
                            pass = decrypt_password(imap_password)
                Severity: Major
                Found in modules/post/windows/gather/credentials/outlook.rb - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                            if imap_port.nil?
                              print_status('     IMAP Port: 143')
                              portnum = 143
                            else
                              print_status("     IMAP Port: #{imap_port}")
                  Severity: Major
                  Found in modules/post/windows/gather/credentials/outlook.rb - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                              if smtp_use_ssl.nil?
                                print_status('     SMTP Use SSL: No')
                              else
                                print_status('     SMTP Use SSL: Yes')
                              end
                    Severity: Major
                    Found in modules/post/windows/gather/credentials/outlook.rb - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                if imap_use_ssl.nil?
                                  print_status('     IMAP Use SSL: No')
                                else
                                  print_status('     IMAP Use SSL: Yes')
                                end
                      Severity: Major
                      Found in modules/post/windows/gather/credentials/outlook.rb - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  if smtp_port.nil?
                                    print_status('     SMTP Port: 25')
                                    smtp_port = 25
                                  else
                                    print_status("     SMTP Port: #{smtp_port}")
                        Severity: Major
                        Found in modules/post/windows/gather/credentials/outlook.rb - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    if smtp_use_auth.nil? # Account for SMTP servers requiring authentication
                                      print_status("     Outgoing Mail Server (SMTP): #{smtp_server}")
                                    else
                                      print_status("     Outgoing Mail Server (SMTP): #{smtp_server}   [Authentication Required]")
                                      # Check if smtp_auth_method is null.  If so, the inbound credentials are utilized
                          Severity: Major
                          Found in modules/post/windows/gather/credentials/outlook.rb - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        if (rx = /^Comment:\s(?<comment>.+?)[\r\n]/.match(ppk.to_s))
                                          private_key['Comment'] = rx[:comment]
                                        end
                            Severity: Major
                            Found in modules/post/windows/gather/enum_putty_saved_sessions.rb - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                          if pid == session.sys.process.getpid
                                            print_good('Success!')
                                          else
                                            print_error('Migration failed!')
                                          end
                              Severity: Major
                              Found in modules/post/windows/manage/archmigrate.rb - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                            until file_exist?('All.cab')
                                              sleep(1)
                                              print_status('Waiting for All.cab')
                                            end
                                Severity: Major
                                Found in modules/post/windows/gather/ntds_grabber.rb - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                              if (rx = /^Encryption:\s(?<cipher>[-a-z0-9]+?)[\r\n]/.match(ppk.to_s))
                                                private_key['Cipher'] = rx[:cipher]
                                              else
                                                private_key['Cipher'] = '(Unrecognised)'
                                              end
                                  Severity: Major
                                  Found in modules/post/windows/gather/enum_putty_saved_sessions.rb - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                timeout = params["timeout"][0] if params.has_key? "timeout"
                                    Severity: Major
                                    Found in tools/hardware/elm327_relay.rb - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                  maxpkts = params["maxpkts"][0] if params.has_key? "maxpkts"
                                      Severity: Major
                                      Found in tools/hardware/elm327_relay.rb - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                      if pub_info.length <= 2
                                                        auth_info[:domain], auth_info[:user] = pub_info
                                                      else
                                                        auth_info[:result_code] = Net::LDAP::ResultCodeInvalidCredentials
                                                        auth_info[:error_msg] = "Invalid LDAP Login Attempt => DN:#{user_login.name}"
                                        Severity: Major
                                        Found in lib/rex/proto/ldap/auth.rb - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language