-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.html
262 lines (247 loc) · 9.3 KB
/
report.html
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
{# templates/report.html #}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Shodan2DB</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
<!-- Bootstrap icon -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<!-- sortable -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sortable/0.8.0/js/sortable.min.js" integrity="sha512-DEcSaL0BWApJ//v7ZfqAI04nvK+NQcUVwrrx/l1x7OJgU0Cwbq7e459NBMzLPrm8eLPzAwBtiJJS4AvLZDZ8xA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</head>
<body class="has-navbar-fixed-top">
<div class="container is-fluid">
<div class="has-text-centered is-size-1">
Surface exposure report
</div>
<br>
<nav class="navbar is-fixed-top">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item has-text-weight-semibold" href="#top" title="top">
Shodan2DB
</a>
<div class="navbar-burger burger" data-target="navMenu">
<span></span>
<span></span>
<span></span>
</div>
</div>
<div id="navMenu" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item" href="#hosts-list">
Hosts
</a>
<a class="navbar-item" href="#vulns-list">
Vulnerabilities
</a>
<a class="navbar-item" href="#cve-list">
CVE
</a>
</div>
<div class="navbar-end">
<div class="navbar-item">
<p class="control has-icons-left">
<input autofocus
class="input is-rounded" type="text" placeholder="Filter"
id="searchbox"
oninput="liveSearch()"
placeholder="Filter"
type="search">
<span class="icon is-medium is-left">
<i class="bi bi-search"></i>
</span>
</p>
</div>
</div>
</div>
</div>
</nav>
<nav class="level">
<div class="level-item has-text-centered">
<div>
<p class="heading">Hosts</p>
<p class="title">{{ hosts |length }}</p>
</div>
</div>
<div class="level-item has-text-centered">
<div>
<p class="heading">Vulnerabilities</p>
<p class="title">{{ vulns |length }}</p>
</div>
</div>
<div class="level-item has-text-centered">
<div>
<p class="heading">Products</p>
<p class="title">{{ services |length }}</p>
</div>
</div>
<div class="level-item has-text-centered">
<div>
<p class="heading">CVE</p>
<p class="title">{{ cves |length }}</p>
</div>
</div>
</nav>
<p id="hosts-list" class="title is-3 is-spaced">Hosts</p>
<table data-sortable class="table is-hoverable is-bordered is-striped">
<thead>
<tr>
<th>IP</th>
<th>Hostnames</th>
<th>ISP</th>
<th>City</th>
<th>Tags</th>
<th>Vulns</th>
</tr>
</thead>
<tbody>
{% for host in hosts %}
<tr>
<td><a href="#{{ host.ip }}">{{ host.ip }}</a></td>
<td>{{ host.hostnames }}</td>
<td>{{ host.isp }}</td>
<td>{{ host.city }}</td>
<td>{{ host.tags }}</td>
<td>{{ host.nbvulns }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<p id="vulns-list" class="title is-3 is-spaced">Vulnerabilities</p>
{% for host in hosts %}
<section class="section">
<div id="{{ host.ip }}" class="tile is-parent">
<article class="tile is-child notification is-primary">
<p><a href="https://www.shodan.io/host/{{ host.ip }}" class="title">{{ host.ip }}</a> <span
class="tag is-rounded is-large">{{ host.nbvulns }}</span></p>
<p class="subtitle">{{ host.hostnames }}</p>
<div class="content">
<p>
<b>ISP</b> : {{ host.isp }}
<br><b>City</b> : {{ host.city }}
{% if host.tags %}
<br><b>Tags</b> : {{ host.tags }}
{% endif %}
</p>
</div>
</article>
</div>
<br>
<table data-sortable class="table is-hoverable is-bordered is-striped">
<thead>
<tr>
<th>Product</th>
<th>Version</th>
<th>Port</th>
<th>Transport</th>
</tr>
</thead>
<tbody>
{% for service in services %}
{% if service.ip == host.ip %}
<tr>
<td>{{ service.product }}</td>
<td>{{ service.version }}</td>
<td>
<a href="https://www.shodan.io/host/{{ host.ip }}#{{ service.port }}">{{ service.port }}</a>
</td>
<td>{{ service.transport }}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
<table data-sortable class="table is-hoverable is-bordered">
<thead>
<tr>
<th>CVE</th>
<th>CVSS</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for vuln in vulns %}
{% if vuln.ip == host.ip %}
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/{{ vuln.cveid }}">{{ vuln.cveid }}</a></td>
<td>{{ vuln.cvss }}</td>
<td>{{ vuln.summary }}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</section>
{% endfor %}
<p id="cve-list" class="title is-3 is-spaced">Security vulnerability (CVE)</p>
<table data-sortable class="table is-hoverable is-bordered">
<thead>
<tr>
<th>CVE</th>
<th>Count</th>
<th>CVSS</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for cve in cves %}
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/{{ cve.cveid }}">{{ cve.cveid }}</a></td>
<td>{{ cve.count }}</td>
<td>{{ cve.cvss }}</td>
<td>{{ cve.summary }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
<script>
function liveSearch() {
let cards = document.querySelectorAll('.section')
let search_query = document.getElementById("searchbox").value;
for (var i = 0; i < cards.length; i++) {
if (cards[i].innerText.toLowerCase()
.includes(search_query.toLowerCase())) {
cards[i].classList.remove("is-hidden");
} else {
cards[i].classList.add("is-hidden");
}
}
}
let typingTimer;
let typeInterval = 500; // Half a second
let searchInput = document.getElementById('searchbox');
searchInput.addEventListener('keyup', () => {
clearTimeout(typingTimer);
typingTimer = setTimeout(liveSearch, typeInterval);
});
</script>
<script>
document.addEventListener('DOMContentLoaded', () => {
// Get all "navbar-burger" elements
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
// Add a click event on each of them
$navbarBurgers.forEach(el => {
el.addEventListener('click', () => {
// Get the target from the "data-target" attribute
const target = el.dataset.target;
const $target = document.getElementById(target);
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
});
});
$(document).ready(function () {
// Check for click events on the navbar burger icon
$(".navbar-burger").click(function () {
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
$(".navbar-burger").toggleClass("is-active");
$(".navbar-menu").toggleClass("is-active");
});
});
</script>
</html>