Use ZAP to intercept CLI tool requests?

471 views
Skip to first unread message

rob oris

unread,
Mar 10, 2023, 11:22:43 AM3/10/23
to OWASP ZAP User Group
Hello,

I feel like this is a stupid n00b question, but here goes: How can I get ZAP to intercept HTTP/S requests and/or responses when I use a command line tool like msfconsole?  I sincerely like ZAP, and would like to use it for all of my proxying needs, but I have scoured the documentation and can figure out no way to do with ZAP what Burp Suite does out of the box.

When I set msfconsole to proxy HTTP through ZAP's address and port (127.0.0.1:8088) and generate HTTP traffic from msf, nothing at all happens in ZAP.  ZAP acts as if it sees no traffic.

Contrast this with Burp Suite: When I set msfconsole to proxy HTTP through Burp Suite's address and port, any HTTP traffic generated by msf is captured in Burp Suite and shown in its HTTP history (please see attached screenshot), making further analysis possible.

It seems like I might need to enable a ZAP service, but one to which I can find no reference in the documentation.  Using a browser instead of a command line tool like msf, ZAP works perfectly and its HUD is invaluable; I just need to make it work with command line tools for it to take its place as my go-to proxy.

Thank you in advance,

roboris

Screenshot 2023-03-03 at 17.44.18.png

thc...@gmail.com

unread,
Mar 10, 2023, 11:44:45 AM3/10/23
to zaprox...@googlegroups.com
Hi.

Is ZAP actually receiving the traffic?

Best regards.
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

psiinon

unread,
Mar 13, 2023, 8:38:30 AM3/13/23
to zaprox...@googlegroups.com
No idea why your replies are getting deleted, other than Google Groups being too aggressive :(
Are you using the ZAP desktop?
If so then if the requests are not showing up the the History then they are not getting proxied through ZAP.
If not then how are you using ZAP?

Cheers,

Simon



On Mon, Mar 13, 2023 at 12:31 PM rob oris <robo...@gmail.com> wrote:
Test reply
--
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/a2b75c76-c894-47de-8880-aa8aa8b763cdn%40googlegroups.com.


--
OWASP ZAP Project leader
Message has been deleted

psiinon

unread,
Mar 17, 2023, 7:17:56 AM3/17/23
to zaprox...@googlegroups.com
Good suggestions - thanks!

On Fri, Mar 17, 2023 at 10:37 AM Muhammad Zubair <mzuba...@gmail.com> wrote:

To use ZAP as a proxy for command line tools like msfconsole, you need to configure the command line tool to use the ZAP proxy. This can usually be done by setting the HTTP_PROXY and HTTPS_PROXY environment variables to the address and port of the ZAP proxy, like so:

javascript
Copy code
export HTTP_PROXY=http://127.0.0.1:8080
export HTTPS_PROXY=http://127.0.0.1:8080
Note that the port number should be the port number you configured ZAP to listen on, which you mentioned is 8088. Also, you may need to adjust the proxy settings in the command line tool's configuration file, depending on the tool.

Once you have set up the proxy, you should see traffic in ZAP. If you're still not seeing traffic in ZAP, it's possible that there is a firewall or other network configuration issue preventing the traffic from reaching ZAP. You could try using a tool like Wireshark to see if the traffic is reaching your computer and being forwarded to ZAP.

I hope this helps! Let me know if you have any more questions.
--
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.
Reply all
Reply to author
Forward
0 new messages