Skip to Content
Web Application Security TestingAuthenticationOverview

Authenticated Scanning

A user often has access to more functionality when logged in, such as posting comments, uploading files or completing a purchase. To test those areas, give the scanner a way to log in. The authentication settings are on the Scan behind login tab of the scan profile settings, which offers three methods.

Choosing a Method

MethodUse it for
Recorded login (Recommended)Applications with a login form. The scanner replays your login and stays logged in during the scan
Basic Access AuthenticationStaging and older environments protected by HTTP basic authentication
Session CookieOnly when the other two methods aren’t available. A session cookie expires, so it works for one scan only

To test the same application both with and without login, create two scan profiles for it, one with authentication set up and one without.

Recorded Login

You record your login as a series of actions with the Detectify Chrome extension and upload the recording. At the beginning of the scan, the scanner replays it to reach the logged-in state, and then runs all discovery and testing in that state. While the scan runs, the recording’s checks run once a minute, and if one fails, the scanner replays the login.

Only one recorded login can be active at a time. See Recorded Login for setup.

Basic Access Authentication

The username and password are sent as HTTP basic authentication with every request to your web application during the scan.

  1. In the scan profile settings, open Scan behind login.
  2. Under Basic Access Authentication (Mostly used for older sites), select Edit.
  3. In Basic Authentication Credentials, enter the Username and Password, and select Save.

A session cookie you provide is sent with every request to your web application during the scan. You can copy a session cookie from your browser after logging in.

  1. In the scan profile settings, open Scan behind login.
  2. Under Session Cookie, select Edit.
  3. Enter the Cookie name, Value and Domain. Optionally, set the HttpOnly and Secure flags.
  4. Select Save.

Session cookies expire after a limited time, and the scanner can’t renew them. Replace the cookie before each scan you start. Unless you have a way to keep sessions alive, use this method only if the other two aren’t available to you.

Recorded Crawling Is Not Authentication

Recorded Crawling replays user flows during a scan to reach parts of the application the crawler can’t. It doesn’t log in or keep the scanner logged in. If the flows are behind login, set up Recorded Login as well.

Tips for Authenticated Scanning

  • Create separate credentials for Detectify. Don’t reuse existing credentials, so your access logs show which logins were the scanner.
  • Don’t use admin credentials on production. The scanner crawls and clicks on everything it finds. See Scan Impact.
  • Avoid your logout path. Add it to Avoid paths/URLs so the scanner doesn’t log itself out. The path lists also apply while the login replays.
  • Check for CAPTCHA and anti-bot protection. Applications that require a CAPTCHA, or that use anti-bot protection, don’t scan well. Allowlist the scanner IP addresses in your anti-bot system.

Check That Login Works

  1. After you upload a Recorded Login file, check its validation result. See Recorded Login.
  2. After the scan has run for 10 to 15 minutes, look for the Recorded Login Succeeded finding in the scan results.
  3. Check that the Crawled URLs finding lists pages that are only visible when logged in.
  4. If the login fails, the scan shows a Recorded Login failed warning, and the Recorded Login Failed finding has the details.

If the scanner isn’t reaching logged-in pages, see Troubleshooting.

Next Steps

Last updated on