Skip to content
Open dashboard (opens in a new tab)

Get started

Quickstart: scan from the CLI

This page takes you from no account to a finished scan, using the command line. If you would rather click through the dashboard, follow Your first scan instead.

You need a terminal, a browser and a work email address.

  1. Go to app.nightviz.ai and sign up.

    Use your work email. New accounts need a business address, so sign-up does not accept personal or disposable email providers. If a teammate has already invited you to their organization, the address they invited works.

  2. Sign in. Sign-up gives you a personal workspace, an organization of your own. It has no plan yet. Select Choose a plan, then Free Trial. No card is required. The trial lasts 3 days and includes 4 scans, and a banner at the top of the dashboard shows how many you have used.

A new organization opens on an empty Overview page. You can add an application there, or carry on below and do it from the terminal.

The Overview page of a new organization, with the heading "Add your first application", two numbered steps, a New application button and a link to try a web app example
A new organization. Nothing has been scanned yet, so Overview offers to add your first application.
Homebrew (Mac/Linux)
# Install:
brew install nvsecurity/taps/nightvision
# Upgrade to the latest version:
brew update && brew upgrade nightvision
Mac (Intel)
curl -L https://downloads.nightvision.net/binaries/latest/nightvision_latest_darwin_amd64.tar.gz | tar -xz; mv nightvision /usr/local/bin/
Mac (ARM)
curl -L https://downloads.nightvision.net/binaries/latest/nightvision_latest_darwin_arm64.tar.gz -q | tar -xz; mv nightvision /usr/local/bin/

Check that it runs:

Terminal window
nightvision version

Install the CLI has the details: direct downloads, Windows Subsystem for Linux and how to update.

Terminal window
nightvision login

Your browser opens. Sign in there and return to the terminal. The CLI remembers the session and works in your default organization and project.

To see who you are signed in as and what your role allows, run nightvision whoami.

The dashboard calls the thing you scan an application. The CLI and the API call it a target. They are the same thing.

This example uses a public practice site. Public vulnerable websites lists more. Swap in the URL of your own application whenever you like.

Terminal window
nightvision target create my-first-app http://testphp.vulnweb.com --type web
Terminal window
nightvision scan my-first-app --no-auth --max-duration-minutes 120

--no-auth says this scan does not sign in. The CLI starts the scan in NightVision Cloud, prints a link to it, and reports each new finding as the scan discovers it. When the scan ends, the results open in your browser.

--max-duration-minutes 120 gives the crawler two hours, as the tip above suggests for a web application. Without it, a scan runs for 30 minutes. For an API, leave it out.

Leave the command running: pressing Ctrl+C stops the scan. To watch progress in the dashboard while it runs, open the link, or go to Scans.

The scan’s page lists what was found, most severe first. Each row is a kind of finding, with the number of paths and instances it affects and its current status.

A table of findings ranked by severity, High first, with columns for rank, severity, finding, paths, instances and status. Every row shown has the status Open.
Findings are ranked by severity, with the paths and instances each one affects.
  1. Select the top finding to open it. Why it is real says what the scan sent and what the application answered. The Evidence tab shows the request and the response that prove the problem.
  2. Select Reproduce to copy a command that replays the request from your own machine.
  3. Fix the code. The Fix summary and the Remediation tab say how.
  4. Select Rescan, then Start rescan. NightVision runs a new scan with the same authentication and settings. A rescan uses one of your trial scans.
  5. When the rescan completes, open the finding again. If the scan no longer detects it, the history on the right reads Fixed in run and names the scan that proved it.

The practice site is not yours to fix, so stop after step 2 here and follow steps 3 to 5 on your own application.

Not every finding is a code fix. Open Change status to mark a finding False positive if it is not real, or Won’t fix if you accept the risk. Resolved records that someone says it is done, but the finding stays open until a scan stops detecting it. Triage explains each status.

Read a scan explains every part of the scan page. Work with a finding covers evidence, reproduction and triage in full. Severity says how fast to fix each finding.

  • Scan behind a login. Record a login once and reuse it on every scan. See Recorded logins.

  • Scan an API. NightVision needs an API spec to scan an API. Generate one from your source code and attach it in one command:

    Terminal window
    nightvision target create my-api https://api.example.com --type api
    nightvision openapi extract . --target my-api --lang python
    nightvision scan my-api

    Run the second command in the repository, with --lang set to its language. The source intelligence tutorial walks through it, and API specs covers attaching a spec you already have.

  • Scan something private. The CLI can scan an application that only your network can reach. See Private networks.

  • Scan on every commit. See Scan from a pipeline.

  • Learn the dashboard. Take the tour.