国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

ASP獲取客戶端MAC地址

2019-11-18 19:24:36
字體:
來源:轉載
供稿:網友

本程序屬于一種特別的方法。使用范圍比較有限,而且有一定的危險性。借鑒了asp后門里的一些方法。下面是程序代碼。

<%
dim remoteaddr
if Request.ServerVariables("HTTP_X_FORWARDED_FOR")=empty then
remoteaddr=Request.ServerVariables("REMOTE_ADDR")
else
remoteaddr=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
end if

Response.Write(GetMac(remoteaddr))
'由于讀取某組件,請確保您的服務器可以正常使用這兩個組件
'  本程序需要調用cmd.exe程序,請確保IIS來賓帳號對程序有訪問權限。
'  本程序需要臨時文件保存結果,請確保IIS來賓帳號對臨時目錄有寫權限。
'
function GetMac(IP)
On Error Resume Next
Dim oScript
Dim oFileSys, oFile
Dim All, szTempFile,ipc,phyc,typec
Dim TempPath
Set oScript = Server.CreateObject("WSCRIPT.SHELL")
Set oFileSys = Server.CreateObject("Scripting.FileSystemObject")
TempPath="d:/temp/" '臨時目錄
szTempFile = TempPath & oFileSys.GetTempName() ' 獲取臨時文件名
Call oScript.Run ("cmd.exe /c ping -n 2 " & IP, 0, True) '保證arp表中有此IP
Call oScript.Run ("cmd.exe /c arp -a " & IP & " > " & szTempFile, 0, True)
Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0)
All=oFile.ReadAll()
oFile.Close
If (IsObject(oFile)) Then
  Call oFileSys.DeleteFile(szTempFile, True)
End If
arr = Split(All, vbCrLf)
If UBound(arr) = 4 Then
ipc = InStr(1, arr(2), "Internet Address")
phyc = InStr(1, arr(2), "Physical Address")
typec = InStr(1, arr(2), "Type")
If typec > phyc And phyc > ipc And ipc > 0 Then
GetMac=Ucase(Trim(CStr(Mid(arr(3), phyc, typec - phyc))))
End If
End If
End function
%>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 沛县| 铜陵市| 彭山县| 山西省| 菏泽市| 龙岩市| 衡阳县| 马鞍山市| 额济纳旗| 平乐县| 湟源县| 大邑县| 平潭县| 翁牛特旗| 潜江市| 建湖县| 黑龙江省| 东乌| 盖州市| 万年县| 宜兰县| 东丰县| 梅州市| 缙云县| 醴陵市| 田林县| 张家界市| 屯门区| 兴义市| 汉源县| 长寿区| 潜江市| 五寨县| 开平市| 宜川县| 怀远县| 吴江市| 恩平市| 云南省| 鸡东县| 钦州市|