Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.5.0 - Burpsuite and Firefox make their return, improved GUI app support #24

Merged
merged 46 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1fdb746
testing latest linpeas download
alexrf45 Nov 30, 2024
1905ee6
miniserve latest release
alexrf45 Nov 30, 2024
3686017
initial package
alexrf45 Nov 30, 2024
bc1ee68
rework
alexrf45 Nov 30, 2024
36a255a
another one
alexrf45 Nov 30, 2024
29cf5a0
new
alexrf45 Nov 30, 2024
d08c25e
okay
alexrf45 Nov 30, 2024
98f6d6b
okay
alexrf45 Nov 30, 2024
b8d74a5
added stop and destroy
alexrf45 Dec 1, 2024
01ba374
more
alexrf45 Dec 1, 2024
d6d874d
try chatgpt again
alexrf45 Dec 1, 2024
585812c
testing different progress bar
alexrf45 Dec 1, 2024
9fa8f81
removed keyword argument in docker_handler.py
alexrf45 Dec 1, 2024
bf94d0d
whoops
alexrf45 Dec 1, 2024
623b43e
progress bar testing
alexrf45 Dec 1, 2024
778f572
progress bar error
alexrf45 Dec 1, 2024
7a926d9
GB display
alexrf45 Dec 1, 2024
860afd8
okay
alexrf45 Dec 1, 2024
baf03eb
more
alexrf45 Dec 1, 2024
ae07ab7
okay
alexrf45 Dec 1, 2024
3a7d234
ugh
alexrf45 Dec 1, 2024
fed60f2
testing args
alexrf45 Dec 1, 2024
e3251b6
namespace attribute error
alexrf45 Dec 1, 2024
493853e
one more time
alexrf45 Dec 1, 2024
757fce4
another one
alexrf45 Dec 1, 2024
cdd556a
i'm learning
alexrf45 Dec 1, 2024
a3531d3
okay
alexrf45 Dec 1, 2024
39ea0ba
okay again
alexrf45 Dec 1, 2024
82b3743
more
alexrf45 Dec 1, 2024
6a2ee2a
okayyy
alexrf45 Dec 1, 2024
645b7d7
more
alexrf45 Dec 1, 2024
d29ba2f
comma after image ask
alexrf45 Dec 1, 2024
3f950e4
return project_name
alexrf45 Dec 1, 2024
e077b39
hmmm
alexrf45 Dec 1, 2024
7dbba3d
logging
alexrf45 Dec 1, 2024
2ba486d
weird
alexrf45 Dec 1, 2024
6e5dd8a
one more
alexrf45 Dec 1, 2024
9bcf09e
two more
alexrf45 Dec 1, 2024
83d6d18
entrypoint
alexrf45 Dec 1, 2024
cfe82e6
crazy
alexrf45 Dec 1, 2024
c084151
attach
alexrf45 Dec 1, 2024
93d813d
shell wont launch, script is stuck
alexrf45 Dec 1, 2024
da4eed7
maybe
alexrf45 Dec 1, 2024
bef6a9f
back to oh my zsh theme
alexrf45 Dec 3, 2024
798dcb5
v1.5.0
alexrf45 Dec 4, 2024
1a9f2e3
reworked to ensure gui apps work:q
alexrf45 Dec 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 163 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,164 @@
project.yaml
*testing/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM kalilinux/kali-rolling:latest

LABEL "project"="aegis"
LABEL "author"="fr3d"
LABEL "version"="v1.4.2"
LABEL "version"="v1.5.0"

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ="America/New_York"
Expand Down
57 changes: 57 additions & 0 deletions aegis-wrapper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

# Aegis: Docker Wrapper TUI

Aegis is a Python-based command-line tool (TUI) for managing Docker containers with an interactive interface. It helps in pulling images, creating project directories, and running containers with ease.

