示例#1
0
    def __init__(self):

        self.root_path = os.path.abspath(
            os.path.join(os.path.dirname(__file__)))
        self.config = config_file()
        self.conf_path = config_file('get_path')
        self.wash = lambda inp: inp.lower().strip()

        self.current_arch = self.wash(self.config.get('base', 'current_arch'))
        self.current_platform = self.wash(
            self.config.get('base', 'current_platform'))
        self.host = self.wash(self.config.get('base', 'local_host'))
        self.port = self.wash(self.config.get('base', 'local_port'))
        self.log = self.wash(self.config.get('base', 'logs'))

        status = self.wash(self.config.get('cmd', 'colors'))
        self.colors = True if status == "on" else False

        self.perfix = "Parat-"
        self.random_output = True
        self.platforms = [
            a for a in self.wash(self.config.get('gen', 'os')).split(", ")
        ]
        self.architectures = [
            a for a in self.wash(self.config.get('gen', 'arch')).split(", ")
        ]
        self.random_string = ''.join(
            choice(ascii_uppercase + ascii_lowercase + digits)
            for _ in range(6))
        self.output = self.perfix + self.current_arch + "_" + self.random_string + ".pyw"
        self.scriptlet = [None, ""]  # name, content (read binary)
        self.encoding = False
        self.path = None
示例#2
0
文件: Shell.py 项目: zshell/Parat
def start_loop(login_obg):

    clear_screen()
    tolow = lambda i: i.lower()

    banner = tolow(config_file().get('cmd', 'display_banner'))
    randbc = True if tolow(config_file().get(
        'cmd', 'banner_random_color')) == "on" else False
    colors = tolow(config_file().get('cmd', 'colors'))
    verbose = tolow(config_file().get('cmd', 'debug'))

    if banner == "on":
        print_banner(int(randbc))

    try:

        check_update()
        notif_creds(colors, login_obg)

        parat = ParatShell()
        parat.check_db()
        parat.main_background()

    except Exception as e:

        if verbose:
            traceback.print_exc()
        pprint(colorize(str(e) + '\n', colored=colors, status="ERR"), 1)

        plog.error(str(e))
示例#3
0
    def __init__(self):

        self.status = True if config_file().get(
            "base", "creds").lower() == "on" else False
        self.colors = True if config_file().get(
            "cmd", "colors").lower() == "on" else False
        self.login_md5 = hashlib.md5()
        self.create_md5 = hashlib.md5()
示例#4
0
文件: Shell.py 项目: zshell/Parat
    def __init__(self):

        plog.info("parat started <" + "-" * 10)
        signal.signal(signal.SIGTSTP, signal.SIG_IGN)

        self.ROOT = os.path.abspath('')
        self.login = ParatLogin()
        self.cli_counter = 0
        self.used_ports = {}
        self.cdisplay = {
        }  # <dict> {client_id: 'client_id, remote_ip, local_port, remote_port'}
        self.client = {
        }  # <dict> {client_id: [connection, path, username, remote_ip, remote_port, local_port]}
        self.stop_all_threads = False
        self.last_command = None
        self.wash = lambda inp: inp.lower().strip()
        self.config = config_file()
        self.conf_path = config_file('get_path')
        self.path = os.path.abspath(os.path.dirname(sys.argv[0]))
        self.history_path = "{}/.Parat_history".format(self.ROOT)
        self.origin_sigint = signal.getsignal(signal.SIGINT)
        self.main_comands = [
            c for c in self.wash(
                self.config.get('auto_complete', 'main_commands')).split(', ')
        ]
        self.target_comands = [
            c for c in self.wash(
                self.config.get('auto_complete', 'target_commands')).split(
                    ', ')
        ]
        self.colors = True if self.wash(self.config.get(
            'cmd', 'colors')) == "on" else False
        self.banner = True if self.wash(
            self.config.get('cmd', 'display_banner')) == "on" else False
        self.randbc = True if self.wash(
            self.config.get('cmd', 'banner_random_color')) == "on" else False
        self.verbose = True if self.wash(self.config.get(
            'cmd', 'debug')) == "on" else False
        self.lhost = self.wash(self.config.get('base', 'local_host'))
        self.port = self.wash(self.config.get('base', 'local_port'))
        self.parser = ParatArgParse(self, self.wash)
        self.ping_port = 7777
        self.ping_delay = 1  #s
        self.close = exit

        # read commands history from file
        if os.path.isfile(self.history_path):
            readline.read_history_file(self.history_path)
        else:
            open(self.history_path, 'a').close()

        # log start config details
        plog.info("path: " + str(self.ROOT))
        plog.info("color: " + str(self.colors))
        plog.info("debug: " + str(self.verbose))
        plog.info("local_host: " + str(self.lhost))
        plog.info("local_port: " + str(self.port))
示例#5
0
 def check(self):
     try:
         self.status = True if config_file().get(
             "base", "creds").lower() == "on" else False
         return self.status
     except Exception as e:
         return self.status
示例#6
0
# Parat project is under the GNU GENERAL PUBLIC LICENSE (GPL) license.
# see the COPYING file for the detailed licence terms
#

import os
import configparser as ConfigParser
from time import sleep
from string import ascii_letters
from random import choice
from lib.ParatPrint import colorize, pprint
from core.ParatError import *
from conf import config_file
from lib.ProcessThread import ParatProcessBar


config = config_file()

def tumultuous(conn, handler, colors, name):

    try:

        text = colorize(
            "Checking for data",
            colored=colors,
            status="INF"
        )
        process_bar = ParatProcessBar(text)
        process_bar.start_process()

        conn.settimeout(3)
        data = conn.recv(4096)
示例#7
0
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)