-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
94 additions
and
97 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
import questionary | ||
from .docker_manager import pull_image, create_project_dir, run_container | ||
|
||
|
||
def main(): | ||
client = docker.from_env() | ||
|
||
action = questionary.select( | ||
"What would you like to do?", | ||
choices=[ | ||
"Pull Image", "Create Project", "Run Container", "Stop Container", | ||
"Destroy Container", "Exit" | ||
] | ||
).ask() | ||
|
||
if action == "Pull Image": | ||
image_choice = questionary.select( | ||
"Select the image to pull:", | ||
choices=list(IMAGE_TAGS.values()) | ||
).ask() | ||
pull_image(client, image_choice) | ||
|
||
elif action == "Create Project": | ||
project_name = questionary.text("Enter project name:").ask() | ||
create_project_dir(project_name) | ||
|
||
elif action == "Run Container": | ||
image_choice = questionary.select( | ||
"Select image to run:", choices=list(IMAGE_TAGS.values())).ask() | ||
project_dir = questionary.text("Enter project directory:").ask() | ||
host_network = questionary.confirm("Enable host networking?").ask() | ||
run_container(client, image_choice, project_dir, host_network) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
IMAGE_TAGS = { | ||
'dev': 'fonalex45/aegis:dev', | ||
'latest': 'dfonalex45/aegis:latest', | ||
} | ||
|
||
DEFAULT_DIRECTORIES = ['recon', 'exploit', 'www', 'privesc', 'report', 'loot'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import docker | ||
import os | ||
from tqdm import tqdm | ||
|
||
|
||
def pull_image(client, image_tag): | ||
print(f"Pulling image: {image_tag}") | ||
for line in client.api.pull(image_tag, stream=True, decode=True): | ||
if 'status' in line: | ||
print(line['status']) | ||
|
||
|
||
def create_project_dir(project_name): | ||
os.makedirs(project_name, exist_ok=True) | ||
for folder in DEFAULT_DIRECTORIES: | ||
os.makedirs(os.path.join(project_name, folder), exist_ok=True) | ||
print(f"Project directories created under {project_name}.") | ||
|
||
|
||
def run_container(client, image, project_dir, host_network): | ||
container = client.containers.run( | ||
image, | ||
command='/bin/zsh', | ||
volumes={os.path.abspath(project_dir): { | ||
'bind': '/workspace', 'mode': 'rw'}}, | ||
network_mode='host' if host_network else None, | ||
detach=True, | ||
stdin_open=True, | ||
tty=True | ||
) | ||
print(f"Container {container.short_id} started.") | ||
return container |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
from setuptools import setup, find_packages | ||
|
||
setup( | ||
name='aegis', | ||
version='0.1.0', | ||
packages=find_packages(), | ||
install_requires=[ | ||
'docker==7.1.0', | ||
'questionary==2.0.1', | ||
'pycryptodome==3.21.0', | ||
'fabric==3.2.2', | ||
], | ||
entry_points={ | ||
'console_scripts': [ | ||
'aegis = aegis.cli:main', | ||
], | ||
}, | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.