Ejemplo n.º 1
0
            ufwctrl.disable()
        avalon.info('RESETED')
        log.write('RESETED\n')
    elif args.purgelog:
        # Deletes the log file of scutum
        # TODO: delete rotated logs too
        os.system('rm {}'.format(LOGPATH))
        avalon.info('LOG PURGED')
    elif args.enable or args.disable:
        if args.enable:
            # Enable scutum will write scrips for wicd and network-manager
            # scutum will be started automatically
            if "wicd" in network_controllers.split(","):
                installer.install_wicd_scripts()
            if "NetworkManager" in network_controllers.split(","):
                installer.install_nm_scripts(
                    config["NetworkControllers"]["controllers"].split(","))
            ifaceobjs = []  # a list to store internet controller objects
            os.system(
                'arptables -P INPUT ACCEPT')  # Accept to get Gateway Cached

            update_arptables(log)

            if ufw_handled is True:
                # if ufw is handled by scutum, enable it
                ufwctrl = Ufw(log=log)
                ufwctrl.enable()
            avalon.info('ENABLED')
            log.write('ENABLED\n')
        elif args.disable:
            # This will disable scutum entirely and ufw too if it
            # is handled by scutum. scutum will not be started automatically
Ejemplo n.º 2
0
    elif args.reset:
        # resets the arptable, ufw and accept all incoming connections
        # This will expose the computer entirely on the network
        ac.flush_all()
        if ufw_handled is True:
            ufwctrl.disable()
        Avalon.info('RESETED')

    # If '--enable'
    elif args.enable:
        # Enable scutum will write scrips for wicd and network-manager
        # scutum will be started automatically
        if 'wicd' in network_controllers:
            installer.install_wicd_scripts()
        if 'NetworkManager' in network_controllers:
            installer.install_nm_scripts(network_controllers)

        # Lock gateway MAC on current networks
        interface_objects = []
        update_arp()

        if ufw_handled:
            ufwctrl.enable()
        Avalon.info('ENABLED')

    # If '--disable'
    elif args.disable:
        # This will disable scutum entirely and ufw too if it
        # is handled by scutum. scutum will not be started automatically
        # Firewalls will be reseted and expose the computer completely
        installer.remove_nm_scripts()