Hanif888 (ID: 26)
等级:新手上路
积分:5
发帖:1 篇
来自:保密
注册:2022/8/23 13:07:21
造访:2022/8/23 13:07:21
发帖:1 篇
来自:保密
注册:2022/8/23 13:07:21
造访:2022/8/23 13:07:21
[ 第 1 楼 ]
回复
保存文件名:FindHttp.hta,内容如下:
<!doctype html><html><head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>发现局域网 HTTP 服务</title>
<style type="text/css">
body{ font: 4mm/7mm arial }
</style></head><body>
<input type="button" value="开始查找" onclick="startFind()" />
<div></div>
</body><script type="text/livescript">
var box = document.querySelector("div");
var prefix = "192.168.1.";
function startFind() {
prefix = prompt("请输入IP前缀", prefix) || prefix;
box.innerHTML = "";
for(var i = 0; i < 255; i++) checkHttp(prefix + i);
}
function checkHttp(ip) {
var xhr = new ActiveXObject("MsXml2.ServerXmlHttp");
xhr.open("GET", "http://" + ip, true);
xhr.onreadystatechange = function() {
if(xhr.readyState != 4) return;
var arr = xhr.responseText.match(/<title>(.*?)<\/title>/i) || 0;
var div = document.createElement("div");
div.innerHTML = (arr[1] || ip).link("http://" + ip);
box.appendChild(div).title = ip;
}
xhr.send();
}
</script></html>
2022/8/23 13:22:05
IP:已设置保密