## Features
- Pull and manage Docker images.
- Start, stop, and destroy containers with options for host networking and GUI support.
- Create project directories with default subfolders (`recon`, `exploit`, `www`, `privesc`, `report`, `loot`).
- Interactive menu using `questionary` and progress bars with `rich`.
- Supports running containers with a `zsh` entrypoint.

## Installation

You can install `aegis` via `pip`:

```bash
pip install aegis
```

# Usage

Run the aegis command with one of the following options:

```bash
Copy code
aegis <command> [options]
```

# Commands
- pull: Pull a Docker image.
- start: Start a container with options for host networking and GUI.
- stop: Stop a running container.
- destroy: Remove a stopped container.

# Options

--image: Specify the Docker image (default: fonalex45/aegis:dev).
--host-network: Enable host networking.
--gui: Enable GUI support.

# Example


```bash

aegis pull
aegis start --image fonalex45/aegis:dev --host-network --gui
aegis stop
aegis destroy
```

# Configuration
Default images and settings can be found in config.py.

# Contributing
Feel free to submit issues or pull requests to improve the project!
Empty file added aegis-wrapper/aegis/__init__.py
Empty file.
76 changes: 76 additions & 0 deletions aegis-wrapper/aegis/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import argparse
import questionary
from aegis.docker_handler import DockerHandler
from aegis.project_manager import ProjectManager
from aegis.utils import validate_project_name, log_error
from rich.console import Console


def main():
parser = argparse.ArgumentParser(description="Aegis Docker Wrapper TUI")
parser.add_argument('command', choices=['start', 'stop', 'destroy', 'pull'],
help="Action to perform")
# parser.add_argument('-n', '--name', help="project/container name")
parser.add_argument('--host-network', action='store_true',
help="Enable host networking")
parser.add_argument('--gui', action='store_true',
help="Enable GUI support")
args = parser.parse_args()

docker_handler = DockerHandler()
project_manager = ProjectManager()

if args.command == 'pull':
image_name = questionary.select(
"Select an image to pull",
choices=['fonalex45/aegis:dev',
'fonalex45/aegis:latest', 'Custom']
).ask()
if image_name == 'Custom':
image_name = questionary.text("Enter the custom image name").ask()
docker_handler.pull_image(image_name)

elif args.command == 'start':
project_name = questionary.text("Enter project name").ask()
image_name = questionary.select("Select an image to use",
choices=['fonalex45/aegis:dev',
'fonalex45/aegis:latest',
'Custom']
).ask()
if image_name == 'Custom':
image_name = questionary.text("Enter the custom image name").ask()
try:
validated_name = validate_project_name(project_name)
project_dir = project_manager.create_project(validated_name)
docker_handler.start_container(
image_name=image_name,
project_name=validated_name,
# name=args.name or validated_name,
project_dir=project_dir,
host_network=args.host_network,
gui=args.gui
)
except ValueError as e:
log_error(str(e))
return docker_handler.start_container()
elif args.command == 'stop':
project_name = questionary.text(
"Enter project name to stop container").ask()
try:
validated_name = validate_project_name(project_name)
docker_handler.stop_container_by_name(validated_name)
except ValueError as e:
log_error(str(e))

elif args.command == 'destroy':
project_name = questionary.text(
"Enter project name to destroy container").ask()
try:
validated_name = validate_project_name(project_name)
docker_handler.remove_container_by_name(validated_name)
except ValueError as e:
log_error(str(e))


if __name__ == "__main__":
main()
17 changes: 17 additions & 0 deletions aegis-wrapper/aegis/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# Default Docker images
DEFAULT_IMAGES = {
"dev": "fonalex45/aegis:dev",
"latest": "fonalex45/aegis:latest"
}

# Default project subfolders
PROJECT_SUBFOLDERS = ['recon', 'exploit', 'www', 'privesc', 'report', 'loot']

# Docker configuration
DOCKER_ENTRYPOINT = "zsh"

# GUI-related environment variables
GUI_ENV_VARS = {
"DISPLAY": ":0"
}
Loading
Loading