Skip to content

Commit

Permalink
fix nessus when no dns resolution its enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Rebagliati committed Jun 2, 2022
1 parent 63bf561 commit 5cc16a3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions faraday_plugins/plugins/repo/nessus/DTO.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ def host_fqdn(self) -> str:
_dict = self.dict_tags
return _dict.get("host-fqdn", None)

@property
def host_rdns(self) -> str:
_dict = self.dict_tags
return _dict.get("host-rdns", None)

@property
def dict_tags(self):
host_tags = {}
Expand Down
14 changes: 10 additions & 4 deletions faraday_plugins/plugins/repo/nessus/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,17 @@ def parse_compliance_data(data: dict):
compliance_data[compliance_name] = value
return compliance_data

@staticmethod
def map_properties(host: ReportHost):
def map_properties(self, host: ReportHost):
if self.hostname_resolution:
name = host.host_properties.host_ip if host.host_properties.host_ip else host.name
else:
name = host.name
hostnames = [host.host_properties.host_fqdn]
if host.host_properties.host_rdns and host.host_properties.host_rdns not in hostnames:
hostnames.append(host.host_properties.host_rdns)
return {
"name": host.host_properties.host_ip if host.host_properties.host_ip else host.name,
"hostnames": host.host_properties.host_fqdn,
"name": name,
"hostnames": hostnames,
"mac": host.host_properties.mac_address,
"os": host.host_properties.operating_system
}
Expand Down

0 comments on commit 5cc16a3

Please sign in to comment.