From 38a3115bddf7950648a37d37584238e8cfe8f40b Mon Sep 17 00:00:00 2001 From: relikd Date: Sat, 19 Sep 2020 00:11:52 +0200 Subject: [PATCH] Clickable domain tags --- out/static/style.css | 4 ++-- src/html_bundle.py | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/out/static/style.css b/out/static/style.css index f53e306..78f9b7c 100644 --- a/out/static/style.css +++ b/out/static/style.css @@ -154,7 +154,7 @@ td { padding: 0.2em 1em 0.2em 0.1em; } /* app bundle: domain tags */ .tags { margin: 2em 0; } -.tags i { +.tags a { font-size: 0.9em; font-style: normal; font-weight: normal; @@ -165,7 +165,7 @@ td { padding: 0.2em 1em 0.2em 0.1em; } display: inline-block; margin: 0.12em; } -.tags i.trckr, .tags.trckr i { background: #F9A7A7;; border-color: #B06363; } +.tags a.trckr, .tags.trckr a { background: #F9A7A7;; border-color: #B06363; } p.trckr { font-size: 0.9em; margin-left: 0.5em; } /* app bundle: graphs */ diff --git a/src/html_bundle.py b/src/html_bundle.py index 57b5cb7..0a2252c 100755 --- a/src/html_bundle.py +++ b/src/html_bundle.py @@ -63,13 +63,14 @@ def gen_radial_graph(percent): gen_pie_chart([1 - percent, percent], ['cs0', 'cs1'])) -def gen_dom_tags(sorted_arr, onlyTrackers=False): +def gen_dom_tags(sorted_arr, isSub, onlyTrackers=False): txt = '' anyMark = False for i, (name, count, mark) in enumerate(sorted_arr): title = '{} ({})'.format(name, count) if count > 1 else name clss = ' class="trckr"' if mark and not onlyTrackers else '' - txt += '{} '.format(clss, title) + txt += '{} '.format( + clss, 'subdomain' if isSub else 'domain', name, title) anyMark |= mark if txt: note = '

* Potential trackers are highlighted

' @@ -112,16 +113,16 @@ def gen_html(bundle_id, obj):

Connections

Potential Trackers ({ len(obj['tracker']) }):

- { gen_dom_tags(obj['tracker'], onlyTrackers=True) } + { gen_dom_tags(obj['tracker'], isSub=True, onlyTrackers=True) }

Overlapping Domains ({ len(obj['pardom']) }):

{ gen_dotgraph(obj['pardom']) } - { gen_dom_tags(obj['pardom']) } + { gen_dom_tags(obj['pardom'], isSub=False) }

Overlapping Subdomains ({ len(obj['subdom']) }):

{ gen_dotgraph(obj['subdom']) } - { gen_dom_tags(obj['subdom']) } + { gen_dom_tags(obj['subdom'], isSub=True) }

Download: json

''', title=name)