* Bu yazı Ferruh Mavituna ile birlikte oluşturulmuştur.
Dizinin önceki 2 bölümünü
- Pixel Tag (Web Bug) Kullanımı ve Gizlilik Hukuku-1
- Pixel Tag (Web Bug) Kullanımı ve Gizlilik Hukuku-2
başlıkları altında okuyabilirsiniz.
Basit bir webbug
ASP ile basit bir webbug programı aşağıdaki gibi olabilir, Bu dosyayı http://www.siteniz.com/webbug/ adresine “default.asp” olarak kaydederseniz ve takip edilmek istenen siteye de
<table align="center" bgcolor="e4e4e4" border="1" width="80%"> <tr> <td> <img src=”http://www.siteniz.com/webbug/” height=”1“ width=”1”> </td> </tr> </table>
kodunu eklerseniz, artık bu kodu içeren tüm sayfaların içeriği http://www.siteniz.com/webbug/tracking.txt dosyası içerisine kaydedilecektir. Bu dosyayı açabilir ve takip bilgilerini okuyabilirsiniz.
<table align="center" bgcolor="e4e4e4" border="1" width="80%">
<tr>
<td>
<%
Option Explicit
Dim ArrReq, i, Text, TrackingFile, ImgFile
TrackingFile = "tracking.txt"
ImgFile = "banner.gif"
'// Collect Information about visitor
ArrReq = Array("HTTP_REFERER","HTTP_ACCEPT_LANGUAGE","HTTP_USER_AGENT","REMOTE_ADDR","REQUEST_METHOD")
Text="********************************************************" & vbNewline &_
"Time: " & now() & vbNewLine
For i=0 To Ubound(ArrReq)
Text=Text & ArrReq(i) & " : " & Request.ServerVariables(ArrReq(i)) & vbNewLine
Next
'// Write Text File
fm_NewFile TrackingFile,Text
'// Show Page as Image
fm_ASPasImage ImgFile
'******************************************************************
' Functions
'******************************************************************
'// New File
Function fm_NewFile(byVal File,byVal Text) 'New File
Dim FSObj, NewFileObj, GetFObj
If NOT Instr(File,":") Then File = Server.Mappath(File)
Set FSObj = CreateObject("Scripting.FileSystemObject")
If NOT fm_FileExist(File) Then '// If we don't have
Set NewFileObj = FSObj.CreateTextFile(File,false,false)
If Text<>"" Then NewFileObj.Write Text
Else
Set GetFObj = FSObj.GetFile(File)
Set NewFileObj = GetFObj.OpenAsTextStream(8,0)
If Text<>"" Then NewFileObj.Write Text
Set GetFObj = Nothing
End If
NewFileObj.Close : Set FSObj=Nothing : Set NewFileObj=Nothing
End Function
'// Check File
Function fm_FileExist(byVal filename)
If Instr(filename,":")=0 Then filename = Server.Mappath(filename) '// Path
If filename <> "" Then
Dim fm_Fso
Set fm_Fso = Server.CreateObject("Scripting.FileSystemObject")
fm_FileExist = fm_Fso.FileExists(filename)
Set fm_Fso = Nothing
Else
fm_FileExist = False
End If
End Function
'// Show Img
Function fm_ASPasImage(byVal File)
Dim XchngBanner
If NOT Instr(File,":") Then File = Server.Mappath(File)
Set XchngBanner = Server.CreateObject("ADODB.Stream")
XchngBanner.Type = 1
XchngBanner.Open
XchngBanner.LoadFromFile File
Response.ContentType = "image/gif"
Response.BinaryWrite XchngBanner.Read()
XchngBanner.Close : Set XchngBanner = Nothing
End Function
'******************************************************************
%>
</td>
</tr>
</table>
Dizinin devamını Pixel Tag (Web Bug) Kullanımı ve Gizlilik Hukuku-4 başlığı altında okuyabilirsiniz.

Kaynak : 