diff --git a/startScan/templates/startScan/detail_scan.html b/startScan/templates/startScan/detail_scan.html index fef4d07b..4823caf7 100644 --- a/startScan/templates/startScan/detail_scan.html +++ b/startScan/templates/startScan/detail_scan.html @@ -674,7 +674,7 @@ $("#pills-subdomain-tab").click(function() { tech_badge = ''; interesting_badge = ''; if (row['technologies']){ - tech_badge = `` + parse_technology(row['technologies'], "info", outline=true); + tech_badge = `` + parse_technology(row['technologies'], "info", outline=true, scan_id={{scan_history_id}}); } if(row['is_interesting']) { @@ -753,10 +753,10 @@ $("#pills-subdomain-tab").click(function() { { Object.entries(data).forEach(([key, value]) => { if (value['is_cdn']) { - ip_badge += `${value.address}` + ip_badge += `${value.address}` } else{ - ip_badge += `${value.address}` + ip_badge += `${value.address}` } }); return ip_badge; @@ -776,7 +776,7 @@ $("#pills-subdomain-tab").click(function() { port_obj = data[ip]['ports'][port] badge_color = port_obj['is_uncommon'] ? 'danger' : 'info'; title = port_obj['is_uncommon'] ? 'Uncommon Port - ' + port_obj['description'] : port_obj['description']; - port_badge += `${port_obj['number']}/${port_obj['service_name']}` + port_badge += `${port_obj['number']}/${port_obj['service_name']}` } } return port_badge; diff --git a/static/assets/css/custom.css b/static/assets/css/custom.css index 2360a294..851e1db3 100644 --- a/static/assets/css/custom.css +++ b/static/assets/css/custom.css @@ -332,3 +332,7 @@ div.dataTables_wrapper div.dataTables_filter { .anychart-credits-text{ display: none; } + +.badge-link{ + cursor: pointer; +} diff --git a/static/custom/custom.js b/static/custom/custom.js index cdb9b064..7a3f6673 100644 --- a/static/custom/custom.js +++ b/static/custom/custom.js @@ -240,18 +240,23 @@ function parse_comma_values_into_span(data, color, outline=null) return data_with_span; } -function parse_technology(data, color, outline=null) +function parse_technology(data, color, outline=null, scan_id=null) { if(outline) { - var badge = ``; + var badge = ``; + var badge = `"; + if (scan_id){ + data_with_span += badge + ` onclick="get_tech_details('${data[key]['name']}', ${scan_id})">` + data[key]['name'] + ""; + } + else{ + data_with_span += badge + ">" + data[key]['name'] + ""; + } } return data_with_span; } @@ -404,7 +409,7 @@ function get_interesting_subdomains(scan_history_id){ {'data': 'http_status'}, {'data': 'content_length'}, {'data': 'http_url'}, - {'data': 'technology_stack'}, + {'data': 'technologies'}, ], "columnDefs": [ { @@ -421,8 +426,8 @@ function get_interesting_subdomains(scan_history_id){ { "render": function ( data, type, row ) { tech_badge = ''; - if (row['technology_stack']){ - tech_badge = `` + parse_comma_values_into_span(row['technology_stack'], "info", outline=true); + if (row['technologies']){ + tech_badge = `` + parse_technology(row['technologies'], "info", outline=true, scan_id=null); } if (row['http_url']) { return ``+data+`` + tech_badge; @@ -764,7 +769,7 @@ function get_ips(scan_id){ function get_ip_details(ip_address, scan_id){ // render tab modal - $('#tab-modal-title').html('Details for IP: ' + ip_address); + $('#tab-modal-title').html('Details for IP: ' + ip_address + ''); // add tab modal title $('#modal-tabs').empty(); $('#modal-tabs').append(`Open Ports`); @@ -798,19 +803,21 @@ function get_ip_details(ip_address, scan_id){ $('#modal-subdomain-count').html(`${data['subdomains'].length} `); for (subdomain in data['subdomains']){ subdomain_obj = data['subdomains'][subdomain]; + badge_color = subdomain_obj['http_status'] == 404 ? 'danger' : ''; if (subdomain_obj['http_url']) { - $("#modal-subdomain-text").append(`${subdomain_obj['name']}`) + $("#modal-subdomain-text").append(`${subdomain_obj['name']}`) } else { - $("#modal-subdomain-text").append(`${subdomain_obj['name']}`) + $("#modal-subdomain-text").append(`${subdomain_obj['name']}`) } } + $('#modal-text-subdomain').append(`*Subdomains highlighted are 404 HTTP Status`); }); } function get_port_details(port, scan_id){ // render tab modal - $('#tab-modal-title').html('Details for Port: ' + port); + $('#tab-modal-title').html('Details for Port: ' + port + ''); // add tab modal title $('#modal-tabs').empty(); $('#modal-tabs').append(`IP Address`); @@ -832,9 +839,10 @@ function get_port_details(port, scan_id){ $('#modal-ip-count').html(`${data['ips'].length} `); for (ip in data['ips']){ ip_obj = data['ips'][ip]; - text_color = ip_obj['cdn'] ? 'warning' : ''; + text_color = ip_obj['is_cdn'] ? 'warning' : ''; $("#modal-ip-text").append(`${ip_obj['address']}`) } + $('#modal-text-ip').append(`*IP Address highlighted are CDN IP Address`); }); // query subdomains @@ -844,35 +852,38 @@ function get_port_details(port, scan_id){ $('#modal-subdomain-count').html(`${data['subdomains'].length} `); for (subdomain in data['subdomains']){ subdomain_obj = data['subdomains'][subdomain]; - + badge_color = subdomain_obj['http_status'] == 404 ? 'danger' : ''; if (subdomain_obj['http_url']) { - $("#modal-subdomain-text").append(`${subdomain_obj['name']}`) + $("#modal-subdomain-text").append(`${subdomain_obj['name']}`) } else { - $("#modal-subdomain-text").append(`${subdomain_obj['name']}`) + $("#modal-subdomain-text").append(`${subdomain_obj['name']}`); } } + $('#modal-text-subdomain').append(`*Subdomains highlighted are 404 HTTP Status`); }); } function get_tech_details(tech, scan_id){ // render tab modal - $('.modal-title').html('Details for Technology: ' + tech); + $('.modal-title').html('Details for Technology: ' + tech + ''); $('#exampleModal').modal('show'); $('.modal-text').empty(); // query subdomains $.getJSON(`../api/querySubdomains/?scan_id=${scan_id}&tech=${tech}&format=json`, function(data) { - $('.modal-text').append(`${data['subdomains'].length} Subdomains using ${tech}`); - $('.modal-text').append(``); + $('#modal-text-content').append(`${data['subdomains'].length} Subdomains using ${tech}`); + $('#modal-text-content').append(``); for (subdomain in data['subdomains']){ subdomain_obj = data['subdomains'][subdomain]; + badge_color = subdomain_obj['http_status'] == 404 ? 'danger' : ''; if (subdomain_obj['http_url']) { - $("#subdomain-ul").append(`${subdomain_obj['name']}`) + $("#subdomain-modal-ul").append(`${subdomain_obj['name']}`); } else { - $("#subdomain-ul").append(`${subdomain_obj['name']}`) + $("#subdomain-modal-ul").append(`${subdomain_obj['name']}`); } } + $('#modal-text-content').append(`*Subdomains highlighted are 404 HTTP Status`); }); } diff --git a/templates/base/_items/modal.html b/templates/base/_items/modal.html index fe0ca05a..3519c895 100644 --- a/templates/base/_items/modal.html +++ b/templates/base/_items/modal.html @@ -1,14 +1,14 @@ - + - + - + diff --git a/templates/base/_items/tab_modal.html b/templates/base/_items/tab_modal.html index 8725cd65..b329e0c2 100644 --- a/templates/base/_items/tab_modal.html +++ b/templates/base/_items/tab_modal.html @@ -2,7 +2,7 @@ - + ×