Grunny/zap-cli

error start zap-cli

Closed this issue · 2 comments

thank you for your reply and work
I updated with git and zap zap-cli and reinstall everything
I still encounter errors

zap-cli --zap-path /usr/local/bin/ --api-key 12345 quick-scan --self-contained -o '-config api.key=12345' -s xss http://127.0.0.1/
[INFO] Starting ZAP daemon
[ERROR] ZAP was not found in the path "/usr/local/bin/". You can set the path to where ZAP is installed on your system using the --zap-path command line parameter or by default using the ZAP_PATH environment variable.

zap-cli --api-key 12345 quick-scan --self-contained -o '-config api.key=12345' -s xss http://127.0.0.1/
[INFO] Starting ZAP daemon
[ERROR] ZAP was not found in the path "/zap". You can set the path to where ZAP is installed on your system using the --zap-path command line parameter or by default using the ZAP_PATH environment variable.

root@fakessh:~# ls -alih /usr/local/bin/zap*
38016989 -rwxr-xr-x 1 root staff 214 mai 31 16:24 /usr/local/bin/zap
38020954 -rwxr-xr-x 1 root staff 298 mai 31 15:23 /usr/local/bin/zap-cli

there are still errors that prevented the operation

On Linux, zap-cli currently looks for a file named zap.sh rather than just zap in the ZAP path directory, to match what exists when you unpack the ZAP archive.

Was ZAP installed via a package manager? If so, it looks like /usr/local/bin/zap just forwards commands to /usr/share/zaproxy/zap.sh. So, you could try pointing --zap-path to /usr/share/zaproxy. i.e.

zap-cli --zap-path /usr/share/zaproxy --api-key 12345 quick-scan --self-contained -o '-config api.key=12345' -s xss http://127.0.0.1/

Does that work for you?

it is work thanks you