コード例 #1
0
    def __cargarParametros(self):
        # Configuracion General
        self.interfaces = Interfaces()
        self.coreMenu = Menu()

        # Configuracion Interfaces
        self.mi_ip = self.configInterfaces.mi_ip
        self.interfaces_mi_pc = self.configInterfaces.interfaces_mi_pc
        self.parametros_obligatorios_interfaces = self.configInterfaces.PARAMETROS_OBLIGATORIOS

        # Configuracion Nmap
        self.parametros_nmap = self.configNmap.PARAMETROS
        self.parametros_obligatorios_nmap = self.configNmap.PARAMETROS_OBLIGATORIOS
        self.parametros_predefinidos_nmap = self.configNmap.FIJOS

        # Variables finales necesarias para conjugacion de datos
        self.interfaces_selec = []
        self.parametros_nmap_selec = []

        self.output = mp.Queue()  # Multiproceso
コード例 #2
0
class AutoMetasploit():
    def __init__(self):
        self.__cargarConfiguracion()
        self.__cargarParametros()
        self.__inicio()

    #
    # Toda la configuracion se carga aqui en variables de clase
    #
    def __cargarConfiguracion(self):
        # Cada clase, una variable de configuración
        self.config = Config.Config
        self.configInterfaces = Config.ConfigInterfaces
        self.configNmap = Config.ConfigNmap
        self.configErrores = Config.ConfigErrores

    def __cargarParametros(self):
        # Configuracion General
        self.interfaces = Interfaces()
        self.coreMenu = Menu()

        # Configuracion Interfaces
        self.mi_ip = self.configInterfaces.mi_ip
        self.interfaces_mi_pc = self.configInterfaces.interfaces_mi_pc
        self.parametros_obligatorios_interfaces = self.configInterfaces.PARAMETROS_OBLIGATORIOS

        # Configuracion Nmap
        self.parametros_nmap = self.configNmap.PARAMETROS
        self.parametros_obligatorios_nmap = self.configNmap.PARAMETROS_OBLIGATORIOS
        self.parametros_predefinidos_nmap = self.configNmap.FIJOS

        # Variables finales necesarias para conjugacion de datos
        self.interfaces_selec = []
        self.parametros_nmap_selec = []

        self.output = mp.Queue()  # Multiproceso

    def get_parametros_seleccionador(self, lista, seleccionados):
        lista_selec = []
        cont = 0
        for param in lista:
            if cont in seleccionados:
                lista_selec.append(param)
            cont += 1
        return lista_selec

    #
    # Inicio del programa principal
    #
    def __inicio(self):
        self.elegirInterfaz()
        self.elegirParametrosNmap()
        self.iniciarEscaneo()

    def elegirInterfaz(self):
        self.coreMenu.elegirOpcionMenu(
            parametros=self.interfaces_mi_pc,
            parametros_selec=self.interfaces_selec,
            param_obligatorios=self.parametros_obligatorios_interfaces)

    def elegirParametrosNmap(self):
        print("PARAMS:{}".format(self.parametros_predefinidos_nmap))
        self.coreMenu.elegirOpcionMenu(
            parametros=self.parametros_nmap,
            parametros_selec=self.parametros_nmap_selec,
            param_obligatorios=self.parametros_obligatorios_nmap,
            predefinidos=self.parametros_predefinidos_nmap)

    def iniciarEscaneo(self):
        interfaces_params = self.get_parametros_seleccionador(
            lista=self.interfaces_mi_pc, seleccionados=self.interfaces_selec)
        nmap_params = self.get_parametros_seleccionador(
            lista=self.parametros_nmap,
            seleccionados=self.parametros_nmap_selec)
        nmap_params = ' '.join(nmap_params)
        procesos = []
        for inter in interfaces_params:
            procesos.append(
                mp.Process(target=Escaner, args=(inter, nmap_params)))
        for p in procesos:
            p.start()
        for p in procesos:
            p.join()
コード例 #3
0
ファイル: init.py プロジェクト: PARTH-UPADHYAYA/brainvita
from core.GameManager import GameManager

builtins.game_manager = GameManager()

from core.RenderManager import RenderManager

builtins.render_manager = RenderManager()

from core.MapManager import MapManager

