2023-11-02 12:38:04 +00:00
|
|
|
|
$( function() {
|
|
|
|
|
$("#nettools_nslookup_record_type").selectmenu({
|
|
|
|
|
width: 175
|
|
|
|
|
});
|
|
|
|
|
$("#nettools_telnet_form").on("click", ":submit", function (e) {
|
|
|
|
|
$('#ajax-nettools').html('');
|
2024-06-16 09:27:47 +00:00
|
|
|
|
let frm = $('#nettools_telnet_form');
|
2023-11-02 12:38:04 +00:00
|
|
|
|
if ($('#nettools_telnet_server_from option:selected').val() == '------') {
|
|
|
|
|
toastr.warning('Choose a server From');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if ($('#nettools_telnet_server_to').val() == '') {
|
|
|
|
|
toastr.warning('Choose a server To');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if ($('#nettools_telnet_port_to').val() == '') {
|
|
|
|
|
toastr.warning('Enter a port To');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: frm.attr('action'),
|
|
|
|
|
data: frm.serialize(),
|
|
|
|
|
type: frm.attr('method'),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
data = data.replace('\n', "<br>");
|
|
|
|
|
if (data.indexOf('error: ') != '-1' || data.indexOf('Fatal') != '-1' || data.indexOf('Error(s)') != '-1') {
|
|
|
|
|
$('#ajax-nettools').html('<div class="ping_pre">' + data + '</div>');
|
|
|
|
|
} else if (data.indexOf('warning: ') != '-1') {
|
|
|
|
|
toastr.clear();
|
|
|
|
|
toastr.warning(data)
|
|
|
|
|
} else {
|
|
|
|
|
toastr.clear();
|
|
|
|
|
if (data.indexOf('') != '-1') {
|
|
|
|
|
$('#ajax-nettools').html('<div class="ping_pre"><b>Connection has been successful</b></div>');
|
|
|
|
|
} else {
|
|
|
|
|
$('#ajax-nettools').html('<div class="ping_pre"><b>Connection has been successful</b>:<br /><br />' + data + '</div>');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
});
|
|
|
|
|
$("#nettools_nslookup_form").on("click", ":submit", function (e) {
|
|
|
|
|
$('#ajax-nettools').html('');
|
2024-06-16 09:27:47 +00:00
|
|
|
|
let frm = $('#nettools_nslookup_form');
|
2023-11-02 12:38:04 +00:00
|
|
|
|
if ($('#nettools_nslookup_server_from option:selected').val() == '------') {
|
|
|
|
|
toastr.warning('Choose a server From');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if ($('#nettools_nslookup_name').val() == '') {
|
|
|
|
|
toastr.warning('Enter a DNS name');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: frm.attr('action'),
|
|
|
|
|
data: frm.serialize(),
|
|
|
|
|
type: frm.attr('method'),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
data = data.replace('\n', "<br>");
|
|
|
|
|
if (data.indexOf('error: ') != '-1' || data.indexOf('Fatal') != '-1' || data.indexOf('Error(s)') != '-1') {
|
|
|
|
|
toastr.clear();
|
|
|
|
|
toastr.error(data);
|
|
|
|
|
} else if (data.indexOf('warning: ') != '-1') {
|
|
|
|
|
toastr.clear();
|
|
|
|
|
toastr.warning(data)
|
|
|
|
|
} else {
|
|
|
|
|
toastr.clear();
|
|
|
|
|
$('#ajax-nettools').html('<div class="ping_pre">' + data + '</div>');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
});
|
|
|
|
|
$("#nettools_icmp_form").on("click", ":submit", function (e) {
|
|
|
|
|
$('#ajax-nettools').html('');
|
2024-06-16 09:27:47 +00:00
|
|
|
|
let frm = $('#nettools_icmp_form');
|
2023-11-02 12:38:04 +00:00
|
|
|
|
if ($('#nettools_icmp_server_from option:selected').val() == '------') {
|
|
|
|
|
toastr.warning('Choose a server From');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if ($('#nettools_icmp_server_to').val() == '') {
|
|
|
|
|
toastr.warning('Enter a server To');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: frm.attr('action'),
|
|
|
|
|
data: frm.serialize() + "&nettools_action=" + $(this).val(),
|
|
|
|
|
type: frm.attr('method'),
|
2024-01-26 08:03:46 +00:00
|
|
|
|
xhrFields: {
|
|
|
|
|
onprogress: function (e) {
|
|
|
|
|
console.log(e.currentTarget.responseText);
|
|
|
|
|
$('#ajax-nettools').html(e.currentTarget.responseText);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
dataType: 'text',
|
2023-11-02 12:38:04 +00:00
|
|
|
|
success: function (data) {
|
|
|
|
|
data = data.replace('\n', "<br>");
|
|
|
|
|
if (data.indexOf('error: ') != '-1' || data.indexOf('Fatal') != '-1' || data.indexOf('Error(s)') != '-1') {
|
|
|
|
|
toastr.clear();
|
|
|
|
|
toastr.error(data);
|
|
|
|
|
} else if (data.indexOf('warning: ') != '-1') {
|
|
|
|
|
toastr.clear();
|
|
|
|
|
toastr.warning(data)
|
|
|
|
|
} else {
|
|
|
|
|
toastr.clear();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
});
|
|
|
|
|
$("#nettools_portscanner_form").on("click", ":submit", function (e) {
|
2024-06-19 17:52:24 +00:00
|
|
|
|
let port_server = $('#nettools_portscanner_server').val();
|
2023-11-02 12:38:04 +00:00
|
|
|
|
$('#ajax-nettools').html('');
|
2024-06-19 17:52:24 +00:00
|
|
|
|
if (port_server == '') {
|
2023-11-02 12:38:04 +00:00
|
|
|
|
toastr.warning('Enter an address');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
2024-08-02 09:50:02 +00:00
|
|
|
|
url: "/portscanner/scan",
|
2024-06-19 17:52:24 +00:00
|
|
|
|
data: JSON.stringify({'ip': port_server}),
|
|
|
|
|
type: "POST",
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
2023-11-02 12:38:04 +00:00
|
|
|
|
success: function (data) {
|
2024-06-19 17:52:24 +00:00
|
|
|
|
if (data.status === 'failed') {
|
|
|
|
|
toastr.error(data.error);
|
2023-11-02 12:38:04 +00:00
|
|
|
|
} else {
|
|
|
|
|
toastr.clear();
|
2024-06-19 17:52:24 +00:00
|
|
|
|
$("#show_scans_ports_body").html(data.data);
|
2023-11-02 12:38:04 +00:00
|
|
|
|
$("#show_scans_ports").dialog({
|
|
|
|
|
resizable: false,
|
|
|
|
|
height: "auto",
|
|
|
|
|
width: 360,
|
|
|
|
|
modal: true,
|
2024-06-19 17:52:24 +00:00
|
|
|
|
title: "Opened ports",
|
2023-11-02 12:38:04 +00:00
|
|
|
|
buttons: [{
|
|
|
|
|
text: close_word,
|
|
|
|
|
click: function () {
|
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
$("#show_scans_ports_body").html('');
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
});
|
2024-04-04 11:30:07 +00:00
|
|
|
|
$("#nettools_whois_form").on("click", ":submit", function (e) {
|
|
|
|
|
$('#ajax-nettools').html('');
|
2024-06-16 09:27:47 +00:00
|
|
|
|
let frm = $('#nettools_whois_form');
|
2024-04-04 11:30:07 +00:00
|
|
|
|
if ($('#nettools_whois_name').val() == '') {
|
|
|
|
|
toastr.warning('Enter a Domain name');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: frm.attr('action'),
|
|
|
|
|
data: frm.serialize() + "&nettools_action=" + $(this).val(),
|
|
|
|
|
type: frm.attr('method'),
|
|
|
|
|
dataType: 'text',
|
|
|
|
|
success: function (data) {
|
|
|
|
|
data = data.replaceAll('"', '');
|
|
|
|
|
if (data.indexOf('error: ') != '-1' || data.indexOf('Fatal') != '-1' || data.indexOf('Error(s)') != '-1') {
|
|
|
|
|
toastr.clear();
|
|
|
|
|
toastr.error(data);
|
|
|
|
|
} else if (data.indexOf('warning: ') != '-1') {
|
|
|
|
|
toastr.clear();
|
|
|
|
|
toastr.warning(data)
|
|
|
|
|
} else {
|
|
|
|
|
toastr.clear();
|
|
|
|
|
console.log(data)
|
|
|
|
|
$('#ajax-nettools').html('<div class="ping_pre">' + data + '</div>');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
});
|
2023-11-02 12:38:04 +00:00
|
|
|
|
});
|