Skip to content

Commit

Permalink
Fixed bug with dnsrecon integration
Browse files Browse the repository at this point in the history
  • Loading branch information
drakylar committed Jan 3, 2022
1 parent 70b5c55 commit 24e300d
Showing 1 changed file with 55 additions and 3 deletions.
58 changes: 55 additions & 3 deletions routes/ui/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2759,7 +2759,7 @@ def beautify_output(xml_str):
cvss_tmp2 = issue_obj.find('cvss3_temporal')
cvss_tmp3 = issue_obj.find('cvss_temporal')
if cvss_tmp1 and cvss_tmp1.text != '-':
cvss=float(cvss_tmp1.text)
cvss = float(cvss_tmp1.text)
elif cvss_tmp2 and cvss_tmp2.text != '-':
cvss = float(cvss_tmp2.text)
elif cvss_tmp3 and cvss_tmp3.text != '-':
Expand Down Expand Up @@ -4493,6 +4493,24 @@ def dnsrecon_page_form(project_id, current_project, current_user):
(Port, Type)
'''

if host_ip:
# check if host_ip domain or IP
try:
ipaddress.ip_address(host_ip)
except Exception as e:
# its domain, need ip
host_ip_old = host_ip
host_ip = ''
for hostname_row_tmp in scan_result:
host_ip_tmp = hostname_row['address'] if 'address' in hostname_row else ''
domain_tmp = hostname_row['mname'] if 'mname' in hostname_row else ''
if host_ip_old == domain_tmp:
try:
ipaddress.ip_address(host_ip_tmp)
host_ip = host_ip_tmp
except Exception as e1:
pass

if hostname_name != '' and host_ip != '':
# 1. Name <--> Address
if hostname == '':
Expand Down Expand Up @@ -4556,6 +4574,23 @@ def dnsrecon_page_form(project_id, current_project, current_user):
(Port, Type)
'''
if host_ip:
# check if host_ip domain or IP
try:
ipaddress.ip_address(host_ip)
except Exception as e:
# its domain, need ip
host_ip_old = host_ip
host_ip = ''
for hostname_row_tmp in scan_result:
host_ip_tmp = hostname_row_tmp['Address']
domain_tmp = hostname_row_tmp['Name']
if host_ip_old == domain_tmp:
try:
ipaddress.ip_address(host_ip_tmp)
host_ip = host_ip_tmp
except Exception as e1:
pass

if hostname_name != '' and host_ip != '':
# 1. Name <--> Address
Expand Down Expand Up @@ -4621,6 +4656,23 @@ def dnsrecon_page_form(project_id, current_project, current_user):
(Port, Type)
'''
if host_ip:
# check if host_ip domain or IP
try:
ipaddress.ip_address(host_ip)
except Exception as e:
# its domain, need ip
host_ip_old = host_ip
host_ip = ''
for hostname_row_tmp in scan_result:
host_ip_tmp = hostname_row_tmp.get('address') if hostname_row_tmp.get('address') else ''
domain_tmp = hostname_row_tmp.get('name') if hostname_row_tmp.get('name') else ''
if host_ip_old == domain_tmp:
try:
ipaddress.ip_address(host_ip_tmp)
host_ip = host_ip_tmp
except Exception as e1:
pass

if hostname_name != '' and host_ip != '':
# 1. Name <--> Address
Expand Down Expand Up @@ -5103,7 +5155,7 @@ def nuclei_page_form(project_id, current_project, current_user):
issue_description = issue_obj['info']['description'] if 'description' in issue_obj['info'] else ''
issue_references = "Links:\n{}".format('\n'.join([' - {}'.format(x) for x in issue_obj['info']['reference']])) if issue_obj['info']['reference'] else ""
issue_severity = "info"
issue_matcher_name = 'Matched: {}'.format(issue_obj['matcher-name']) if 'matcher-name' in issue_obj else ""
issue_matcher_name = 'Matched: {}'.format(issue_obj['matcher-name']) if 'matcher-name' in issue_obj else ""
issue_cvss = 0.0
if issue_severity == 'low':
issue_cvss = 2.0
Expand Down Expand Up @@ -5274,4 +5326,4 @@ def nuclei_page_form(project_id, current_project, current_user):
def nmap_helper_page(project_id, current_project, current_user):
return render_template('project/tools/helpers/nmap-helper.html',
current_project=current_project,
tab_name='Nmap Helper')
tab_name='Nmap Helper')

0 comments on commit 24e300d

Please sign in to comment.