Cannot start daemon mode

160 views
Skip to first unread message

Abdi-Rahman Osman

unread,
Feb 15, 2022, 6:04:24 PM2/15/22
to OWASP ZAP User Group
How do I start ZAP daemon mode on windows 10 through the command line? I have tried it a few times using ' C:\Program Files (x86)\OWASP\Zed Attack Proxy\zap.bat' command through cmd and powershell, but kept on getting the below errors.

Thanks,

Abdi-Rahman

Simon Bennetts

unread,
Feb 16, 2022, 4:12:07 AM2/16/22
to OWASP ZAP User Group
Missing the errors? :)

Abdi-Rahman Osman

unread,
Feb 16, 2022, 9:42:32 AM2/16/22
to OWASP ZAP User Group
Here is the error I get when I try to start ZAP daemon mode on windows 10 through the command line.

Screenshot_4.png

kingthorin+owaspzap

unread,
Feb 16, 2022, 9:43:38 AM2/16/22
to OWASP ZAP User Group
You either need to quote the path if it contains spaces or use Progra~1 etc as appropriate. This isn't a ZAP issue it's a windows CLI issue.

Abdi-Rahman Osman

unread,
Feb 16, 2022, 3:47:36 PM2/16/22
to OWASP ZAP User Group
Are there any other alternative ways to start ZAP daemon mode other than through the command line?

Thanks

Simon Bennetts

unread,
Feb 17, 2022, 6:55:14 AM2/17/22
to OWASP ZAP User Group
What sort of alternatives are you looking for?
You can write any sort of program to start ZAP, but that will just end up wrapping the command line.
The ways you can start ZAP are details in this FAQ: https://www.zaproxy.org/faq/how-can-you-start-zap/

Cheers,

Simon

kingthorin+owaspzap

unread,
Feb 17, 2022, 2:17:56 PM2/17/22
to OWASP ZAP User Group
I guess technically you could make a windows shortcut with the switches, however if you can double click a shortcut you may as well launch in GUI mode ;)

sonawan...@gmail.com

unread,
Feb 18, 2022, 1:45:09 AM2/18/22
to OWASP ZAP User Group
Hello

Try once 
1) On your desktop create one file start_ZAP.bat
2) Make sure files extensions is .bat and not .txt
3) edit this start_ZAP.bat in notepad and enter below text in it and save it  (change orange colored items)

echo "Invoking OWASP ZAP"
Start cmd.exe /k "C:\Program Files\OWASP\Zed Attack Proxy\zap.bat" -port 8080 -config api.key=<OWASP_ZAP_API_KEY> -config scanner.attackOnStart=true -config view.mode=attack -addonupdate -addoninstallall -daemon
echo "OWASP ZAP Started Successfully"

now whenever you double click on this - it will start zap 

Simon Bennetts

unread,
Feb 18, 2022, 4:32:36 AM2/18/22
to OWASP ZAP User Group
I wouldnt recommend starting ZAP with these options unless you are sure they are what you want.
For a start the "-daemon" option will start ZAP in daemon mode which means there will bo no UI :)
I'm also not sure what benefit this approach gives over using the zap.bat file that we supply - maybe someone can enlighten me?

Cheers,

Simon

sonawan...@gmail.com

unread,
Feb 18, 2022, 6:59:54 AM2/18/22
to OWASP ZAP User Group
Hello Simon

Actually this thread was asking how to start demon mode so i gave some easy batch file for it
But there are times when you want to use ZAP in api mode only not UI mode (such as in pipeline) then they can use it in demon mode.

psiinon

unread,
Feb 18, 2022, 7:05:38 AM2/18/22
to zaprox...@googlegroups.com
Ah good point :)
But I wouldnt recommend the other options unless people really want to use them ...

--
You received this message because you are subscribed to the Google Groups "OWASP ZAP User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zaproxy-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zaproxy-users/1e8cf34b-bb88-409a-8659-578842e8de80n%40googlegroups.com.


--
OWASP ZAP Project leader
Reply all
Reply to author
Forward
0 new messages