diff --git a/web/startScan/static/startScan/js/detail_scan.js b/web/startScan/static/startScan/js/detail_scan.js index ffeebdb1..7afe40f4 100644 --- a/web/startScan/static/startScan/js/detail_scan.js +++ b/web/startScan/static/startScan/js/detail_scan.js @@ -1221,7 +1221,11 @@ function add_task_for_subdomain_handler(subdomain_id){ } function download_subdomains(scan_id, domain_name){ - count = `Loading... `; + Swal.fire({ + title: 'Querying Subdomains...' + }); + swal.showLoading(); + count = ``; if (scan_id) { url = `/api/querySubdomains?format=json&no_lookup_interesting&scan_id=${scan_id}`; } @@ -1229,17 +1233,17 @@ function download_subdomains(scan_id, domain_name){ url = `/api/querySubdomains?format=json&no_lookup_interesting`; } if (domain_name) { - $('.modal-title').html(count + 'Subdomains for : ' + domain_name + ''); + $('.modal-title').html(count + ' Subdomains for : ' + domain_name + ''); } else{ $('.modal-title').html(count + ' Subdomains'); } - $('#modal_dialog').modal('show'); $('.modal-text').empty(); $('#modal-footer').empty(); - $('.modal-text').append(``); + $('.modal-text').append(``); // query subdomains $.getJSON(url, function(data) { - $('#modal-loader').empty(); + swal.close(); + $('#modal_dialog').modal('show'); $('.modal_count').html(data['subdomains'].length); $('#modal-content').empty(); subdomains = ''; @@ -1250,15 +1254,18 @@ function download_subdomains(scan_id, domain_name){ } $('#all_subdomains_text_area').append(subdomains); $("#modal-footer").empty(); - $("#modal-footer").append(`Download Subdomains as txt`); - $("#modal-footer").append(`Copy Subdomains`); + $("#modal-footer").append(` Download Subdomains as txt`); + $("#modal-footer").append(` Copy Subdomains`); }).fail(function(){ - $('#modal-loader').empty(); }); } function download_interesting_subdomains(scan_id, domain_name){ - count = `Loading... `; + Swal.fire({ + title: 'Querying Interesting Subdomains...' + }); + swal.showLoading(); + count = ``; if (scan_id) { url = `/api/listInterestingSubdomains/?scan_id=${scan_id}&format=json&only_subdomains&no_page`; } @@ -1272,11 +1279,10 @@ function download_interesting_subdomains(scan_id, domain_name){ $('.modal-title').html( count + ' Interesting Subdomains'); } $('.modal-text').empty(); $('#modal-footer').empty(); - $('#modal_dialog').modal('show'); - $('.modal-text').append(``); // query subdomains $.getJSON(url, function(data) { - $('#modal-loader').empty(); + swal.close() + $('#modal_dialog').modal('show'); $('.modal_count').html(data.length); $('#modal-content').empty(); subdomains = ''; @@ -1286,17 +1292,59 @@ function download_interesting_subdomains(scan_id, domain_name){ } $('#interesting_subdomains_text_area').append(subdomains); $("#modal-footer").empty(); - $("#modal-footer").append(`Download Subdomains as txt`); - $("#modal-footer").append(`Copy Subdomains`); + $("#modal-footer").append(` Download Subdomains as txt`); + $("#modal-footer").append(` Copy Subdomains`); + + }).fail(function(){ + }); +} + +function download_interesting_endpoints(scan_id, domain_name){ + Swal.fire({ + title: 'Querying Interesting Endpoints...' + }); + swal.showLoading(); + count = ``; + if (scan_id) { + url = `/api/listInterestingEndpoints/?scan_id=${scan_id}&format=json&no_page`; + } + else{ + url = `/api/listInterestingEndpoints/?format=json&no_page`; + } + if (domain_name) { + $('.modal-title').html( count + ' Interesting Endpoints for : ' + domain_name + ''); + } + else{ + $('.modal-title').html( count + ' Interesting Endpoints'); + } + $('.modal-text').empty(); $('#modal-footer').empty(); + // query subdomains + $.getJSON(url, function(data) { + swal.close(); + $('#modal_dialog').modal('show'); + $('.modal_count').html(data.length); + $('#modal-content').empty(); + endpoints = ''; + $('#modal-content').append(``); + for (endpoint in data){ + endpoints += data[endpoint]['http_url'] + '\n' + } + $('#interesting_endpoints_text_area').append(endpoints); + $("#modal-footer").empty(); + $("#modal-footer").append(` Download Endpoints as txt`); + $("#modal-footer").append(` Copy Endpoints`); }).fail(function(){ - $('#modal-loader').empty(); }); } function download_important_subdomains(scan_id, domain_name){ - count = `Loading... `; + Swal.fire({ + title: 'Querying Interesting Subdomains...' + }); + swal.showLoading(); + count = ``; if (scan_id) { url = `/api/querySubdomains?format=json&no_lookup_interesting&only_important&scan_id=${scan_id}`; } @@ -1309,12 +1357,11 @@ function download_important_subdomains(scan_id, domain_name){ else{ $('.modal-title').html(count + ' Subdomains marked as important'); } - $('#modal_dialog').modal('show'); $('.modal-text').empty(); $('#modal-footer').empty(); - $('.modal-text').append(``); // query subdomains $.getJSON(url, function(data) { - $('#modal-loader').empty(); + swal.close(); + $('#modal_dialog').modal('show'); $('.modal_count').html(data['subdomains'].length); $('#modal-content').empty(); subdomains = ''; @@ -1325,14 +1372,18 @@ function download_important_subdomains(scan_id, domain_name){ } $('#all_subdomains_text_area').append(subdomains); $("#modal-footer").empty(); - $("#modal-footer").append(`Download Subdomains as txt`); - $("#modal-footer").append(`Copy Subdomains`); + $("#modal-footer").append(` Download Subdomains as txt`); + $("#modal-footer").append(` Copy Subdomains`); }).fail(function(){ $('#modal-loader').empty(); }); } function download_endpoints(scan_id, domain_name, pattern){ + Swal.fire({ + title: 'Querying Endpoints...' + }); + swal.showLoading(); count = `Loading... `; if (scan_id) { url = `/api/queryEndpoints/?format=json&only_urls&scan_id=${scan_id}`; @@ -1350,11 +1401,10 @@ function download_endpoints(scan_id, domain_name, pattern){ $('.modal-title').html(count + ' Endpoints'); } $('.modal-text').empty(); $('#modal-footer').empty(); - $('#modal_dialog').modal('show'); - $('.modal-text').append(``); // query subdomains $.getJSON(url, function(data) { - $('#modal-loader').empty(); + swal.close(); + $('#modal_dialog').modal('show'); $('.modal_count').html(data['endpoints'].length); $('#modal-content').empty(); endpoints = ''; @@ -1366,14 +1416,13 @@ function download_endpoints(scan_id, domain_name, pattern){ $('#all_endpoints_text_area').append(endpoints); $("#modal-footer").empty(); if (domain_name) { - $("#modal-footer").append(`Download Endpoints as txt`); + $("#modal-footer").append(` Download Endpoints as txt`); } else{ - $("#modal-footer").append(`Download Endpoints as txt`); + $("#modal-footer").append(` Download Endpoints as txt`); } - $("#modal-footer").append(`Copy Endpoints`); + $("#modal-footer").append(` Copy Endpoints`); }).fail(function(){ - $('#modal-loader').empty(); }); } diff --git a/web/startScan/templates/startScan/detail_scan.html b/web/startScan/templates/startScan/detail_scan.html index 449aec28..0a01baf1 100644 --- a/web/startScan/templates/startScan/detail_scan.html +++ b/web/startScan/templates/startScan/detail_scan.html @@ -131,6 +131,7 @@ Detailed Scan Download All Endpoints Download Important Subdomains Download Interesting Subdomains + Download Interesting Endpoints