options.py 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-"
  3. """
  4. UFONet - Denial of Service Toolkit - 2013/2014/2015/2016/2017/2018 - by psy (epsylon@riseup.net)
  5. You should have received a copy of the GNU General Public License along
  6. with UFONet; if not, write to the Free Software Foundation, Inc., 51
  7. Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  8. """
  9. import optparse
  10. class UFONetOptions(optparse.OptionParser):
  11. def __init__(self, *args):
  12. self.zombies_file = "botnet/zombies.txt" # set source path to retrieve 'zombies'
  13. self.aliens_file = "botnet/aliens.txt" # set source path to retrieve 'aliens'
  14. self.droids_file = "botnet/droids.txt" # set source path to retrieve 'droids'
  15. self.ucavs_file = "botnet/ucavs.txt" # set source path to retrieve 'ucavs'
  16. self.rpcs_file = "botnet/rpcs.txt" # set source path to retrieve 'rpcs'
  17. self.dorks_file = "botnet/dorks.txt" # set source path to retrieve 'dorks'
  18. self.zombies = int(self.extract_zombies())
  19. self.aliens = int(self.extract_aliens())
  20. self.droids = int(self.extract_droids())
  21. self.ucavs = int(self.extract_ucavs())
  22. self.rpcs = int(self.extract_rpcs())
  23. self.dorks = int(self.extract_dorks())
  24. self.mods = self.extract_mods()
  25. self.tools = self.extract_tools()
  26. self.total_botnet = str(self.zombies+self.aliens+self.droids+self.ucavs+self.rpcs)
  27. optparse.OptionParser.__init__(self,
  28. description='\nUFONet - Denial of Service Toolkit - by psy',
  29. prog='./ufonet',
  30. version='\nCode: v1.1 - Quantum Hydra!\n')
  31. self.add_option("-v", "--verbose", action="store_true", dest="verbose", help="active verbose on requests")
  32. self.add_option("--timeline", action="store_true", dest="timeline", help="show program's code timeline")
  33. self.add_option("--update", action="store_true", dest="update", help="check for latest stable version")
  34. self.add_option("--check-tor", action="store_true", dest="checktor", help="check to see if Tor is used properly")
  35. self.add_option("--force-ssl", action="store_true", dest="forcessl", help="force usage of SSL/HTTPS requests")
  36. self.add_option("--force-yes", action="store_true", dest="forceyes", help="set 'YES' to all questions")
  37. self.add_option("--gui", action="store_true", dest="web", help="run GUI (UFONet Web Interface)")
  38. group8 = optparse.OptionGroup(self, "*Tools*")
  39. group8.add_option("--crypter", action="store_true", dest="cryptomsg", help="Crypt/Decrypt messages using AES256+HMAC-SHA1")
  40. group8.add_option("--network", action="store_true", dest="shownet", help="Show info about your network (MAC, IPs)")
  41. self.add_option_group(group8)
  42. group1 = optparse.OptionGroup(self, "*Configure Request(s)*")
  43. group1.add_option("--proxy", action="store", dest="proxy", help="Use proxy server (tor: 'http://127.0.0.1:8118')")
  44. group1.add_option("--user-agent", action="store", dest="agent", help="Use another HTTP User-Agent header (default SPOOFED)")
  45. group1.add_option("--referer", action="store", dest="referer", help="Use another HTTP Referer header (default SPOOFED)")
  46. group1.add_option("--host", action="store", dest="host", help="Use another HTTP Host header (default NONE)")
  47. group1.add_option("--xforw", action="store_true", dest="xforw", help="Set your HTTP X-Forwarded-For with random IP values")
  48. group1.add_option("--xclient", action="store_true", dest="xclient", help="Set your HTTP X-Client-IP with random IP values")
  49. group1.add_option("--timeout", action="store", dest="timeout", type="int", help="Select your timeout (default 10)")
  50. group1.add_option("--retries", action="store", dest="retries", type="int", help="Retries when the connection timeouts (default 1)")
  51. group1.add_option("--threads", action="store", dest="threads", type="int", help="Maximum number of concurrent HTTP requests (default 5)")
  52. group1.add_option("--delay", action="store", dest="delay", type="int", help="Delay in seconds between each HTTP request (default 0)")
  53. self.add_option_group(group1)
  54. group2 = optparse.OptionGroup(self, "*Search for 'Zombies'*")
  55. group2.add_option("-s", action="store", dest="search", help="Search from a 'dork' (ex: -s 'proxy.php?url=')")
  56. group2.add_option("--sd", action="store", dest="dorks", help="Search from 'dorks' file (ex: --sd 'botnet/dorks.txt')")
  57. group2.add_option("--sn", action="store", dest="num_results", help="Set max number of results for engine (default 10)")
  58. group2.add_option("--se", action="store", dest="engine", help="Search engine to use for 'dorking' (default Yahoo)")
  59. group2.add_option("--sa", action="store_true", dest="allengines", help="Search massively using all search engines")
  60. group2.add_option("--auto-search", action="store_true", dest="autosearch", help="Search automatically for 'zombies' (may take time!)")
  61. self.add_option_group(group2)
  62. group3 = optparse.OptionGroup(self, "*Test Botnet*")
  63. group3.add_option("--test-offline", action="store_true", dest="testoffline", help="Fast check to discard offline bots")
  64. group3.add_option("--test-all", action="store_true", dest="testall", help="Update ALL botnet status (may take time!)")
  65. group3.add_option("-t", action="store", dest="test", help="Update 'zombies' status (ex: -t 'botnet/zombies.txt')")
  66. group3.add_option("--test-rpc", action="store_true", dest="testrpc", help="Update 'reflectors' status (ex: --test-rpc)")
  67. group3.add_option("--attack-me", action="store_true", dest="attackme", help="Order 'zombies' to attack you (NAT required!)")
  68. self.add_option_group(group3)
  69. group4 = optparse.OptionGroup(self, "*Community*")
  70. group4.add_option("--download-zombies", action="store_true", dest="download", help="Download 'zombies' from Community server")
  71. group4.add_option("--upload-zombies", action="store_true", dest="upload", help="Upload your 'zombies' to Community server")
  72. group4.add_option("--blackhole", action="store_true", dest="blackhole", help="Create a 'blackhole' to share your 'zombies'")
  73. group4.add_option("--up-to", action="store", dest="upip", help="Upload your 'zombies' to a 'blackhole'")
  74. group4.add_option("--down-from", action="store", dest="dip", help="Download your 'zombies' from a 'blackhole'")
  75. self.add_option_group(group4)
  76. group5 = optparse.OptionGroup(self, "*Research Target*")
  77. group5.add_option("-i", action="store", dest="inspect", help="Search biggest file (ex: -i 'http(s)://target.com')")
  78. group5.add_option("-x", action="store", dest="abduction", help="Examine webserver configuration (+CVE, +WAF detection)")
  79. self.add_option_group(group5)
  80. group7 = optparse.OptionGroup(self, "*Extra Attack(s)*")
  81. group7.add_option("--db", action="store", dest="dbstress", help="Start 'DB Stress' attack (ex: --db 'search.php?q=')")
  82. group7.add_option("--loic", action="store", dest="loic", help="Start 'DoS Web LOIC' attack (ex: --loic 100)")
  83. group7.add_option("--loris", action="store", dest="loris", help="Start 'DoS Slow HTTP' attack (ex: --loris 101)")
  84. group7.add_option("--ufosyn", action="store", dest="ufosyn", help="Start 'DoS TCP-SYN flood' attack (ex: --ufosyn 100)")
  85. self.add_option_group(group7)
  86. group6 = optparse.OptionGroup(self, "*Configure Attack(s)*")
  87. group6.add_option("--no-head", action="store_true", dest="disablehead", help="Disable status check: 'Is target up?'")
  88. group6.add_option("--no-aliens", action="store_true", dest="disablealiens", help="Disable 'aliens' web abuse")
  89. group6.add_option("--no-droids", action="store_true", dest="disabledroids", help="Disable 'droids' redirectors")
  90. group6.add_option("--no-ucavs", action="store_true", dest="disableisup", help="Disable 'ucavs' checkers")
  91. group6.add_option("--no-rpcs", action="store_true", dest="disablerpcs", help="Disable 'xml-rpcs' reflectors")
  92. group6.add_option("-r", action="store", dest="rounds", help="Set number of rounds (default 1)")
  93. group6.add_option("-b", action="store", dest="place", help="Set place to attack (ex: -b '/path/big.jpg')")
  94. group6.add_option("-a", action="store", dest="target", help="Start 'DDoS' attack (ex: -a 'http(s)://target.com')")
  95. self.add_option_group(group6)
  96. def extract_mods(self):
  97. mods = "3 [ LOIC + LORIS + UFOSYN ]" # hardcoded mods ;-)
  98. return mods
  99. def extract_tools(self):
  100. tools = "2" # hardcoded tools
  101. return tools
  102. def extract_zombies(self):
  103. try:
  104. f = open(self.zombies_file)
  105. zombies = len(f.readlines())
  106. f.close()
  107. except:
  108. zombies = "broken!"
  109. return zombies
  110. def extract_aliens(self):
  111. try:
  112. f = open(self.aliens_file)
  113. aliens = len(f.readlines())
  114. f.close()
  115. except:
  116. aliens = "broken!"
  117. return aliens
  118. def extract_droids(self):
  119. try:
  120. f = open(self.droids_file)
  121. droids = len(f.readlines())
  122. f.close()
  123. except:
  124. droids = "broken!"
  125. return droids
  126. def extract_ucavs(self):
  127. try:
  128. f = open(self.ucavs_file)
  129. ucavs = len(f.readlines())
  130. f.close()
  131. except:
  132. ucavs = "broken!"
  133. return ucavs
  134. def extract_rpcs(self):
  135. try:
  136. f = open(self.rpcs_file)
  137. rpcs = len(f.readlines())
  138. f.close()
  139. except:
  140. rpcs = "broken!"
  141. return rpcs
  142. def extract_dorks(self):
  143. try:
  144. f = open(self.dorks_file)
  145. dorks = len(f.readlines())
  146. f.close()
  147. except:
  148. dorks = "broken!"
  149. return dorks
  150. def get_options(self, user_args=None):
  151. (options, args) = self.parse_args(user_args)
  152. if (not options.test and not options.testrpc and not options.target and not options.checktor and not options.search and not options.dorks and not options.inspect and not options.abduction and not options.update and not options.download and not options.upload and not options.web and not options.attackme and not options.upip and not options.dip and not options.blackhole and not options.cryptomsg and not options.shownet and not options.timeline and not options.autosearch and not options.testoffline and not options.testall):
  153. print '='*75, "\n"
  154. print "888 888 8888888888 .d88888b. 888b 888 888 "
  155. print "888 888 888 d88P" "Y888b 8888b 888 888 "
  156. print "888 888 888 888 888 88888b 888 888 "
  157. print "888 888 8888888 888 888 888Y88b 888 .d88b. 888888 "
  158. print "888 888 888 888 888 888 Y88b888 d8P Y8b 888 "
  159. print "888 888 888 888 888 888 Y88888 88888888 888 "
  160. print "Y88b. .d88P 888 Y88b. .d88P 888 Y8888 Y8b. Y88b. "
  161. print " 'Y88888P' 888 'Y88888P' 888 Y888 'Y8888 'Y8888"
  162. print self.description, "\n"
  163. print '='*75 + "\n"
  164. print '-> Bots:', self.total_botnet, "[ Z:" + str(self.zombies) + " + A:" + str(self.aliens) + " + D:" + str(self.droids) + " + U:" + str(self.ucavs) + " + R:" + str(self.rpcs) + " ] | Dorks:", self.dorks, "\n"
  165. print '-> Mods:', str(self.mods) + " | Tools:", self.tools, "\n"
  166. print '='*75, "\n"
  167. print "-> For HELP use: -h or --help\n"
  168. print "-> For WEB interface use: --gui\n"
  169. print '='*75, "\n"
  170. return False
  171. return options