forked from samyk/webscan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscan.html
More file actions
39 lines (37 loc) · 1.32 KB
/
scan.html
File metadata and controls
39 lines (37 loc) · 1.32 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
<html>
<head>
<script src="webscan.js"></script>
</head>
<body>
<pre id='content'>
* <a href="https://samy.pl/webscan"><b>webscan</b></a> is a browser-based network IP scanner and local-IP resolver. It detects IPs bound to the user/victim as well as IP addresses discovered across any detected subnets.
* by <a href="https://twitter.com/samykamkar">samy kamkar</a> 2020/11/07
* source code: <a href="https://github.com/samyk/webscan">github.com/samyk/webscan</a>
* more fun projects at <a href="https://samy.pl">https://samy.pl</a>
<hr>
</pre>
<script>
window.addEventListener('load', async function()
{
// logging function
let log = function(line)
{
//console.log(line)
document.getElementById('content').innerHTML += line + '\n'
}
let ipsToScan = undefined
let scan = await webScanAll(
ipsToScan, // array. if undefined, scan major subnet gateways, then scan live subnets. supports wildcards
{
rtc: true, // use webrtc to detect local ips
logger: log, // logger callback
localCallback: function(ip) { console.log(`local ip callback: ${ip}`) },
networkCallback: function(ip) { console.log(`network ip callback: ${ip}`) },
}
)
log(JSON.stringify(scan, null, 2))
log(`<b><span style='color: tomato;'>local IPs: ${scan.local.join(', ')}</span></b>`)
})
</script>
</body>
</html>