mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-09-07 02:17:42 +02:00
List Subdomain api modified for no interesting models
This commit is contained in:
@@ -7,6 +7,19 @@ from scanEngine.models import *
|
||||
from django.db.models import F, JSONField, Value
|
||||
|
||||
|
||||
class OnlySubdomainNameSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = Subdomain
|
||||
fields = ['name', 'id']
|
||||
|
||||
|
||||
class ScanHistorySerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = ScanHistory
|
||||
fields = '__all__'
|
||||
depth = 1
|
||||
|
||||
|
||||
class OrganizationSerializer(serializers.ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
|
||||
+3
-2
@@ -6,9 +6,9 @@ from .views import *
|
||||
app_name = 'api'
|
||||
router = routers.DefaultRouter()
|
||||
|
||||
router.register(r'scanHistory', SubdomainViewset)
|
||||
router.register(r'listDatatableSubdomain', SubdomainDatatableViewSet)
|
||||
|
||||
router.register(r'listSubdomains', ListSubdomainsViewSet)
|
||||
router.register(r'listSubdomains', SubdomainsViewSet)
|
||||
|
||||
router.register(r'listEndpoints', EndPointViewSet)
|
||||
|
||||
@@ -44,6 +44,7 @@ urlpatterns = [
|
||||
path('queryTargetsInOrganization/', ListTargetsInOrganization.as_view(), name='queryTargetsInOrganization'),
|
||||
path('listOrganizations/', ListOrganizations.as_view(), name='listOrganizations'),
|
||||
path('listEngines/', ListEngines.as_view(), name='listEngines'),
|
||||
path('listScanHistory/', ListScanHistory.as_view(), name='listScanHistory'),
|
||||
]
|
||||
|
||||
urlpatterns += router.urls
|
||||
|
||||
+26
-20
@@ -17,6 +17,14 @@ from startScan.models import *
|
||||
from targetApp.models import *
|
||||
|
||||
|
||||
class ListScanHistory(APIView):
|
||||
def get(self, request, format=None):
|
||||
req = self.request
|
||||
scan_history = ScanHistory.objects.all().order_by('-start_scan_date')
|
||||
scan_history = ScanHistorySerializer(scan_history, many=True)
|
||||
return Response({'scan_histories': scan_history.data})
|
||||
|
||||
|
||||
class ListEngines(APIView):
|
||||
def get(self, request, format=None):
|
||||
req = self.request
|
||||
@@ -207,27 +215,25 @@ class ListSubdomains(APIView):
|
||||
ip_address = req.query_params.get('ip_address')
|
||||
port = req.query_params.get('port')
|
||||
tech = req.query_params.get('tech')
|
||||
if scan_id and ip_address:
|
||||
subdomain = Subdomain.objects.filter(
|
||||
ip_addresses__address=ip_address).filter(
|
||||
scan_history__id=scan_id)
|
||||
serializer = SubdomainSerializer(subdomain, many=True)
|
||||
return Response({"subdomains": serializer.data})
|
||||
elif scan_id and tech:
|
||||
subdomain = Subdomain.objects.filter(
|
||||
technologies__name=tech).filter(
|
||||
scan_history__id=scan_id)
|
||||
serializer = SubdomainSerializer(subdomain, many=True)
|
||||
return Response({"subdomains": serializer.data})
|
||||
elif scan_id and port:
|
||||
subdomain = Subdomain.objects.filter(
|
||||
subdomain_query = Subdomain.objects.filter(scan_history__id=scan_id)
|
||||
|
||||
if ip_address:
|
||||
subdomain_query = subdomain_query.filter(ip_addresses__address=ip_address)
|
||||
|
||||
if tech:
|
||||
subdomain_query = subdomain_query.filter(technologies__name=tech)
|
||||
|
||||
if port:
|
||||
subdomain_query = subdomain_query.filter(
|
||||
ip_addresses__in=IpAddress.objects.filter(
|
||||
ports__in=Port.objects.filter(
|
||||
number=port))).filter(
|
||||
scan_history=scan_id)
|
||||
serializer = SubdomainSerializer(subdomain, many=True)
|
||||
return Response({"subdomains": serializer.data})
|
||||
number=port)))
|
||||
|
||||
if 'no_lookup_interesting' in req.query_params:
|
||||
serializer = OnlySubdomainNameSerializer(subdomain_query, many=True)
|
||||
else:
|
||||
serializer = SubdomainSerializer(subdomain_query, many=True)
|
||||
return Response({"subdomains": serializer.data})
|
||||
|
||||
class ListOsintUsers(APIView):
|
||||
def get(self, request, format=None):
|
||||
@@ -299,7 +305,7 @@ class IpAddressViewSet(viewsets.ModelViewSet):
|
||||
queryset, self.request, view=self)
|
||||
|
||||
|
||||
class ListSubdomainsViewSet(viewsets.ModelViewSet):
|
||||
class SubdomainsViewSet(viewsets.ModelViewSet):
|
||||
queryset = Subdomain.objects.none()
|
||||
serializer_class = SubdomainSerializer
|
||||
|
||||
@@ -500,7 +506,7 @@ class InterestingEndpointViewSet(viewsets.ModelViewSet):
|
||||
queryset, self.request, view=self)
|
||||
|
||||
|
||||
class SubdomainViewset(viewsets.ModelViewSet):
|
||||
class SubdomainDatatableViewSet(viewsets.ModelViewSet):
|
||||
queryset = Subdomain.objects.none()
|
||||
serializer_class = SubdomainSerializer
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ INSTALLED_APPS = [
|
||||
'targetApp.apps.TargetappConfig',
|
||||
'scanEngine.apps.ScanengineConfig',
|
||||
'startScan.apps.StartscanConfig',
|
||||
'recon_note.apps.ReconNoteConfig',
|
||||
'django_ace',
|
||||
'django_celery_beat',
|
||||
'mathfilters',
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
from django.contrib import admin
|
||||
from recon_note.models import *
|
||||
|
||||
admin.site.register(TodoNote)
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ReconNoteConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'recon_note'
|
||||
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 3.2.4 on 2021-07-22 06:09
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('startScan', '0058_delete_todonote'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='TodoNote',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False)),
|
||||
('title', models.CharField(blank=True, max_length=1000, null=True)),
|
||||
('description', models.TextField(blank=True, null=True)),
|
||||
('scan_history', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='startScan.scanhistory')),
|
||||
('subdomain', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='startScan.subdomain')),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 3.2.4 on 2021-07-22 06:11
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('recon_note', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='todonote',
|
||||
name='is_done',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='todonote',
|
||||
name='is_important',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,21 @@
|
||||
from django.db import models
|
||||
from startScan.models import *
|
||||
|
||||
class TodoNote(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
title = models.CharField(max_length=1000, null=True, blank=True)
|
||||
description = models.TextField(null=True, blank=True)
|
||||
scan_history = models.ForeignKey(
|
||||
ScanHistory,
|
||||
on_delete=models.CASCADE,
|
||||
null=True,
|
||||
blank=True
|
||||
)
|
||||
subdomain = models.ForeignKey(
|
||||
Subdomain,
|
||||
on_delete=models.CASCADE,
|
||||
null=True,
|
||||
blank=True
|
||||
)
|
||||
is_done = models.BooleanField(default=False)
|
||||
is_important = models.BooleanField(default=False)
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
@@ -1,6 +1,5 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class EngineType(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
engine_name = models.CharField(max_length=200)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# Generated by Django 3.2.4 on 2021-07-22 05:59
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('startScan', '0056_email_password'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='TodoNote',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False)),
|
||||
('title', models.CharField(blank=True, max_length=1000, null=True)),
|
||||
('description', models.TextField(blank=True, null=True)),
|
||||
('scan_history', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='startScan.scanhistory')),
|
||||
('subdomain', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='startScan.subdomain')),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,16 @@
|
||||
# Generated by Django 3.2.4 on 2021-07-22 06:04
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('startScan', '0057_todonote'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.DeleteModel(
|
||||
name='TodoNote',
|
||||
),
|
||||
]
|
||||
@@ -879,7 +879,7 @@ Detailed Scan Results for {{history.domain.name}}
|
||||
"lengthMenu": [20, 50, 100, 500, 1000],
|
||||
"pageLength": 20,
|
||||
'serverSide': true,
|
||||
"ajax": '/api/scanHistory/?scan_id={{scan_history_id}}&format=datatables',
|
||||
"ajax": '/api/listDatatableSubdomain/?scan_id={{scan_history_id}}&format=datatables',
|
||||
"order": [[ 8, "desc" ]],
|
||||
"columns": [
|
||||
{'data': 'id'},
|
||||
|
||||
@@ -107,6 +107,9 @@ $('#addTask').on('click', function(event) {
|
||||
const ps = new PerfectScrollbar('.todo-box-scroll', {
|
||||
suppressScrollX : true
|
||||
});
|
||||
|
||||
populateScanHistory();
|
||||
|
||||
});
|
||||
const ps = new PerfectScrollbar('.todo-box-scroll', {
|
||||
suppressScrollX : true
|
||||
@@ -143,55 +146,18 @@ function importantDropdown() {
|
||||
});
|
||||
}
|
||||
|
||||
function priorityDropdown() {
|
||||
$('.priority-dropdown .dropdown-menu .dropdown-item').on('click', function(event) {
|
||||
|
||||
var getClass = $(this).attr('class').split(' ')[1];
|
||||
var getDropdownClass = $(this).parents('.p-dropdown').children('.dropdown-toggle').attr('class').split(' ')[1];
|
||||
$(this).parents('.p-dropdown').children('.dropdown-toggle').removeClass(getDropdownClass);
|
||||
|
||||
$(this).parents('.p-dropdown').children('.dropdown-toggle').addClass(getClass);
|
||||
})
|
||||
}
|
||||
|
||||
function editDropdown() {
|
||||
$('.action-dropdown .dropdown-menu .edit.dropdown-item').click(function() {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var $_outerThis = $(this);
|
||||
|
||||
$('.add-tsk').hide();
|
||||
$('.edit-tsk').show();
|
||||
|
||||
var $_taskTitle = $_outerThis.parents('.todo-item').children().find('.todo-heading').text();
|
||||
var $_taskText = $_outerThis.parents('.todo-item').children().find('.todo-text').text();
|
||||
|
||||
$('#task').val($_taskTitle);
|
||||
$('#taskdescription').val($_taskText);
|
||||
|
||||
$('.edit-tsk').off('click').on('click', function(event) {
|
||||
var $_innerThis = $(this);
|
||||
var $_task = document.getElementById('task').value;
|
||||
var $_taskDescription = document.getElementById('taskdescription').value;
|
||||
var $_taskDescriptionText = document.getElementById('taskdescription').value;
|
||||
var $_taskEditedTitle = $_outerThis.parents('.todo-item').children().find('.todo-heading').html($_task);
|
||||
var $_taskEditedText = $_outerThis.parents('.todo-item').children().find('.todo-text').html($_taskDescriptionText);
|
||||
$('#addTaskModal').modal('hide');
|
||||
})
|
||||
$('#addTaskModal').modal('show');
|
||||
})
|
||||
}
|
||||
|
||||
function todoItem() {
|
||||
$('.todo-item .todo-content').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $_taskTitle = $(this).find('.todo-heading').text();
|
||||
|
||||
var $_taskTarget = $(this).find('.target').text();
|
||||
|
||||
var $todoDescription = $(this).find('.todo-text').text();
|
||||
|
||||
$('.task-heading').text($_taskTitle);
|
||||
$('.task-text').html($todoDescription);
|
||||
$('.task-text').html(`<span class="text-success">${$_taskTarget}</span><br>` + $todoDescription);
|
||||
|
||||
$('#todoShowListItem').modal('show');
|
||||
});
|
||||
@@ -210,8 +176,6 @@ var $btns = $('.list-actions').click(function() {
|
||||
|
||||
checkCheckbox();
|
||||
importantDropdown();
|
||||
priorityDropdown();
|
||||
editDropdown();
|
||||
todoItem();
|
||||
|
||||
$(".add-tsk").click(function(){
|
||||
@@ -220,6 +184,20 @@ $(".add-tsk").click(function(){
|
||||
|
||||
var $_taskDescriptionText = document.getElementById('taskdescription').value;
|
||||
|
||||
var $_taskScanHistory = $("#scanHistoryIDropdown option:selected").text();
|
||||
|
||||
var $_taskSubdomain = $("#subdomainDropdown option:selected").text();
|
||||
|
||||
var $_targetText = '';
|
||||
|
||||
if ($_taskScanHistory != 'Choose Scan History...') {
|
||||
$_targetText = $_taskScanHistory;
|
||||
}
|
||||
|
||||
if ($_taskSubdomain != 'Choose Subdomain...') {
|
||||
$_targetText += ' Subdomain : ' + $_taskSubdomain;
|
||||
}
|
||||
|
||||
$html = '<div class="todo-item all-list">'+
|
||||
'<div class="todo-item-inner">'+
|
||||
'<div class="n-chk text-center">'+
|
||||
@@ -231,6 +209,7 @@ $(".add-tsk").click(function(){
|
||||
|
||||
'<div class="todo-content">'+
|
||||
'<h5 class="todo-heading">'+$_task+'</h5>'+
|
||||
'<p class="target">'+$_targetText+'</h5>'+
|
||||
"<p class='todo-text' >"+$_taskDescriptionText+"</p>"+
|
||||
'</div>'+
|
||||
|
||||
@@ -257,8 +236,6 @@ $(".add-tsk").click(function(){
|
||||
$("#ct").prepend($html);
|
||||
$('#addTaskModal').modal('hide');
|
||||
checkCheckbox();
|
||||
editDropdown();
|
||||
priorityDropdown();
|
||||
todoItem();
|
||||
importantDropdown();
|
||||
new dynamicBadgeNotification('allList');
|
||||
@@ -269,3 +246,17 @@ $('.tab-title .nav-pills a.nav-link').on('click', function(event) {
|
||||
$(this).parents('.mail-box-container').find('.tab-title').removeClass('mail-menu-show')
|
||||
$(this).parents('.mail-box-container').find('.mail-overlay').removeClass('mail-overlay-show')
|
||||
})
|
||||
|
||||
|
||||
function populateScanHistory() {
|
||||
scan_history_select = document.getElementById('scanHistoryIDropdown');
|
||||
$.getJSON(`/api/listScanHistory?format=json`, function(data) {
|
||||
for (var history in data['scan_histories']){
|
||||
history_object = data['scan_histories'][history];
|
||||
var option = document.createElement('option');
|
||||
option.value = history_object['id'];
|
||||
option.innerHTML = history_object['domain']['name'] + ' - Scanned ' + moment.utc(history_object['start_scan_date']).fromNow();
|
||||
scan_history_select.appendChild(option);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ Recon Todo
|
||||
{% block custom_js_css_link %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'assets/css/forms/theme-checkbox-radio.css' %}">
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'assets/css/apps/todolist.css' %}">
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'plugins/select2/select2.min.css' %}">
|
||||
{% endblock custom_js_css_link %}
|
||||
|
||||
{% block breadcrumb_title %}
|
||||
@@ -69,7 +70,7 @@ Recon Todo
|
||||
|
||||
<div class="todo-content">
|
||||
<h5 class="todo-heading">Perform Directory Bruteforce</h5>
|
||||
<p class="target">Target: example.com</p>
|
||||
<p class="target">Domain: example.com, Scanned 2 hours ago, Subdomain: hello.ns.hackerone.com</p>
|
||||
<p class="todo-text">Need to identify documentation page, use xyz wordlist and start dir bruteforce.</p>
|
||||
</div>
|
||||
|
||||
@@ -80,7 +81,6 @@ Recon Todo
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink-13">
|
||||
<a class="edit dropdown-item" href="javascript:void(0);">Edit</a>
|
||||
<a class="important dropdown-item" href="javascript:void(0);">Mark Important</a>
|
||||
<a class="dropdown-item delete" href="javascript:void(0);">Delete</a>
|
||||
</div>
|
||||
@@ -108,7 +108,7 @@ Recon Todo
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="addTaskModal" tabindex="-1" role="dialog" aria-labelledby="addTaskModalTitle" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="compose-box">
|
||||
@@ -131,11 +131,25 @@ Recon Todo
|
||||
<div class="d-flex mail-to mb-4">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-crosshair"><circle cx="12" cy="12" r="10"></circle><line x1="22" y1="12" x2="18" y2="12"></line><line x1="6" y1="12" x2="2" y2="12"></line><line x1="12" y1="6" x2="12" y2="2"></line><line x1="12" y1="22" x2="12" y2="18"></line></svg>
|
||||
<div class="w-100">
|
||||
Select Scan History
|
||||
<select class="form-control basic" id="scanHistoryId">
|
||||
{% for history in scan_history %}
|
||||
<option value="{{history.0}}">{{history.2}} - {{history.1|naturaltime}}</option>
|
||||
{% endfor %}
|
||||
Select Scan History (Optional)
|
||||
<select class="placeholder js-states form-control" id="scanHistoryIDropdown">
|
||||
<option>Choose Scan History...</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="d-flex mail-to mb-4">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-crosshair"><circle cx="12" cy="12" r="10"></circle><line x1="22" y1="12" x2="18" y2="12"></line><line x1="6" y1="12" x2="2" y2="12"></line><line x1="12" y1="6" x2="12" y2="2"></line><line x1="12" y1="22" x2="12" y2="18"></line></svg>
|
||||
<div class="w-100">
|
||||
Select Subdomain (Optional)
|
||||
<br>
|
||||
<span id="selectedSubdomainCount"></span>
|
||||
<select class="placeholder js-states form-control" id="subdomainDropdown">
|
||||
<option>Choose Subdomain...</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -145,7 +159,7 @@ Recon Todo
|
||||
<div class="d-flex mail-subject mb-4">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text flaticon-menu-list"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
||||
<div class="w-100">
|
||||
<textarea class="form-control" id="taskdescription" rows="5" spellcheck="false" placeholder="Task Description"></textarea>
|
||||
<textarea class="form-control" id="taskdescription" rows="5" spellcheck="false" placeholder="Recon Todo/Note"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -166,4 +180,31 @@ Recon Todo
|
||||
{% block page_level_script %}
|
||||
<script src="{% static 'assets/js/scrollspyNav.js' %}"></script>
|
||||
<script src="{% static 'targetApp/js/todo.js' %}"></script>
|
||||
<script src="{% static 'plugins/select2/select2.min.js' %}"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js" integrity="sha512-qTXRIMyZIFb8iQcfjXWCO8+M5Tbc38Qi5WzdPOYZHIlZpzBHG3L3by84BBBOiRGiEb7KKtAOAs5qYdUiZiQNNQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script type="text/javascript">
|
||||
$('#scanHistoryIDropdown').select2({
|
||||
dropdownParent: $('#addTaskModal')
|
||||
});
|
||||
|
||||
$('#subdomainDropdown').select2({
|
||||
dropdownParent: $('#addTaskModal')
|
||||
});
|
||||
|
||||
$('#scanHistoryIDropdown').on('change', function() {
|
||||
$('#subdomainDropdown').find('option:not(:first)').remove();
|
||||
subdomain_dropdown = document.getElementById('subdomainDropdown');
|
||||
$.getJSON(`/api/querySubdomains?scan_id=${this.value}&no_lookup_interesting&format=json`, function(data) {
|
||||
document.querySelector("#selectedSubdomainCount").innerHTML = data['subdomains'].length + ' Subdomains in selected history for domain ' + $("#scanHistoryIDropdown option:selected").text().split('-')[0];
|
||||
for (var subdomain in data['subdomains']){
|
||||
subdomain_obj = data['subdomains'][subdomain];
|
||||
var option = document.createElement('option');
|
||||
option.value = subdomain_obj['id'];
|
||||
option.innerHTML = subdomain_obj['name'];
|
||||
subdomain_dropdown.appendChild(option);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock page_level_script %}
|
||||
|
||||
Reference in New Issue
Block a user