Skip to content

HelpCmdline

psiinon edited this page Jun 3, 2015 · 8 revisions

Command Line

ZAP supports the following command line options:

     -cmd Runs ZAP 'inline', ie without starting the UI or a daemon
     -config Overrides the specified key=value pair in the configuration file
     -daemon Starts ZAP in 'daemon' mode, ie without a UI
     -dir Uses the specified directory instead of the default one
     -installdir Overrides the code that detects where ZAP has been installed with the specified directory
     -h Shows all of the command line options available, including those added by add-ons
     -help The same as -h
     -host Overrides the host used for proxying specified in the configuration file
     -port Overrides the port used for proxying specified in the configuration file
     -version Reports the ZAP version
     -newsession Creates a new session at the given location (it expects the full path to the session)
     -session Opens the given session after starting ZAP (it expects the full path to the session).

The options '-session' and '-newsession' are mutually exclusive. An error will be shown and ZAP exit (if not in GUI) when both options are set. Configuration keys should be specified using the dot notation based their location in the XML of the configuration file, eg:

-config api.key=12345 -config connection.timeoutInSecs=60

Note that add-ons can add extra command line options.

Examples:

  • Start ZAP in 'daemon' mode with a new session created at a given path:

    -daemon -newsession /path/to/new/session
    
  • Create a report of the last scan of an existing session and exit ZAP once finished:

    -last_scan_report /path/to/save/report.xml -session /path/to/existing/session -cmd
    

See also

     Introduction the introduction to ZAP
     API to control ZAP programmatically
Clone this wiki locally