This code is amazing, I have done a bit of tweak as per my need, but my knowledge in development is bit limited. I tried referring to the Javadocs. It didnt work.
Can some help me how to add HTTP Request headers, HTTP Response headers also to the result.??
Code is given below.
var HttpSender = Java.type("org.parosproxy.paros.network.HttpSender")
var HttpMessage = Java.type("org.parosproxy.paros.network.HttpMessage")
var HttpHeader = Java.type("org.parosproxy.paros.network.HttpHeader")
var HttpRequestHeader = Java.type("org.parosproxy.paros.network.HttpRequestHeader")
var URI = Java.type("org.apache.commons.httpclient.URI")
function consumer(event) {
if (event.getEventType() != "alert.added") return
var params = event.getParameters()
alert = {
"fields": [
{ "Alert": params.get("name"),
"URL": "`" + params.get("uri") + "`" ,
"Risk": params.get("riskString"),
"Confidence": params.get("confidenceString"),
// HTTP Request headers
//HTTP Response headers
}
]
}
var body = {"data": [alert] }
body = JSON.stringify(body)
print(body)
}
function install(helper) {
org.zaproxy.zap.ZAP.getEventBus().registerConsumer(consumer, "org.zaproxy.zap.extension.alert.AlertEventPublisher")
}
function uninstall(helper) {
org.zaproxy.zap.ZAP.getEventBus().unregisterConsumer(consumer)
}
Thanks & Regards,
Karthik Kanthaswamy | CISO |
|
![](https://ci4.googleusercontent.com/proxy/B75bGTCh0f5PnjmUJaRN9A3dLslcWl0vUj2LHrIY5qjc7z-YgvYDSpwQOojk3usZGQst-INFOIJhLtf9lxEwlQBOvr709WFx=s0-d-e1-ft#https://cdmx.in/wp-content/uploads/2016/12/logo-1.png) CodeMax IT Solutions Pvt. Ltd. |
Email karthik.kanthaswamy@CdMx.in Address Office No A - 201, 202, 2nd Floor, Asian Pinnacle, behind Bank of India, Fatorda, Goa 403602 Mobile +91 776-060-0458 Website CdMx.in |
This
e-mail may contain privileged and confidential information which is the
property of CodeMax IT Solutions Pvt. Ltd. It is intended only for the
use of the individual or entity to which it is addressed. If you are not
the intended recipient, you are not authorized to read, retain, copy,
print, distribute or use this message. If you have received this
communication in error, please notify the sender and delete all copies
of this message. CodeMax IT Solutions Pvt. Ltd. does not accept any
liability for virus infected e-mails.