Http Sender used jython run jar file

53 views
Skip to first unread message

TuanTu Nguyen

unread,
Jun 17, 2024, 2:01:55 AM6/17/24
to ZAP User Group
Dear all,

I need to use the ZAP tool to scan API A, but API A requires a real-time token to be generated each time a request is sent to the server. I have already written a jar file to create the token, but currently, I don't know how to use Http Sender (Python code) to run that jar file.

My Python code:

  • import os
  • os.system("java -jar <path to jar file>")

However, every time I run it, it gives an error: " java.lang.reflect.UndeclaredThrowableException java.lang.reflect.UndeclaredThrowableException 

Can anyone help me? Many Thanks

TuanTu Nguyen

unread,
Jun 25, 2024, 5:11:35 AM6/25/24
to ZAP User Group
I have a solution for my problem. Thanks to view my questionn:)

Vào lúc 13:01:55 UTC+7 ngày Thứ Hai, 17 tháng 6, 2024, TuanTu Nguyen đã viết:

Simon Bennetts

unread,
Jul 1, 2024, 9:45:09 AM7/1/24
to ZAP User Group
If you have a solution, then you dont need an answer any more?

Cheers,

Simon

TuanTu Nguyen

unread,
Jul 2, 2024, 12:35:34 AM7/2/24
to ZAP User Group
Thank you, Simon, for your interest in my question. I made a mistake by not thoroughly understanding the HTTP Header template, which led to errors when I coded in Python. Now that I understand the template, I no longer encounter these errors and can customize the pentest scripts. Thanks to the team for creating such a powerful tool.

Vào lúc 20:45:09 UTC+7 ngày Thứ Hai, 1 tháng 7, 2024, psi...@gmail.com đã viết:

Simon Bennetts

unread,
Jul 9, 2024, 5:22:47 AM7/9/24
to ZAP User Group
Good to hear its working for you now!

kingthorin+zap

unread,
Jul 9, 2024, 11:29:20 AM7/9/24
to ZAP User Group
If you want to share with the community feel free to open a PR here: https://github.com/zaproxy/community-scripts/
Reply all
Reply to author
Forward
0 new messages