How to get MX records of a website?

81 views
Skip to first unread message

Binhomolayzu Rekt

unread,
May 31, 2021, 8:01:25 AM5/31/21
to OWASP ZAP User Group
Hello,

Is it possible to get the DNS MX records of a website using ZAP Standalone script? 


Please let me know where can i start to implement this.

Thanks,
Bingomolayzu

kingthorin+owaspzap

unread,
May 31, 2021, 9:04:41 AM5/31/21
to OWASP ZAP User Group

Binhomolayzu Rekt

unread,
May 31, 2021, 11:03:50 AM5/31/21
to OWASP ZAP User Group
Dear kingthorin,

thanks for the reply. i tried out this but it throw up an error, 
`java.lang.RuntimeException: javax.naming.OperationNotSupportedException: DNS Operation not supported [response code 4]; remaining name example.com`.

My code -

var iDirC = Java.type("javax.naming.directory.InitialDirContext");
var idi = new iDirC();
var attributex = idi.getAttributes("dns:/example.com");

How to proceed with this?

kingthorin+owaspzap

unread,
May 31, 2021, 11:18:43 AM5/31/21
to OWASP ZAP User Group
To be clear I haven't tested, I just knew the script for lookups was there because I created it, then I looked up some MX details for java. Looking further....

Looks like you  might need to specify the naming server to use or disable write failures:
Reply all
Reply to author
Forward
0 new messages