Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

xanburzum

DNS Lookup e reverso

Recommended Posts

DNS Lookup e reverso DNS Lookup sem um componente instalado no seu servidor.

 

<%@ LANGUAGE="VBSCRIPT" %>
<%
Response.Buffer = True
If Request.Form("frmHost") = "" Then
   strIP = Request.ServerVariables("REMOTE_ADDR")
Else
   strIP = Request.Form("frmHost") 
End If
strAPP = Request.ServerVariables("APPL_PHYSICAL_PATH")
%>
<html>

<head>
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
<title>DNS Lookup</title>
</head>

<body>

<table border="0" cellpadding="4" width="640" cellspacing="0">
<tr>
<td><font color="#000080"><b>DNS Lookup</b></font>
<form method="POST" name="frmRDNS" action="dns.asp">
<label for="frmHost"><u>
<p><strong><br>
Host:</strong></u> </label>  
<input type="text" name="frmHost" id="frmHost" value="<%=strIP%>" size="25">
<input type="button" name="btnSubmit" id="btnSubmit" value="LookUp" onclick="document.frmRDNS.submit()" style="background-color: rgb(0,0,128); color: #FFFFFF; font-weight: bold; font-size: 8pt">
<br>
<br>
(Ex. www.yorumcu.com or 212.252.114.19, if you skip, your IP is tested.)</p>
</form>
</td>
</tr>
<tr>
<td><font face="arial" size="2" color="#003366"><%
rMethod = uCase(Request.ServerVariables("REQUEST_METHOD"))
If rMethod = "POST" Then
   strReturn = nsLookup(strIP)
   If strReturn <> "" Then
       Response.Write strReturn
   Else
       Response.Write "<b>Unknown Host - " & strIP & "</b><br><br>"
   End If
End If
Response.Write("<font color='red'><b>Your IP Address:</b></font> " & Request.ServerVariables("REMOTE_ADDR")) 

Function NSlookup(strHost)
On Error Resume Next

 Set WshShell = Server.CreateObject("Wscript.Shell")
 WshShell.Run ("notepad " & Wscript.ScriptFullName)
 WshShell.Run ("%windir%\notepad" & Wscript.ScriptFullName)
 Return = WshShell.Run("notepad " & Wscript.ScriptFullName, 1, TRUE)

   Set oShell = Server.CreateObject("Wscript.Shell")
   oShell.Run "%ComSpec% /c nslookup " & strHost _
       & "> " & strAPP & strHost & ".txt", 0, True

   Set oFS = Server.CreateObject("Scripting.FileSystemObject")
   Set oTF = oFS.OpenTextFile(strAPP & strHost & ".txt")

   tempData = Null
   Data = Null
   i = 0
   Do While Not oTF.AtEndOfStream
       Data = Trim(oTF.Readline)
           If i > 2 Then
               tempData = tempData & Data & "<BR>"
           End If
       i = (i + 1)
   Loop

   oTF.Close
   oFS.DeleteFile strAPP & strHost & ".txt"

   Set oFS = Nothing
   nsLookup = tempData
End Function
%> <br>
</font>
</td>
</tr>
</table>
</body>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.