def openExistingProject(self, projectName: str, projectType: str = "legion") -> Project: self.logger.info(f"Opening existing project: {projectName}...") database = self.__createDatabase(projectName) workingDirectory = f"{ntpath.dirname(projectName)}/" outputFolder, _ = self.__determineOutputFolder(projectName, projectType) runningFolder = self.shell.create_temporary_directory( suffix="-running", prefix=projectType + '-', directory="./tmp/") (usernameWordList, passwordWordList ) = self.__createUsernameAndPasswordWordLists(outputFolder) projectProperties = ProjectProperties( projectName=projectName, workingDirectory=workingDirectory, projectType=projectType, isTemporary=False, outputFolder=outputFolder, runningFolder=runningFolder, usernamesWordList=usernameWordList, passwordWordList=passwordWordList, storeWordListsOnExit=True) repositoryContainer = self.repositoryFactory.buildRepositories( database) return Project(projectProperties, repositoryContainer, database)
def show(self, view: View, request: Request): project = Project.find(request.param('id')) return view.render('projects', { 'name': 'Joe', 'project': project, })
def index(self, view: View): projects = Project.all() return view.render('projects', { 'name': 'Joe', 'projects': projects, })
def setStoreWordListsOnExit(project: Project, storeWordListsOnExit: bool) -> None: projectProperties = ProjectProperties( projectName=project.properties.projectName, workingDirectory=project.properties.workingDirectory, projectType=project.properties.projectType, isTemporary=project.properties.isTemporary, outputFolder=project.properties.outputFolder, runningFolder=project.properties.runningFolder, usernamesWordList=project.properties.usernamesWordList, passwordWordList=project.properties.passwordWordList, storeWordListsOnExit=storeWordListsOnExit) project.properties = projectProperties
def createNewProject(self, projectType: str, isTemp: bool) -> Project: database = self.__createDatabase() workingDirectory = self.shell.get_current_working_directory() # to store tool output of finished processes outputFolder = self.shell.create_temporary_directory( prefix="legion-", suffix="-tool-output", directory="./tmp/") # to store tool output of running processes runningFolder = self.shell.create_temporary_directory( prefix="legion-", suffix="-running", directory="./tmp/") self.shell.create_directory_recursively( f"{outputFolder}/screenshots") # to store screenshots self.shell.create_directory_recursively( getNmapRunningFolder(runningFolder)) # to store nmap output self.shell.create_directory_recursively( f"{runningFolder}/hydra") # to store hydra output self.shell.create_directory_recursively( f"{runningFolder}/dnsmap") # to store dnsmap output (usernameWordList, passwordWordList ) = self.__createUsernameAndPasswordWordLists(outputFolder) repositoryContainer = self.repositoryFactory.buildRepositories( database) projectName = database.name projectProperties = ProjectProperties(projectName, workingDirectory, projectType, isTemp, outputFolder, runningFolder, usernameWordList, passwordWordList, storeWordListsOnExit=True) return Project(projectProperties, repositoryContainer, database)
* Copy /app/config.example.txt to /app/config.txt and make changes as necessary * Copy /app/users.example.json to /app/users.json and make changes as necessary * Add any additional files you want to use to /app * Feel free to install additional drivers using pip and loading them via project.py """ # Importing app State model to setup initial pathing from apitaxcore.models.State import State # Setting up default paths - Assumes docker container State.paths['root'] = '/app' # just /app for docker State.paths['config'] = State.paths['root'] + '/app/config.txt' # Sets up project and runs setup to alter any paths as necessary from app.Project import Project project = Project() project.setup() # Running Setup to initialize a bunch of models before running from apitax.flow.Setup import Setup args = [] if project.isDebug(): args.append('--debug') setup = Setup(passedArgs=args) # Preparing Drivers from apitaxcore.drivers.Drivers import Drivers from apitaxcore.flow.LoadedDrivers import LoadedDrivers # Importing core drivers from commandtax.drivers.builtin.Commandtax import Commandtax