Example #1
0
def main(arguments):

    if arguments.command == 'generate':

        obfuscated = generate.generate(password=arguments.password,
                                       obfuscator=arguments.obfuscator,
                                       agent=arguments.agent)

        generate.save_generated(obfuscated, arguments.path)

        log.info(
            messages.generate.generated_backdoor_with_password_s_in_s_size_i %
            (arguments.password, arguments.path, len(obfuscated)))

        return

    elif arguments.command == 'terminal':
        session = SessionURL(url=arguments.url, password=arguments.password)

    elif arguments.command == 'session':
        session = SessionFile(arguments.path)

    dlog.debug(pprint.pformat(session))

    modules.load_modules(session)

    if not arguments.cmd:
        Terminal(session).cmdloop()
    else:
        Terminal(session).onecmd(arguments.cmd)
Example #2
0
    def setUpClass(cls):

        if config.debug:
            stream_handler.setLevel(logging.DEBUG)
        else:
            stream_handler.setLevel(logging.CRITICAL)

        cls._randomize_bd()

        # Check `config.script_folder` permissions
        if (
            subprocess.check_output(
                config.cmd_env_stat_permissions_s % (config.script_folder),
                shell=True).strip()
            != config.script_folder_expected_perms
            ):
            raise DevException(
                "Error: give to the http user full permissions to the folder \'%s\'"
                % config.script_folder
            )

        obfuscated = generate(cls.password)

        tmp_handler, tmp_path = tempfile.mkstemp()
        save_generated(obfuscated, tmp_path)
        subprocess.check_call(
            config.cmd_env_move_s_s % (tmp_path, cls.path),
            shell=True)

        subprocess.check_call(
            config.cmd_env_chmod_s_s % ('777', cls.path),
            shell=True)
Example #3
0
    def setUpClass(cls):

        if config.debug:
            stream_handler.setLevel(logging.DEBUG)
        else:
            stream_handler.setLevel(logging.CRITICAL)

        cls._randomize_bd()

        # Check `config.script_folder` permissions, comparing just the
        # last 3 digits

        if (subprocess.check_output(config.cmd_env_stat_permissions_s %
                                    (config.script_folder),
                                    shell=True).strip()[-3:] !=
                config.script_folder_expected_perms[-3:]):
            raise DevException(
                "Error: give the required permissions to the folder \'%s\'" %
                config.script_folder)

        obfuscated = generate(cls.password)

        tmp_handler, tmp_path = tempfile.mkstemp()
        save_generated(obfuscated, tmp_path)
        subprocess.check_call(config.cmd_env_move_s_s % (tmp_path, cls.path),
                              shell=True)

        subprocess.check_call(config.cmd_env_chmod_s_s % ('0777', cls.path),
                              shell=True)
Example #4
0
    def setUpClass(cls):

        if config.debug:
            stream_handler.setLevel(logging.DEBUG)
        else:
            stream_handler.setLevel(logging.INFO)

        cls._randomize_bd()

        # Check `config.script_folder` permissions
        if (subprocess.check_output(
                config.cmd_env_stat_permissions_s % (config.script_folder),
                shell=True).strip() != config.script_folder_expected_perms):
            raise DevException(
                "Error: give to the http user full permissions to the folder \'%s\'"
                % config.script_folder)

        obfuscated = generate(cls.password)

        tmp_handler, tmp_path = tempfile.mkstemp()
        save_generated(obfuscated, tmp_path)
        subprocess.check_call(config.cmd_env_move_s_s % (tmp_path, cls.path),
                              shell=True)

        subprocess.check_call(config.cmd_env_chmod_s_s % ('777', cls.path),
                              shell=True)
Example #5
0
    def test_generators(self):

        for i in range(0, 500):
            self._randomize_bd()
            obfuscated = generate(self.password)
            save_generated(obfuscated, self.path)
            self.channel = Channel(self.url, self.password, 'StegaRef')
            self._clean_bd()
Example #6
0
    def test_generators(self):

        for i in range(0, 500):
            self._randomize_bd()
            obfuscated = generate(self.password)
            save_generated(obfuscated, self.path)
            self.channel = Channel(self.url, self.password, 'StegaRef')
            self._clean_bd()
    def test_generators(self):

        for i in range(0, 100):
            self._randomize_bd()
            obfuscated = generate(self.password)
            save_generated(obfuscated, self.path)

            self.channel = Channel('ObfPost', {
                'url': self.url,
                'password': self.password
            })
            self._incremental_requests(10, 100, 30, 50)

            self._clean_bd()
Example #8
0
    def test_generators(self):

        for i in range(0, 100):
            self._randomize_bd()
            obfuscated = generate(self.password)
            save_generated(obfuscated, self.path)

            self.channel = Channel(
                'ObfPost',
                {
                    'url' : self.url,
                    'password' : self.password
                }
            )
            self._incremental_requests(10, 100, 30, 50)

            self._clean_bd()
Example #9
0
def main(arguments):

    if arguments.command == 'generate':

        obfuscated = generate.generate(
            password = arguments.password,
            obfuscator = arguments.obfuscator,
            agent = arguments.agent
        )

        generate.save_generated(obfuscated, arguments.path)

        log.info(
        messages.generate.generated_backdoor_with_password_s_in_s_size_i %
        (arguments.path,
        arguments.password, len(obfuscated))
        )

        return

    elif arguments.command == 'terminal':
        session = SessionURL(
            url = arguments.url,
            password = arguments.password
        )

    elif arguments.command == 'session':
        session = SessionFile(arguments.path)

    dlog.debug(
        pprint.pformat(session)
    )

    modules.load_modules(session)

    if not arguments.cmd:
        Terminal(session).cmdloop()
    else:
        Terminal(session).onecmd(arguments.cmd)
Example #10
0
 def setUpClass(cls):
     cls._randomize_bd()
     obfuscated = generate(cls.password, agent='legacycookie_php')
     save_generated(obfuscated, cls.path)
Example #11
0
 def setUpClass(cls):
     cls._randomize_bd()
     obfuscated = generate(cls.password, agent='stegaref_php_debug')
     save_generated(obfuscated, cls.path)
from core import generate
from core.utils import get_map_code_list
import input

mapped_id_list, map_code = get_map_code_list()
generate.generate(mapped_id_list=mapped_id_list,
                  text_in=input.text_in,
                  map_code=map_code)
Example #13
0
 def setUpClass(cls):
     cls._randomize_bd()
     obfuscated = generate(cls.password, agent='legacycookie_php')
     save_generated(obfuscated, cls.path)
Example #14
0
 def setUpClass(cls):
     cls._randomize_bd()
     obfuscated = generate(cls.password, agent='stegaref_php_debug')
     save_generated(obfuscated, cls.path)
Example #15
0
import random,sys
from core import generate
from core import setter
generate = generate.generate()
setter = setter.Setter()


class Handler:
    def __init__(self, global_game_state):
        self.ggs = global_game_state
        self.assocs = {}
        self.assoc_chars = []
        self.unassigned = []

    def take_action_join_game(self, action_gave):
        player_name = setter.set_player_name(action_gave)
        if not player_name in self.ggs["players"]:

            if len(self.ggs["players"]) < 6:
                self.ggs["players"].append(player_name)
                resp = generate.generate_player_joined_game_resp(player_name, self.ggs)
            else:
                resp = generate.generate_maximum_player_reached_resp(player_name, self.ggs)
        else:
            resp = generate.generate_player_already_joined(player_name, self.ggs)
        return resp

    def take_action_reset_game(self):
        resp = generate.generate_cleared_game_state_resp()
        return resp