forked from ewust/mimic-tls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
table.py
33 lines (24 loc) · 872 Bytes
/
table.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import sys
from collections import defaultdict
results = defaultdict(dict) # domain => {sni => {fprint => result}}}
for line in sys.stdin:
parts = line.split(' ')
host,sni,fprint = parts[1].split('_')
result = parts[2].strip()
if sni not in results[host]:
results[host][sni] = defaultdict(str)
results[host][sni][fprint] = result
domains = sorted(results.keys())
print(' & ', ' & '.join(domains), ' \\\\')
for host in domains:
host_res = []
for sni in domains:
sni_res = ''
for fprint in ["chrome-105","go","openssl"]:
okay = results[host][sni][fprint] == 'allowed'
if okay:
sni_res += '\\textcolor{blue}{O}'
else:
sni_res += '\\textcolor{red}{X}'
host_res.append(sni_res)
print('%s & %s \\\\' % (host, ' & '.join(host_res)))