-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresult.html
More file actions
138 lines (134 loc) · 4.51 KB
/
result.html
File metadata and controls
138 lines (134 loc) · 4.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>扫描结果</title>
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style type="text/css">
.port {
cursor: pointer;
}
#infoModal .modal-body,#response {
max-height: 600px;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-lg-8">
<div class="panel panel-default">
<div class="panel-heading">服务统计</div>
<div class="panel-body">
<canvas id="statChart" class="col-lg-12"></canvas>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">扫描结果统计</div>
<div class="panel-body">
<div class="alert alert-success" role="alert">
<span class="glyphicon glyphicon-th-list"></span>
探测到服务器数:
<span id="total-server" class="badge"></span>
</div>
<div class="alert alert-info" role="alert">
<span class="glyphicon glyphicon-flash"></span>
开放端口总数:
<span id="total-port" class="badge"></span>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">开放端口</div>
<div class="panel-body">
<table id="ports-table" class="table table-hover">
<thead>
<tr>
<th>IP</th>
<th>端口</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="infoModal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span>×</span>
</button>
<h4 class="modal-title">详细信息</h4>
</div>
<div class="modal-body">
<pre id="response"></pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
<script type="text/javascript" src="result.js"></script>
<script type="text/javascript">
$(function() {
var ctx = document.getElementById("statChart").getContext("2d");
var data = {};
data.labels = Object.keys(statistics);
data.datasets = [ {
label : "数量",
fillColor : "rgba(101,154,201,1)",
data : Object.keys(statistics).map(function(k) {
return statistics[k];
})
} ];
new Chart(ctx).Bar(data);
var totalServer = 0, totalPort = 0;
$.each(servers, function(ip, ports) {
totalServer++;
totalPort += ports.length;
var opened = ports.map(function(p) {
return '<span data-toggle="tooltip" title="'+p+'" class="label label-success port">' + p.split(' ')[0] + '</span>'
}).join(' ');
$('#ports-table tbody').append('<tr><td>' + ip + '</td><td>' + opened + '</td></tr>');
});
$('#total-server').html(totalServer);
$('#total-port').html(totalPort);
$('[data-toggle="tooltip"]').tooltip();
$('.port').click(function() {
var key = $(this).parent().prev().html()+":"+$(this).html();
if(portdata.hasOwnProperty(key)){
$('#response').html(decodeURIComponent(portdata[key]));
$('#infoModal').modal('show');
}
});
});
</script>
</body>
</html>