35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
import subprocess
|
|
import json
|
|
|
|
def analyze_with_external_tools(host, port, skip_cert_verification=False):
|
|
# Basis curl-Kommando
|
|
terminal = ['curl', '--http3-only', '-v', f'https://{host}:{port}']
|
|
|
|
# Zertifikatsüberprüfung skippen falls gewünscht
|
|
if skip_cert_verification:
|
|
terminal.append('-k') # oder '--insecure'
|
|
|
|
try:
|
|
result = subprocess.run(terminal, capture_output=True, text=True)
|
|
|
|
# Analyse der Ausgabe für TLS-Informationen
|
|
return result.stderr
|
|
except Exception as e:
|
|
print(f"Externe Tool-Analyse fehlgeschlagen: {e}")
|
|
return None
|
|
|
|
# Verwendung mit Zertifikatsüberprüfung (Standard)
|
|
result = analyze_with_external_tools("cloudflare.com", 443)
|
|
print(60*"=" + "cloudflare.com" + 60*"=")
|
|
print(result)
|
|
print(200*"=")
|
|
print()
|
|
print()
|
|
result = analyze_with_external_tools("nextcloud.mofixx.net", 443)
|
|
print(60*"=" + "nextcloud.mofixx.net" + 60*"=")
|
|
print(result)
|
|
print(200*"=")
|
|
|
|
# Verwendung ohne Zertifikatsüberprüfung
|
|
#result_insecure = analyze_with_external_tools("localhost", 4433, skip_cert_verification=True)
|
|
#print(result_insecure) |