setting port number from command line has no effect

308 views
Skip to first unread message

Jonathan Ben-Ami

unread,
Mar 4, 2015, 4:54:11 AM3/4/15
to zaprox...@googlegroups.com

I'm trying to start zap automatically for CI integration, but starting zap.exe with "-daemon -port 8090" does not affect the default configuration that was sent from the GUI. Zap still starts up listening on the port that was set on the GUI, which I validated with netstat. Does anyone know how to get this to work?

Jonathan Ben-Ami

unread,
Mar 4, 2015, 4:54:28 AM3/4/15
to zaprox...@googlegroups.com
I'm running the release version 2.3.1.

Simon Bennetts

unread,
Mar 4, 2015, 5:21:30 AM3/4/15
to zaprox...@googlegroups.com
Ah, I've not tried setting params via the exe, I'll have a look to see if thats possible.
In the meantime you can use the zap.bat file - that definitely supports command line parameters.

Cheers,

Simon

Simon Bennetts

unread,
Mar 4, 2015, 5:52:45 AM3/4/15
to zaprox...@googlegroups.com
How did you start ZAP?

I've just changed the properties of the ZAP.exe desktop shortcut to be:
"C:\Program Files (x86)\OWASP\Zed Attack Proxy\ZAP.exe" -daemon -port 8090
and that did the trick.

Cheers,

Simon

Jonathan Ben-Ami

unread,
Mar 4, 2015, 6:15:48 AM3/4/15
to zaprox...@googlegroups.com
Hi Simon, I'm trying to run zap.exe from the command line with the arguments, which doesn't work. The -daemon argument works, but not the port. Did you check the port number that it's listening on when you changed the shortcut command?

I tried running the batch with the arguments. This does configure the port number but it also opens a command console. Is there any way to avoid this console being opened? I'm not sure I want this open on the CI machine, since closing it closes zap which could break our tests.

Simon Bennetts

unread,
Mar 4, 2015, 6:49:21 AM3/4/15
to zaprox...@googlegroups.com
Strange.
I checked it was running on the port I specified, and this is working both via the shortcut and the command line.
Can you paste the exact command(s) you are running?

Jonathan Ben-Ami

unread,
Mar 4, 2015, 12:08:12 PM3/4/15
to zaprox...@googlegroups.com
Wow I just checked this directly from the command line and you're right, it works. Seems to be something with the .NET api for passing parameters, which is how I've been starting zap for the automated tests. I'll check it and update you.

--
You received this message because you are subscribed to a topic in the Google Groups "OWASP ZAP User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zaproxy-users/RM0N2FfVE_8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zaproxy-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages