Pyng/templates/index.html

65 lines
2.4 KiB
HTML

<!DOCTYPE HTML>
<html>
<link href="{{url_for('static', filename = 'style.css')}}" rel="stylesheet">
{{ fontawesome_css() }}
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.0.4/socket.io.js" integrity="sha512-aMGMvNYu8Ue4G+fHa359jcPb1u+ytAF+P2SCb+PxrjCdO3n3ZTxJ30zuH39rimUggmTwmh2u7wvQsDTHESnmfQ==" crossorigin="anonymous"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var socket = io();
socket.on('connect', function() {
socket.emit('my_event', {data: 'I\'m connected!'});
});
socket.on('scan_response', function(msg) {
$('#output').append('<br>' + $('<div/>').text(msg.data).html());
})
$('form#scanner').submit(function(event) {
document.getElementById("output").innerHTML = "";
socket.emit('scan_port', $('#Target').val());
return false;
});
socket.on('net_response', function(msg) {
$('#output').append('<tr><td>' + $('<div/>').text(msg.ip).html()+'</td><td>'+ $('<div/>').text(msg.mac).html()+'</td><td>'+ $('<div/>').text(msg.vendor).html()+'</td><td>'+ $('<div/>').text(msg.dns).html()+'</td></tr>');
})
$('form#network').submit(function(event) {
document.getElementById("output").innerHTML = "";
socket.emit('net_port', $('#Subnet').val());
return false;
});
});
</script>
</head>
<body>
<title>Pyng</title>
<div class="logout">
<ul>
{% for item in nav.top %}
<li class="{{ 'active' if item.is_active else '' }}">
<a href="{{ item.url }}">{{ item.label }}</a>
</li>
{% endfor %}
<li style="float:right;">
<a href="logout"><span class="fas fa-user" style="display: inline;"></span> Logout</a>
</li>
</ul>
</div>
<h1>Network Scan</h1>
<form id="network" method="POST" action="#">
<input type="text" id="Subnet" placeholder="192.168.0.0/24">
<input type="submit" value="Send">
</form>
<center>
<br><br><div id="output"></div>
</center>
</body>
</html>