Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
print('')
command = CertificateInfoScanCommand()
scan_result = scanner.run_scan_command(server_info, command)
print(G+' [+] Certificate Information:'+color.TR2+C)
for entry in scan_result.as_text():
if entry != '':
if 'certificate information' in entry.lower():
pass
elif ':' in entry:
print(GR+' [+] '+entry.strip().split(':', 1)[0].strip()+' : '+C+entry.strip().split(':', 1)[1].strip())
else:
print(C+'\n [+] ' +entry.strip())
print('')
command = HttpHeadersScanCommand()
scan_result = scanner.run_scan_command(server_info, command)
print(G+' [+] HTTP Results:'+C+color.TR2+C)
for entry in scan_result.as_text():
if 'http security' not in entry.strip().lower() and entry != '':
if '-' in entry:
print(GR+' [+] '+entry.split('-',1)[0].strip()+' - '+C+entry.split('-',1)[1].strip())
elif ':' in entry:
print(GR+' [+] '+entry.strip().split(':', 1)[0].strip()+' : '+C+entry.strip().split(':', 1)[1].strip())
else:
print(C+'\n [+] ' +entry.strip())
print('')
except Exception as e:
print(R+' [-] Unhandled SSL Runtime Exception : '+str(e))
pass
print('')
command = CertificateInfoScanCommand()
scan_result = scanner.run_scan_command(server_info, command)
print(G+' [+] Certificate Information:')
for entry in scan_result.as_text():
if entry != '':
if 'certificate information' in entry.lower():
pass
elif ':' in entry:
print(GR+' [+] '+entry.strip().split(':', 1)[0].strip()+' : '+C+entry.strip().split(':', 1)[1].strip())
else:
print(O+'\n [+] ' +entry.strip())
print('')
command = HttpHeadersScanCommand()
scan_result = scanner.run_scan_command(server_info, command)
print(G+' [+] HTTP Results:')
for entry in scan_result.as_text():
if 'http security' not in entry.strip().lower() and entry != '':
if '-' in entry:
print(GR+' [+] '+entry.split('-',1)[0].strip()+' - '+C+entry.split('-',1)[1].strip())
elif ':' in entry:
print(GR+' [+] '+entry.strip().split(':', 1)[0].strip()+' : '+C+entry.strip().split(':', 1)[1].strip())
else:
print(O+'\n [+] ' +entry.strip())
print('')
except Exception as e:
print(R+' [-] Unhandled SSL Runtime Exception : '+str(e))
pass
print(' {}'.format(cipher.name))
# Certificate information
command = CertificateInfoScanCommand()
scan_result = synchronous_scanner.run_scan_command(server_info, command)
for entry in scan_result.as_text():
print(entry)
# Heartbleed vulnerability info
command = HeartbleedScanCommand()
scan_result = synchronous_scanner.run_scan_command(server_info, command)
for entry in scan_result.as_text():
print(entry)
# HTTP Headers info
command = HttpHeadersScanCommand()
scan_result = synchronous_scanner.run_scan_command(server_info, command)
for entry in scan_result.as_text():
print(entry)
except Exception as e:
self.handle_exception(e, "Error running SSL scan")
pass