builtins.map_manager = MapManager()

from core.Mouse import Mouse

builtins.mouse = Mouse()

from core.Menu import Menu

builtins.menu_manager = Menu()


class Difficulty(IntEnum):
    Normal, Hard, Hardcore = range(3)


builtins.Difficulty = Difficulty

builtins.FONT = pygame.font.Font('fonts/Vera-Bold.ttf', 25)
builtins.BLACK = (0, 0, 0)
builtins.RED = (255, 0, 0)
builtins.GREY = (200, 200, 200)
コード例 #4
0
from module.create_operation import operation
from module.msfvenom_create.msfvenom import msfvenom_payload_create
from module.webserver.SimpleServer import webserver

if __name__ == '__main__':

    if not os.path.exists('output/'):
        os.mkdir('output')

    if not os.path.exists('temp/'):
        os.mkdir('temp')

    #initialize
    exit_flag = False
    ui = UI()
    menu = Menu()
    #Menu initial
    while not exit_flag:
        ui.banner()
        menu_show = ui.showmenu(menu.options)
        choice = input('>>>')
        if choice in menu.allowinput:
            if choice == 'sc':
                mod = msfvenom_payload_create()
                os.system(
                    'msfvenom -p %s LHOST=%s LPORT=%s -f powershell > %stemp.ps1'
                    % (
                        mod.payload(),
                        mod.IP,
                        mod.port,
                        mod.outputpath(),
コード例 #5
0
def main():
    """
    Main process of the game.
    Execute all classes and manage event returned by pygame.
    """
    pygame.init()
    screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))

    sound = Sound()
    sound.generate_sound()

    # Menu
    menu = Menu()

    game = False
    config = True
    lvl_nbr = 1
    keys = KEYS_1
    skeys = KEYS_2

    while config:
        menu.update(screen, lvl_nbr)
        pygame.display.flip()

        for event in pygame.event.get():
            if event.type == QUIT:
                config = False
            if event.type == KEYDOWN and event.key == K_F1:
                config = False

            if event.type == MOUSEBUTTONDOWN and event.button == 1:
                # Play Button
                btn_return = menu.btn_clicked(event)
                if btn_return == 1:
                    game = True
                    config = False
                if btn_return == 2 and 1 <= lvl_nbr < LEVEL_NUMBER:
                    lvl_nbr += 1
                if btn_return == 3 and 1 < lvl_nbr <= LEVEL_NUMBER:
                    lvl_nbr -= 1

    # Level Initialization
    level = Level(lvl_nbr)
    player = Player(50, 100, 4)

    # Game
    while game:
        level.update_sprites(screen, player)

        for e in level.enemies:
            e.move(level)
            e.display(screen)

        pygame.display.flip()

        for event in pygame.event.get():
            if event.type == QUIT:
                game = False
            if event.type == KEYDOWN:
                if event.key == K_F1:
                    message_on_screen(screen)
                    game = False

            # PLayer movement event check
            if event.type == KEYDOWN:
                if event.key == keys[0]:
                    player.statement_keys[0] = True
                if event.key == keys[1]:
                    player.statement_keys[1] = True
                if event.key == keys[2]:
                    player.statement_keys[2] = True
                if event.key == keys[3]:
                    player.statement_keys[3] = True

            if event.type == KEYUP:
                if event.key == keys[0]:
                    player.statement_keys[0] = False
                if event.key == keys[1]:
                    player.statement_keys[1] = False
                if event.key == keys[2]:
                    player.statement_keys[2] = False
                if event.key == keys[3]:
                    player.statement_keys[3] = False

            if event.type == KEYDOWN:
                if event.key == skeys[0]:
                    tmp = Bullet(player, 2, UP)
                    level.bullets.append(tmp)
                if event.key == skeys[1]:
                    tmp = Bullet(player, 2, LEFT)
                    level.bullets.append(tmp)
                if event.key == skeys[2]:
                    tmp = Bullet(player, 2, DOWN)
                    level.bullets.append(tmp)
                if event.key == skeys[3]:
                    tmp = Bullet(player, 2, RIGHT)
                    level.bullets.append(tmp)

        if player.statement_keys != [False] * 4:
            player.move(level)

    pygame.quit()