Code
This commit is contained in:
35
Code/venv/cipher_new.py
Normal file
35
Code/venv/cipher_new.py
Normal file
@ -0,0 +1,35 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user