You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm performing a scan on an IP block where some IPs have multiple PTR records. A simple nslookup of the IP space returned more hostnames than SpiderFoot with sfp_dnsresolve and other modules.
Return a triple (hostname, aliaslist, ipaddrlist) where hostname is the primary host name responding to the given ip_address, aliaslist is a (possibly empty) list of alternative host names for the same address...
The primary host name seems to change if you run this function in succession multiple times. No results are ever returned for the aliaslist in the few cases I tested though.
A solution to this would be to use the dnspython library used elsewhere in SF. Here's some example code:
I'm performing a scan on an IP block where some IPs have multiple PTR records. A simple nslookup of the IP space returned more hostnames than SpiderFoot with sfp_dnsresolve and other modules.
sfp_dnsresolve performs the following:
spiderfoot/modules/sfp_dnsresolve.py
Lines 297 to 299 in 64942c4
The
resolveIP
function usessocket.gethostbyaddr(ipaddr)
as shown below:spiderfoot/sflib.py
Lines 1074 to 1075 in f90f932
According to the Python docs:
The primary host name seems to change if you run this function in succession multiple times. No results are ever returned for the aliaslist in the few cases I tested though.
A solution to this would be to use the dnspython library used elsewhere in SF. Here's some example code:
The results variable will be populated with all PTR records.
What version of Python are you using? Python 3.8.10
What version of SpiderFoot are you using (stable release or Git
master
branch)? SpiderFoot stable v3.5.0You may also wish to check if your issue has been posted previously: I did not see any similarly reported issues.
The text was updated successfully, but these errors were encountered: