Sample ASP Webbug

28.01.2004

Okuyucu : 4.010
Günlük Okuyucu : 2,6

Embed this to your HTML e-mails or a to other website to track them down into a .txt a file.

Kaynak Kodunu Download Edin (Download Source Code);

/opensource/source-code/webbug.txt

Kaynak Kod;

1 : <%
2 : '// Sample Webbug
3 : '// Alsa published in http://turk.internet.com (http://turk.internet.com/haber/yazigoster.php3?yaziid=8906)
4 : '******************************************************************
5 : '// Copyright (C) {2003} {Ferruh Mavituna} http://ferruh.mavituna.com
6 : '******************************************************************
7 : Option Explicit

9 : Dim ArrReq, i, Text, TrackingFile, ImgFile

11 : TrackingFile = "tracking.txt"
12 : ImgFile = "banner.gif"

14 : '// Collect Information about visitor
15 : ArrReq = Array("HTTP_REFERER","HTTP_ACCEPT_LANGUAGE","HTTP_USER_AGENT","REMOTE_ADDR","REQUEST_METHOD")

17 : Text="********************************************************" & vbNewline &_
18 : "Time: " & now() & vbNewLine

20 : For i=0 To Ubound(ArrReq)
21 :     Text=Text & ArrReq(i) & " : " & Request.ServerVariables(ArrReq(i)) & vbNewLine
22 : Next

24 : '// Write Text File
25 : fm_NewFile TrackingFile,Text

27 : '// Show Page as Image
28 : fm_ASPasImage ImgFile

30 : '******************************************************************
31 : ' Functions
32 : '******************************************************************
33 : '// New File
34 : Function fm_NewFile(byVal File,byVal Text) 'New File
35 :     Dim FSObj, NewFileObj, GetFObj
36 :     If NOT Instr(File,":") Then File = Server.Mappath(File)

38 :     Set FSObj = CreateObject("Scripting.FileSystemObject")
39 :     
40 :     If NOT fm_FileExist(File) Then '// If we don't have
41 :         Set NewFileObj = FSObj.CreateTextFile(File,false,false)
42 :             If Text<>"" Then NewFileObj.Write Text
43 :     Else
44 :         Set GetFObj = FSObj.GetFile(File)
45 :         Set NewFileObj = GetFObj.OpenAsTextStream(8,0)
46 :             If Text<>"" Then NewFileObj.Write Text
47 :         
48 :         Set GetFObj = Nothing
49 :     End If
50 :     
51 :     NewFileObj.Close : Set FSObj=Nothing : Set NewFileObj=Nothing
52 : End Function

54 : '// Check File
55 : Function fm_FileExist(byVal filename)
56 :     If Instr(filename,":")=0 Then filename = Server.Mappath(filename) '// Path

58 :     If filename <> "" Then
59 :         Dim fm_Fso
60 :         Set fm_Fso = Server.CreateObject("Scripting.FileSystemObject")
61 :         fm_FileExist = fm_Fso.FileExists(filename)
62 :         Set fm_Fso = Nothing
63 :     Else
64 :         fm_FileExist = False
65 :     End If
66 : End Function


69 : '// Show Img
70 : Function fm_ASPasImage(byVal File)
71 :     Dim XchngBanner
72 :     If NOT Instr(File,":") Then File = Server.Mappath(File)

74 :     Set XchngBanner = Server.CreateObject("ADODB.Stream")
75 :         XchngBanner.Type = 1
76 :         XchngBanner.Open
77 :         XchngBanner.LoadFromFile File
78 :         Response.ContentType = "image/gif"
79 :         Response.BinaryWrite XchngBanner.Read()
80 :         
81 :      XchngBanner.Close : Set XchngBanner = Nothing
82 : End Function
83 : '******************************************************************
84 : %>
Source Script is modified version of HiLiter
Ferruh Mavituna
© 2002-2007, Ferruh Mavituna

Sabit IP Adresi : 81.22.99.133, SSL Erişimi, Hakkında