Clickable domain tags

This commit is contained in:
relikd
2020-09-19 00:11:52 +02:00
parent ba8091268d
commit 38a3115bdd
2 changed files with 8 additions and 7 deletions

View File

@@ -154,7 +154,7 @@ td { padding: 0.2em 1em 0.2em 0.1em; }
/* app bundle: domain tags */ /* app bundle: domain tags */
.tags { margin: 2em 0; } .tags { margin: 2em 0; }
.tags i { .tags a {
font-size: 0.9em; font-size: 0.9em;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
@@ -165,7 +165,7 @@ td { padding: 0.2em 1em 0.2em 0.1em; }
display: inline-block; display: inline-block;
margin: 0.12em; 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; } p.trckr { font-size: 0.9em; margin-left: 0.5em; }
/* app bundle: graphs */ /* app bundle: graphs */

View File

@@ -63,13 +63,14 @@ def gen_radial_graph(percent):
gen_pie_chart([1 - percent, percent], ['cs0', 'cs1'])) 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 = '' txt = ''
anyMark = False anyMark = False
for i, (name, count, mark) in enumerate(sorted_arr): for i, (name, count, mark) in enumerate(sorted_arr):
title = '{} ({})'.format(name, count) if count > 1 else name title = '{} ({})'.format(name, count) if count > 1 else name
clss = ' class="trckr"' if mark and not onlyTrackers else '' clss = ' class="trckr"' if mark and not onlyTrackers else ''
txt += '<i{}>{}</i> '.format(clss, title) txt += '<a{} href="/{}/#{}">{}</a> '.format(
clss, 'subdomain' if isSub else 'domain', name, title)
anyMark |= mark anyMark |= mark
if txt: if txt:
note = '<p class="trckr">* Potential trackers are highlighted</p>' note = '<p class="trckr">* Potential trackers are highlighted</p>'
@@ -112,16 +113,16 @@ def gen_html(bundle_id, obj):
<h3>Connections</h3> <h3>Connections</h3>
<div> <div>
<h4>Potential Trackers ({ len(obj['tracker']) }):</h4> <h4>Potential Trackers ({ len(obj['tracker']) }):</h4>
{ gen_dom_tags(obj['tracker'], onlyTrackers=True) } { gen_dom_tags(obj['tracker'], isSub=True, onlyTrackers=True) }
<p></p> <p></p>
<h4>Overlapping Domains ({ len(obj['pardom']) }):</h4> <h4>Overlapping Domains ({ len(obj['pardom']) }):</h4>
{ gen_dotgraph(obj['pardom']) } { gen_dotgraph(obj['pardom']) }
{ gen_dom_tags(obj['pardom']) } { gen_dom_tags(obj['pardom'], isSub=False) }
<h4>Overlapping Subdomains ({ len(obj['subdom']) }):</h4> <h4>Overlapping Subdomains ({ len(obj['subdom']) }):</h4>
{ gen_dotgraph(obj['subdom']) } { gen_dotgraph(obj['subdom']) }
{ gen_dom_tags(obj['subdom']) } { gen_dom_tags(obj['subdom'], isSub=True) }
</div> </div>
<p class="right snd">Download: <a href="data.json" download="{bundle_id}.json">json</a></p>''', title=name) <p class="right snd">Download: <a href="data.json" download="{bundle_id}.json">json</a></p>''', title=name)