Skip to content

Commit

Permalink
Merge pull request #1070 from psyray/fix-endpoints-popup-empty
Browse files Browse the repository at this point in the history
Endpoints list popup empty
  • Loading branch information
AnonymousWP authored Nov 23, 2023
2 parents 295ca97 + 8342d23 commit 10afeeb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions web/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,9 @@ def get_queryset(self):
if gf_tag:
endpoints = endpoints.filter(matched_gf_patterns__icontains=gf_tag)

if target_id:
endpoints = endpoints.filter(target_domain__id=target_id)

if subdomain_id:
endpoints = endpoints.filter(subdomain__id=subdomain_id)

Expand Down
6 changes: 3 additions & 3 deletions web/startScan/static/startScan/js/detail_scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -933,18 +933,18 @@ function get_vulnerability_modal(scan_id=null, severity=null, subdomain_id=null,
}


function get_endpoint_modal(scan_id, subdomain_id, subdomain_name){
function get_endpoint_modal(project, scan_id, subdomain_id, subdomain_name){
// This function will display a xl modal with datatable for displaying endpoints
// associated with the subdomain
$('#xl-modal-title').empty();
$('#xl-modal-content').empty();
$('#xl-modal-footer').empty();

if (scan_id) {
url = `/api/listEndpoints/?scan_id=${scan_id}&subdomain_id=${subdomain_id}&format=json`
url = `/api/listEndpoints/?project=${project}&scan_id=${scan_id}&subdomain_id=${subdomain_id}&format=json`
}
else{
url = `/api/listEndpoints/?subdomain_id=${subdomain_id}&format=json`
url = `/api/listEndpoints/?project=${project}&subdomain_id=${subdomain_id}&format=json`
}

Swal.fire({
Expand Down
2 changes: 1 addition & 1 deletion web/startScan/templates/startScan/detail_scan.html
Original file line number Diff line number Diff line change
Expand Up @@ -2214,7 +2214,7 @@ <h4 class="header-title mb-0"><span id="endpoint_change_count"><span class="spin

endpoint_count_badge = '';
if (row['endpoint_count']) {
endpoint_count_badge = `<span class="pl-2 pr-2 me-1 badge badge-soft-primary badge-link bs-tooltip" title="Endpoints" onclick="get_endpoint_modal({{history.id}}, ${row['id']}, '${row['name']}')">${row['endpoint_count']} <i class=" fas fa-link"></i></span>`;
endpoint_count_badge = `<span class="pl-2 pr-2 me-1 badge badge-soft-primary badge-link bs-tooltip" title="Endpoints" onclick="get_endpoint_modal('{{current_project.slug}}', {{history.id}}, ${row['id']}, '${row['name']}')">${row['endpoint_count']} <i class=" fas fa-link"></i></span>`;
}

if(row['waf'].length){
Expand Down
2 changes: 1 addition & 1 deletion web/startScan/templates/startScan/subdomains.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

endpoint_count_badge = '';
if (row['endpoint_count']) {
endpoint_count_badge = `<span class="pl-2 pr-2 me-1 badge badge-soft-primary badge-link bs-tooltip" title="Endpoints" onclick="get_endpoint_modal(scan_id=null, subdomain_id=${row['id']}, '${row['name']}')">${row['endpoint_count']} <i class=" fas fa-link"></i></span>`;
endpoint_count_badge = `<span class="pl-2 pr-2 me-1 badge badge-soft-primary badge-link bs-tooltip" title="Endpoints" onclick="get_endpoint_modal(project='{{current_project.slug}}', scan_id=null, subdomain_id=${row['id']}, '${row['name']}')">${row['endpoint_count']} <i class=" fas fa-link"></i></span>`;
}

if(row['waf'].length){
Expand Down
2 changes: 1 addition & 1 deletion web/targetApp/templates/target/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ <h4 class="header-title mb-0"><span id="technologies-count"><span class="spinner

endpoint_count_badge = '';
if (row['endpoint_count']) {
endpoint_count_badge = `<span class="pl-2 pr-2 me-1 badge badge-soft-primary badge-link bs-tooltip" title="Endpoints" onclick="get_endpoint_modal(null, ${row['id']}, '${row['name']}')">${row['endpoint_count']} <i class=" fas fa-link"></i></span>`;
endpoint_count_badge = `<span class="pl-2 pr-2 me-1 badge badge-soft-primary badge-link bs-tooltip" title="Endpoints" onclick="get_endpoint_modal('{{current_project.slug}}', null, ${row['id']}, '${row['name']}')">${row['endpoint_count']} <i class=" fas fa-link"></i></span>`;
}

if(row['waf'].length){
Expand Down

0 comments on commit 10afeeb

Please sign in to comment.