ZAP extension example not working

133 views
Skip to first unread message

kasun balasooriya

unread,
Nov 1, 2015, 11:49:08 PM11/1/15
to OWASP ZAP Developer Group
Hi!
I am trying to develop a plugin for zap and I need to add a new menu item. I followed the instructions in the article[1] , but the menu item is not appearing. Does the usage of method addToolsMenuItem() which is deprecated has something to do with this? Please advice. Thanks in advance!


psiinon

unread,
Nov 2, 2015, 3:27:39 AM11/2/15
to OWASP ZAP Developer Group
Hiya,

No, that method will still work.

We do have a simple example add-on here: https://github.com/zaproxy/zap-extensions/tree/alpha/src/org/zaproxy/zap/extension/simpleExample
I keep meaning to publish a blog post explaining it in more detail, but just havnt found the time :(

Are there any errors shown in your IDE console or zap.log file?

Cheers,

Simon

kasun balasooriya

unread,
Nov 2, 2015, 5:00:11 AM11/2/15
to OWASP ZAP Developer Group

Thank you for the quick response! No errors are shown in the console. But I do get the warning 
Warning: failed to load jar files from /home/kasun/Desktop/Projects/zaproxy/bin/lib. 

I placed the simpleExtension folder inside /zaproxy/src/org/zaproxy/zap/extension  and built the project.  Anything else i should do for the menu item to appear? Or am i doing it wrong? 

thc...@gmail.com

unread,
Nov 2, 2015, 5:07:53 AM11/2/15
to zaproxy...@googlegroups.com
Hi.

That warning is normal when running ZAP from source (the libraries are
already added to the classpath anyway).

If you are adding the extension to ZAP core you need to include it in
the method CoreFunctionality.createExtensions(), to have it loaded.

Best regards.

On 02/11/15 10:00, kasun balasooriya wrote:
>
> Thank you for the quick response! No errors are shown in the console.
> But I do get the warning
> /Warning: failed to load jar files from
> /home/kasun/Desktop/Projects/zaproxy/bin/lib. /
>
> I placed the /simpleExtension /folder inside
> //zaproxy/src/org/zaproxy/zap/extension / and built the project.
> Anything else i should do for the menu item to appear? Or am i doing it
> wrong?
> /
> /On Monday, November 2, 2015 at 1:57:39 PM UTC+5:30, psiinon wrote:
>
> Hiya,
>
> No, that method will still work.
>
> We do have a simple example add-on here:
> https://github.com/zaproxy/zap-extensions/tree/alpha/src/org/zaproxy/zap/extension/simpleExample
> <https://github.com/zaproxy/zap-extensions/tree/alpha/src/org/zaproxy/zap/extension/simpleExample>
> I keep meaning to publish a blog post explaining it in more detail,
> but just havnt found the time :(
>
> Are there any errors shown in your IDE console or zap.log file?
>
>
>
>
> Cheers,
>
> Simon
>
> On Monday, 2 November 2015 04:49:08 UTC, kasun balasooriya wrote:
>
> Hi!
> I am trying to develop a plugin for zap and I need to add a new
> menu item. I followed the instructions in the article[1] , but
> the menu item is not appearing. Does the usage of method
> /addToolsMenuItem()/ which is deprecated has something to do
> with this? Please advice. Thanks in advance!
>
>
> [1] https://www.owasp.org/images/3/37/GuidelineZAPExtensionsAddOns1.0.pdf
> <https://www.owasp.org/images/3/37/GuidelineZAPExtensionsAddOns1.0.pdf>
>
> --
> You received this message because you are subscribed to the Google
> Groups "OWASP ZAP Developer Group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to zaproxy-devel...@googlegroups.com
> <mailto:zaproxy-devel...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

psiinon

unread,
Nov 2, 2015, 5:46:03 AM11/2/15
to OWASP ZAP Developer Group
But you probably dont actually want to do that.
Its better to build your code in zap-extentions and package it as an add-on (with a .zap extension) - thats what all of the other add-ons in zap-extensions do.

Cheers,

Simon

kasun balasooriya

unread,
Nov 2, 2015, 5:57:24 AM11/2/15
to OWASP ZAP Developer Group


On Monday, November 2, 2015 at 3:37:53 PM UTC+5:30, thc202 wrote:
Hi.

That warning is normal when running ZAP from source (the libraries are
already added to the classpath anyway).

If you are adding the extension to ZAP core you need to include it in
the method CoreFunctionality.createExtensions(), to have it loaded.

Worked. Thank you! I will use this for the moment to test the work i'm doing.   

kasun balasooriya

unread,
Nov 2, 2015, 6:02:19 AM11/2/15
to OWASP ZAP Developer Group
I will use the CoreFunctionality.createExtensions()  for now and do the other related work. I will publish the work as an extension. Thenk you for the help. Much appreciated! 

Regards!

Oscar Andres Usuga

unread,
Nov 4, 2015, 6:26:27 PM11/4/15
to OWASP ZAP Developer Group
Thank you.

I was having the same problem, the PDF document did not mention this.

This post is so helpful.

Oscar Andres Usuga

unread,
Nov 4, 2015, 6:28:14 PM11/4/15
to OWASP ZAP Developer Group
Hi kasun.

I am doing the same thing. First, I need to test my new extension and then build and publish it as an add-on.

If you want, we can share work in order yo achieve our goals!

Regards!

kasun balasooriya

unread,
Nov 5, 2015, 12:31:46 AM11/5/15
to OWASP ZAP Developer Group
Hi Oscar, 

Yes please. Thank you!

Regards!

kasun balasooriya

unread,
Nov 8, 2015, 10:26:22 AM11/8/15
to OWASP ZAP Developer Group
Hi!

I managed to create a sample zap add-on using the sample code available. I have trouble understanding how the i18nKey works when creating a new ZapMenuItem. 
Can somebody help me to understand this please? 

Thanks in advance. 

thc...@gmail.com

unread,
Nov 8, 2015, 10:56:12 AM11/8/15
to zaproxy...@googlegroups.com
Hi.

That is the key used to obtain the (internationalised) name of the menu
item, which is defined in a Messages.properties file (either in core or
in the corresponding add-on).
You also need to define the key:
<i18nKey>.mnemonic
with the letter used to select the menu.

Best regards.

On 08/11/15 15:26, kasun balasooriya wrote:
> Hi!
>
> I managed to create a sample zap add-on using the sample code available.
> I have trouble understanding how the /i18nKey /works when creating a
> new /ZapMenuItem. /
> Can somebody help me to understand this please?
>
> Thanks in advance.
>
> On Monday, November 2, 2015 at 10:19:08 AM UTC+5:30, kasun balasooriya
> wrote:
>
> Hi!
> I am trying to develop a plugin for zap and I need to add a new menu
> item. I followed the instructions in the article[1] , but the menu
> item is not appearing. Does the usage of method /addToolsMenuItem()/
> which is deprecated has something to do with this? Please advice.
> Thanks in advance!
>
>
> [1] https://www.owasp.org/images/3/37/GuidelineZAPExtensionsAddOns1.0.pdf
> <https://www.owasp.org/images/3/37/GuidelineZAPExtensionsAddOns1.0.pdf>
>
> --
> You received this message because you are subscribed to the Google
> Groups "OWASP ZAP Developer Group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to zaproxy-devel...@googlegroups.com
> <mailto:zaproxy-devel...@googlegroups.com>.

kasun balasooriya

unread,
Nov 12, 2015, 1:25:30 AM11/12/15
to OWASP ZAP Developer Group
Hi! I wrote a blogpost[1] on how to build the sample addon in the alpha branch. Please review and comment if there are any mistakes. Hope this will be useful for someone new when creating addons. 
Thanks & regards!! 

kingthorin+owaspzap

unread,
Nov 12, 2015, 6:46:42 AM11/12/15
to OWASP ZAP Developer Group
Nice work!

Oscar Andres Usuga

unread,
Nov 17, 2015, 5:08:22 PM11/17/15
to zaproxy...@googlegroups.com
Excellent!

El jue., 12 de nov. de 2015 a la(s) 6:46 a. m., kingthorin+owaspzap <kingt...@gmail.com> escribió:
Nice work!

--
You received this message because you are subscribed to a topic in the Google Groups "OWASP ZAP Developer Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zaproxy-develop/2qpDnTfH164/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zaproxy-devel...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages