Skip to content

Commit

Permalink
Merge pull request #56 from F5-Labs/development
Browse files Browse the repository at this point in the history
Minor fixed
  • Loading branch information
warburtr0n committed Aug 4, 2021
2 parents 03a2bf2 + c32ff4d commit fe8f8a3
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:3.7
LABEL version="1.4.2.2"
LABEL version="1.4.2.3"
LABEL maintainer="f5labs@f5.com"
RUN pip3 install pycurl
RUN pip3 install cryptonice
Expand Down
2 changes: 1 addition & 1 deletion cryptonice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# __init__.py

# Version of cryptonice package
__version__ = "1.4.2.2"
__version__ = "1.4.2.3"
Binary file modified cryptonice/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified cryptonice/__pycache__/getdns.cpython-38.pyc
Binary file not shown.
Binary file modified cryptonice/__pycache__/gethttp.cpython-38.pyc
Binary file not shown.
Binary file modified cryptonice/__pycache__/gettls.cpython-38.pyc
Binary file not shown.
Binary file modified cryptonice/__pycache__/scanner.cpython-38.pyc
Binary file not shown.
12 changes: 10 additions & 2 deletions cryptonice/getdns.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
def getDNSRecord(hostname, record_type):
record_list = []
got_record = False
#testdomain = dns.name.from_text(hostname)
#print(testdomain.labels)
#print('In getdns.py')

try:
while not got_record:
Expand All @@ -21,13 +20,22 @@ def getDNSRecord(hostname, record_type):
answer = dns.resolver.resolve(hostname, record_type, raise_on_no_answer=False)

if answer.rrset is None:
soa = dns.resolver.resolve(hostname, "SOA", raise_on_no_answer=False)
soa = soa[0].to_text().split('. ')[0]
print('No A record, attempting to find SOA')
'''
result = answer.response.authority[0].to_text()
print('No A record, found ' + str(result))
if "SOA" in result:
# Check for SOA's pointing to the same hostname and exit loop, if so
if result.split('. ')[0] == hostname:
got_record = True
print('SOA points to same domain as original hostname')
else:
hostname = result.split('. ')[0]
print('SOA points to ' + hostname)
'''
hostname = soa
else:
for ipval in answer:
record_list.append(ipval.to_text())
Expand Down
2 changes: 1 addition & 1 deletion cryptonice/gethttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def get_http(ip_address, hostname, int_port, usetls, http_pages, force_redirect)

# Include page data in output if requested
if http_pages:
connection_data.update({'HTMLbody': pagebody})
connection_data.update({'HTMLbody': str(pagebody)})


#### Wappalyzer build #####
Expand Down
2 changes: 1 addition & 1 deletion cryptonice/gettls.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def tls_scan(ip_address, str_host, commands_to_run, port_to_scan):
# cycle through all certificates (IP may have more than one)
count: int = 0
for cert_deployment in certinfo_result.certificate_deployments:
#print(count)
print(count)
if count == 0:
all_certificates_info.update({'leaf_certificate_has_must_staple_extension':
cert_deployment.leaf_certificate_has_must_staple_extension})
Expand Down
4 changes: 2 additions & 2 deletions cryptonice/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def scanner_driver(input_data):
print(f'{hostname} resolves to {ip_address}')
except:
str_error = "Unable to resolve " + hostname + "(domain does not exist or may not have any A records)"
dns_data = {str_error}
dns_data = ({'Error': str_error})
print(str_error)

#########################################################################################################
Expand Down Expand Up @@ -194,7 +194,7 @@ def scanner_driver(input_data):
print(f'{str_host} resolves to {ip_address}')
except:
str_error = "Unable to resolve " + str_host + "(domain does not exist or may not have any A records)"
new_dns_data = {str_error}
new_dns_data = ({'Error': str_error})
print(str_error)

# Recheck redirection on hew host
Expand Down
2 changes: 1 addition & 1 deletion sample_scan.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
"json_path" : "./results/",
"recommendations": false,
"geolocation": true,
"targets": ["hackerone.com"]
"targets": ["my-free.website", "www.my-free.website"]
}

0 comments on commit fe8f8a3

Please sign in to comment.