How to get ip address from a alert ?

31 views
Skip to first unread message

JLuis

unread,
Jul 9, 2018, 10:06:46 AM7/9/18
to OWASP ZAP Developer Group
I'm trying to get a ip address from a alert, Ex: my hostname is mysite.mydomain.com
how i could get that ip, to register the right host.

Is there any extension that can help me ?

Best regards

kingthorin+owaspzap

unread,
Jul 9, 2018, 12:16:13 PM7/9/18
to OWASP ZAP Developer Group
If the alert pertains to mysite.mydomain.com then it already has an IP, just look it up (nslookup or host).

I'm not really clear on your question.


JLuis

unread,
Jul 9, 2018, 12:31:45 PM7/9/18
to OWASP ZAP Developer Group
Sorry, I mean, if zap detects an alert from a domain "mysite.mydomain.com" I can get that domain in this way alert.getMessage().getRequestHeader().getHostName(), 

but I don't know the way to get IP addess from this object using java

Thanks for your anwers

kingthorin+owaspzap

unread,
Jul 9, 2018, 3:34:10 PM7/9/18
to OWASP ZAP Developer Group
You'd have to do that separately, it's not a detail that ZAP keeps track of. Unless you've accessed the target by IP to start with...in which case getHostName() would return the IP ex: http://127.0.0.1/some/thing?param=foobar

You could do something like this:

JLuis

unread,
Jul 9, 2018, 3:58:54 PM7/9/18
to OWASP ZAP Developer Group
Thanks a lot!,  it's very useful for me, i will try this example,

Regards
Reply all
Reply to author
Forward
0 new messages