 |
|
Code
%
Dim varUAGENT
Dim varREFERER
Dim varADDR
Dim varIAM
Dim varRemoteAddr
varUAGENT = Request.ServerVariables("HTTP_USER_AGENT")
varREFERER = Request.ServerVariables("HTTP_REFERER")
varRemoteAddr = Request.ServerVariables("Remote_ADDR")
varADDR = left(Request.ServerVariables("Remote_ADDR"), 2)
varIAM = ""
' Search for those BOTS
If instr(varUAGENT,"google") OR instr(varUAGENT,"URL_Spider_SQL") OR instr(varUAGENT,"Firefly") OR instr(varUAGENT,"NationalDirectory") OR instr(varUAGENT,"Ask Jeeves") OR instr(varUAGENT,"TECNOSEEK") OR instr(varUAGENT,"InfoSeek") OR instr(varUAGENT,"WebFindBot") OR instr(varUAGENT,"girafabot") OR instr(varUAGENT,"crawler") OR instr(varUAGENT,"www.galaxy.com") OR instr(varUAGENT,"Googlebot") OR instr(varUAGENT,"Scooter") OR instr(varUAGENT,"Slurp") OR instr(varUAGENT,"appie") OR instr(varUAGENT,"FAST") OR instr(varUAGENT,"fast") OR instr(varUAGENT,"WebBug") OR instr(varUAGENT,"Spade") OR instr(varUAGENT,"ZyBorg") OR instr(varUAGENT,"rabaz") Then
' Determine the google bot
If varADDR = 21 AND instr(varUAGENT,"google") Then
varIAM = "Googlebot"
End If
If varADDR = 64 AND instr(varUAGENT,"google") Then
varIAM = "Freshbot"
End If
' String the info message together
If varREFERER <> "" Then
strMessage = "Refer:" & varREFERER & VbCrlf
End If
If varUAGENT <> "" Then
strMessage = strMessage & "Agent:" & varUAGENT & VbCrlf
End If
If varIAM <> "" Then
strMessage = strMessage & " I am:" & varIAM & VbCrlf
End If
If varADDR <> "" Then
' SEnd that email
Set JMail = Server.CreateObject("JMail.Message")
JMail.Logging = True
JMail.Charset = "window-874"
JMail.ContentTransferEncoding = "Quoted-Printable"
JMail.ISOEncodeHeaders = False
JMail.AddHeader "Originating-IP", Request.ServerVariables ("REMOTE_ADDR")
JMail.AddNativeHeader "MTA-Settings", "route"
JMail.Priority = 1
JMail.From = "[email protected]"
JMail.FromName = "[email protected]"
'JMail.AddRecipient "[email protected]"
JMail.AddRecipient "[email protected]"
JMail.Subject = "A Spider Is Crawling!!! A voice from God ha ha ha " & Now() & " " &Second(Now())
JMail.HTMLBody = strMessage
If Not JMail.Send( "127.0.0.1:25") Then
Set JMail = Nothing
Else
Set JMail = Nothing
End If
End If
End If
%>
Code ข้างต้นทุกครั้งที่ Bot มาเยี่ยมผมให้มันส่งเมลย์มาแจ้ง ...
แต่คุณสามารถแก้ไข โดยตัดส่วน ส่งเมลย์ออก แล้วนำไป Add ลง database ก็ได้ ครับ
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2010-02-27 19:48:05 |
By :
inanosms |
View :
2565 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |