mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-09-18 15:57:44 +02:00
145 lines
6.3 KiB
HTML
145 lines
6.3 KiB
HTML
{% extends 'base/base.html' %}
|
|
{% load static %}
|
|
|
|
{% block title %}
|
|
Add targets
|
|
{% endblock title %}
|
|
|
|
|
|
{% block custom_js_css_link %}
|
|
{% endblock custom_js_css_link %}
|
|
|
|
{% block breadcrumb_title %}
|
|
<li class="breadcrumb-item"><a href="{% url 'list_target' %}">Targets</a></li>
|
|
<li class="breadcrumb-item active">Add Target</li>
|
|
{% endblock breadcrumb_title %}
|
|
|
|
{% block page_title %}
|
|
Add or Import Targets
|
|
{% endblock page_title %}
|
|
|
|
{% block main_content %}
|
|
<div class="row">
|
|
<div class="col-xl-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<ul class="nav nav-tabs nav-bordered">
|
|
<li class="nav-item">
|
|
<a href="#add-multiple-tab" data-bs-toggle="tab" id="main-tab" aria-expanded="false" class="nav-link active">
|
|
Add targets
|
|
</a>
|
|
</li>
|
|
<li class="nav-item dropdown">
|
|
<a class="nav-link dropdown-toggle arrow-none" href="#" id="import-dropdown" role="button"
|
|
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
Import
|
|
<div class="arrow-down"></div>
|
|
</a>
|
|
<div class="dropdown-menu" aria-labelledby="import-dropdown">
|
|
<a class="dropdown-item" href="#import-text-tab" data-bs-toggle="tab" aria-expanded="false" class="nav-link">Import from Text File</a>
|
|
<a class="dropdown-item" href="#import-csv-tab" data-bs-toggle="tab" aria-expanded="false" class="nav-link">Import from CSV</a>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<div class="tab-content" id="pills-tabContent">
|
|
<div class="tab-pane fade show active" id="add-multiple-tab" role="tabpanel" aria-labelledby="add-multiple-tab">
|
|
<form method="post">
|
|
{% csrf_token %}
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<label for="importSubdomainFormControlTextarea">You can add one or more targets (IPs, URLs, domains). If you are adding multiple targets, separate them using a new line.</label>
|
|
<textarea class="form-control" id="addTargets" rows="8" spellcheck="false" name="addTargets" placeholder="example.com"></textarea>
|
|
</div>
|
|
<div class="col-12 mt-3">
|
|
<label for="targetDescription">Target Description (Optional)</label>
|
|
<input type="text" class="form-control form-control-lg" id="targetDescription" placeholder="Interesting Target" name="targetDescription">
|
|
</div>
|
|
<div class="col-12 mt-3">
|
|
<label for="domainDescription" class="form-label">HackerOne Target Team Handle
|
|
<br>
|
|
This is used to send vulnerability reports to the HackerOne Program automatically. Team handle can be found from the program URL, <a href="https://hackerone.com/team_handle">https://hackerone.com/team_handle</a>
|
|
</label>
|
|
<input type="text" class="form-control form-control-lg" id="targetH1TeamHandle" placeholder="team_handle" name="targetH1TeamHandle">
|
|
</div>
|
|
</div>
|
|
<button class="btn btn-primary submit-fn mt-2 float-end" type="submit" id="add-multiple-targets" name="add-multiple-targets" value="submit">Add 0 Target</button>
|
|
</form>
|
|
</div>
|
|
<div class="tab-pane fade" id="import-text-tab" role="tabpanel" aria-labelledby="import-text-tab">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="alert alert-primary border-0 mb-4" role="alert">
|
|
Your txt file must have list of domains separated by a new line.
|
|
<br><br>
|
|
By default all domains imported from txt will have no description. If you choose to import multiple domains with description, csv import is recommended.
|
|
</div>
|
|
<form method="post" enctype="multipart/form-data">
|
|
<div class="mb-3">
|
|
{% csrf_token %}
|
|
<input type="file" class="form-control" id="txtFile" required accept=".txt" name="txtFile" onchange="showname(this, '#selectedTextFileName')">
|
|
<h6 id="selectedTextFileName" class="text-primary"></h6>
|
|
</div>
|
|
<input type="submit" class="btn btn-primary float-right mt-5 mb-2" value="Upload" name="import-txt-target">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tab-pane fade" id="import-csv-tab" role="tabpanel" aria-labelledby="import-csv-tab">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="alert alert-warning border-0 mb-4" role="alert">
|
|
Your csv file must be in the format of <strong>domain, description</strong> separated by a new line.
|
|
</div>
|
|
<form method="post" enctype="multipart/form-data">
|
|
<div class="mb-3">
|
|
{% csrf_token %}
|
|
<input type="file" class="form-control" id="csvFile" required accept=".csv" name="csvFile" onchange="showname(this, '#selectedCsvFileName')">
|
|
<h6 id="selectedCsvFileName" class="text-primary"></h6>
|
|
</div>
|
|
<input type="submit" class="btn btn-primary float-right mt-5 mb-2" value="Upload" name="import-csv-target">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock main_content %}
|
|
|
|
|
|
{% block page_level_script %}
|
|
<script src="{% static 'custom/custom.js' %}"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
var add_multiple_targets_btn = document.getElementById("add-multiple-targets");
|
|
add_multiple_targets_btn.disabled = true;
|
|
$('#addTargets').on('change keyup',function(){
|
|
var text = $("#addTargets").val();
|
|
var lines = text.split(/\r|\r\n|\n/);
|
|
var count = lines.length;
|
|
add_multiple_targets_btn.innerHTML = `Add ${count} Targets`;
|
|
if (!count) {
|
|
add_multiple_targets_btn.disabled = true;
|
|
}
|
|
else{
|
|
add_multiple_targets_btn.disabled = false;
|
|
}
|
|
});
|
|
});
|
|
|
|
function showname (file, id) {
|
|
$(id).html('Selected file: ' + htmlEncode(file.files.item(0).name));
|
|
};
|
|
|
|
function show_whois(){
|
|
// check if target exists or not
|
|
var domain = document.getElementById("domainName").value;
|
|
if (domain) {
|
|
get_domain_whois(domain);
|
|
}
|
|
}
|
|
|
|
</script>
|
|
{% endblock page_level_script %}
|