Skip to content

Commit

Permalink
Added NMAP cmd generator
Browse files Browse the repository at this point in the history
  • Loading branch information
drakylar committed Jan 3, 2022
1 parent f062ba8 commit e449585
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions templates/project/tools/helpers/nmap-helper.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@
</div>
<script>

function copyToClipboard() {
const el = document.createElement('textarea');
el.value = $('#nmap_cmd')[0].value;
el.setAttribute('readonly', '');
el.style.position = 'absolute';
el.style.left = '-9999px';
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
$('body')
.toast({
class: 'success',
position: 'bottom right',
message: 'Copied!'
});
};

function cmd_builder() {
var nmap_cmd = 'nmap';

Expand Down Expand Up @@ -126,7 +144,7 @@
exclude_port_str += 'S:' + $('#sctp_ports_exclude')[0].value.split(" ").join("")
}
if (exclude_port_str !== '') {
nmap_cmd += ' --exclude-ports ' + exclude_port_str ;
nmap_cmd += ' --exclude-ports ' + exclude_port_str;
}

//scripts page
Expand Down Expand Up @@ -228,7 +246,7 @@
+ $('#append_data')[0].value.split(" ").join("") + '"';
}
if ($('#ttl')[0].value.split(" ").join("") !== '') {
nmap_cmd += " --ttl " + $('#ttl')[0].value.split(" ").join("") ;
nmap_cmd += " --ttl " + $('#ttl')[0].value.split(" ").join("");
}
if ($('#ip_options')[0].value.split(" ").join("") !== '') {
nmap_cmd += " --ip-options '" + $('#ip_options')[0].value.split(" ").join("") + "'";
Expand Down Expand Up @@ -775,7 +793,7 @@ <h1 class="ui dividing header">Nmap Helper</h1>
<h2 class="ui header">Generated command</h2>
<div class="ui action input" style="width: 100%">
<input type="text" id="nmap_cmd" style="background: black; color:lawngreen" readonly value="nmap.exe 8.8.8.8">
<button class="ui green button">Copy</button>
<button class="ui green button" onclick="copyToClipboard();">Copy</button>
</div>
<div class="ui divider"></div>
<div class="ui top attached tabular menu" id="options_tabs">
Expand Down

0 comments on commit e449585

Please sign in to comment.