diff --git a/Pipfile.lock b/Pipfile.lock index 64b3b76..2a14430 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -250,7 +250,7 @@ "har2tree": { "editable": true, "git": "https://github.com/viper-framework/har2tree.git", - "ref": "09421d04b9e3c985b61404bec828b4be7d892e01" + "ref": "a486a8bd16ae3fd6ef69bedea6bcd0bfec572b16" }, "hyperlink": { "hashes": [ @@ -386,10 +386,10 @@ }, "pyasn1-modules": { "hashes": [ - "sha256:0c35a52e00b672f832e5846826f1fb7507907f7d52fba6faa9e3c4cbe874fe4b", - "sha256:b6ada4f840fe51abf5a6bd545b45bf537bea62221fa0dde2e8a553ed9f06a4e3" + "sha256:905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e", + "sha256:a50b808ffeb97cb3601dd25981f6b016cbb3d31fbf57a8b8a87428e6158d0c74" ], - "version": "==0.2.7" + "version": "==0.2.8" }, "pycparser": { "hashes": [ @@ -467,7 +467,7 @@ "scrapysplashwrapper": { "editable": true, "git": "https://github.com/viper-framework/ScrapySplashWrapper.git", - "ref": "235b090d5b3024459ba9f91fa5f61660b4af5014" + "ref": "3bd1786995c52ea75705940769d3f81979b4c830" }, "service-identity": { "hashes": [ diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index 881a435..72dd792 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -139,8 +139,6 @@ class Lookyloo(): with open((report_dir / 'meta'), 'r') as f: meta = json.load(f) ct = CrawledTree(har_files) - ct.find_parents() - ct.join_trees() temp = tempfile.NamedTemporaryFile(prefix='lookyloo', delete=False) pickle.dump(ct, temp) temp.close() diff --git a/website/web/static/tree.js b/website/web/static/tree.js index 21987aa..0e7a993 100644 --- a/website/web/static/tree.js +++ b/website/web/static/tree.js @@ -177,17 +177,20 @@ function hostnode_click(d) { var url_entries = overlay_hostname.append('svg'); - var interval_entries = 40; + var interval_entries = 10; urls.forEach((url, index, array) => { var jdata = JSON.parse(url); var url_data = url_entries.append('svg') .attr('class', 'url_data'); url_data.datum({'data': jdata}); url_data.append(d => text_entry(left_margin, top_margin + overlay_header_height + (interval_entries * index), urlnode_click, d)); - url_data.append(d => icon_list(left_margin + 5, top_margin + 20 + overlay_header_height + (interval_entries * index), d)); + url_data.append(d => icon_list(left_margin + 5, top_margin + 20 + overlay_header_height + (interval_entries * index), d, url_view=true)); }); + var cur_url_data_height = 0; url_entries.selectAll('.url_data').each(function(p, j){ + d3.select(this).attr('y', cur_url_data_height); + cur_url_data_height += d3.select(this).node().getBBox().height; var cur_icon_list_len = 0; // set position of icons based of their length d3.select(this).selectAll('.icon').each(function(p, j){ @@ -255,6 +258,9 @@ function icon(key, icon_path, d, icon_size){ iconContent.datum(d); iconContent.filter(d => { + if (['cookies_sent', 'cookies_received'].includes(key)) { + return false; + } if (typeof d.data[key] === 'boolean') { has_icon = d.data[key]; } else if (typeof d.data[key] === 'number') { @@ -270,6 +276,9 @@ function icon(key, icon_path, d, icon_size){ iconContent.filter(d => { + if (['cookies_sent', 'cookies_received'].includes(key)) { + return false; + } if (typeof d.data[key] === 'boolean') { return false; // return d.data[key]; @@ -286,13 +295,14 @@ function icon(key, icon_path, d, icon_size){ .style("font-size", "10px") .attr('x', icon_size + 1) .text(d => d.to_print); + if (has_icon) { return iconContent.node(); } return false; }; -function icon_list(relative_x_pos, relative_y_pos, d) { +function icon_list(relative_x_pos, relative_y_pos, d, url_view=false) { var icon_size = 16; // Put all the icone in one sub svg document @@ -312,14 +322,15 @@ function icon_list(relative_x_pos, relative_y_pos, d) { ['unknown_mimetype', "/static/wtf.png"], ['video', "/static/video.png"], ['request_cookie', "/static/cookie_read.png"], + ['cookies_sent', "/static/cookie_read.png"], ['response_cookie', "/static/cookie_received.png"], + ['cookies_received', "/static/cookie_received.png"], ['redirect', "/static/redirect.png"], ['redirect_to_nothing', "/static/cookie_in_url.png"] ]; - nb_icons = 0 icon_options.forEach(entry => { - bloc = icon(entry[0], entry[1], d, icon_size); + bloc = icon(entry[0], entry[1], d, icon_size, url_view); if (bloc){ icons.append(() => bloc); };