Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
eedb8d7
poc fastapi
thorinaboenke May 2, 2025
761d571
create routers, create global state with DI
thorinaboenke May 2, 2025
9969303
isort
thorinaboenke May 2, 2025
86993e6
add readme
thorinaboenke May 2, 2025
7f5f250
add fastapi to dependencies
thorinaboenke May 5, 2025
5dc058c
use only one persistent instance
thorinaboenke May 5, 2025
e699992
give transient instances a uuid and return in response
thorinaboenke May 5, 2025
f1ff0ff
add examples to readme
thorinaboenke May 5, 2025
8d3b804
add instance logging with debug parameter
thorinaboenke May 5, 2025
f796692
return logfile content on playbook execution
thorinaboenke May 5, 2025
678f131
create hash utility
thorinaboenke May 6, 2025
8ea042c
new response schemas
thorinaboenke May 6, 2025
41109ec
authentication with Token
thorinaboenke May 6, 2025
0213abf
Merge branch 'development' into poc_fastapi
thorinaboenke May 6, 2025
19f0745
fastapi dependency!
thorinaboenke May 6, 2025
70ce073
Merge branch 'poc_fastapi' of github.com:thorinaboenke/attackmate int…
thorinaboenke May 6, 2025
5fab494
self signed ssl keys
thorinaboenke May 7, 2025
a778ff3
generate hash utility
thorinaboenke May 7, 2025
3318f6a
initial remote command and executor
thorinaboenke May 7, 2025
87ef8da
Add C1 and C2 architecture diagrams
annaerdi May 7, 2025
38a431c
Update list of unsupported background-mode commands
annaerdi May 7, 2025
eb30916
Merge pull request #168 from annaerdi/docs
whotwagner May 7, 2025
b59fa4f
Allow any values for data field in HttpClientCommand
annaerdi May 8, 2025
c4317e1
Merge pull request #169 from annaerdi/development
whotwagner May 8, 2025
44fb3c3
add loop command and type alias to remote command schema
thorinaboenke May 13, 2025
352b9f4
structure for remote command and executor
thorinaboenke May 13, 2025
c9ed739
initial remote client class
thorinaboenke May 13, 2025
614c111
use argon2
thorinaboenke May 19, 2025
11f6095
handle json logging of remote_command
thorinaboenke May 19, 2025
11cf68c
fix types
thorinaboenke May 22, 2025
c0de458
add command_delay to config
thorinaboenke May 22, 2025
d323b07
Merge pull request #171 from thorinaboenke/feature_delay
thorinaboenke May 23, 2025
bb7b167
test command delay
thorinaboenke Jun 26, 2025
d37b8e2
json logger tests
thorinaboenke Jun 26, 2025
7499286
json logger tests
thorinaboenke Jun 26, 2025
c67e943
small fixes
thorinaboenke Jun 26, 2025
422a910
Merge pull request #172 from thorinaboenke/test_command_delay
whotwagner Jun 26, 2025
a38426b
Merge remote-tracking branch 'origin/development' into poc_fastapi
thorinaboenke Jul 15, 2025
83fee89
add json to remote logging
thorinaboenke Jul 15, 2025
d14a3e1
add json to remote logging
thorinaboenke Jul 15, 2025
b95a520
avoid duplicating stream handler
thorinaboenke Jul 15, 2025
0037313
move api logging setup out of mein
thorinaboenke Jul 17, 2025
5269124
add dependencies
thorinaboenke Jul 17, 2025
8c3b196
single endpoint for commands
thorinaboenke Jul 17, 2025
0c305f0
improve logging setup
thorinaboenke Jul 19, 2025
51c48f4
use global variable for log file name
thorinaboenke Jul 21, 2025
9cd2297
remove single command endpoints
thorinaboenke Jul 21, 2025
bf4b0b1
refactor command schema imports
thorinaboenke Jul 21, 2025
4cd8529
refactor remote executor
thorinaboenke Jul 23, 2025
82ac2f8
variable naming
thorinaboenke Aug 1, 2025
430205f
remove comment
thorinaboenke Aug 1, 2025
75a7d65
Use local inline HTML for the browser-tests
annaerdi Aug 14, 2025
aeb0114
Merge pull request #167 from thorinaboenke/poc_fastapi
whotwagner Aug 14, 2025
3251062
json und metadata logging for background commands
thorinaboenke Oct 28, 2025
4cf3e26
json und metadata logging for background commands
thorinaboenke Oct 28, 2025
1df1ef5
Merge pull request #178 from thorinaboenke/177_fix_background_command…
whotwagner Oct 28, 2025
090fe58
improve errors for playbook parsing
thorinaboenke Oct 29, 2025
27434dd
Merge pull request #179 from thorinaboenke/154_fix_playbook_parsing_e…
whotwagner Oct 29, 2025
150cfbc
Fixed an issue with numeric metasploit-options
whotwagner Nov 26, 2025
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
16 changes: 16 additions & 0 deletions create_hashes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from passlib.context import CryptContext

pwd_context = CryptContext(schemes=['argon2'], deprecated='auto')


users = {
'testuser': 'testuser',
}

env_content = ''
print('\nCopy the following lines into your .env file:\n')
for username, plain_password in users.items():
hashed_password = pwd_context.hash(plain_password)
env_line = f"USER_{username.upper()}_HASH=\"{hashed_password}\""
print(env_line)
env_content += env_line + '\n'
12 changes: 11 additions & 1 deletion docs/source/configuration/command_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
cmd_config
==========

Stores global variables for command options. These are settings for **all** commands.
Stores global variables for command options.
These are settings for **all** commands.

.. code-block:: yaml

###
cmd_config:
loop_sleep: 5
command_delay: 0

.. confval:: loop_sleep

Expand All @@ -19,3 +21,11 @@ Stores global variables for command options. These are settings for **all** comm

:type: int
:default: 5

.. confval:: command_delay

This delay in seconds is applied to all commands in the playbook.
It is not applied to debug, setvar and sleep commands.

:type: float
:default: 0
1 change: 1 addition & 0 deletions docs/source/configuration/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sliver and metasploit:
###
cmd_config:
loop_sleep: 5
command_delay: 0

msf_config:
password: securepassword
Expand Down
35 changes: 35 additions & 0 deletions docs/source/developing/architecture.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
=======================
System Architecture (C4)
=======================

This section presents the architecture of AttackMate using the
`C4 model <https://c4model.com>`_, a visual framework for describing software architecture across different levels of detail.

C1 – System Context Diagram
---------------------------

.. image:: ../images/AttackMate-C1.png
:width: 80%
:alt: System Context Diagram

The System Context diagram shows how **AttackMate** fits into its environment. It illustrates the main user
(e.g., a pentester or researcher), the software systems it interacts with (e.g., vulnerable target systems, external
frameworks like Metasploit or Sliver), and the nature of those interactions.


C2 – Container Diagram
----------------------

This diagram shows how AttackMate is internally structured as a modular Python application.

.. image:: ../images/AttackMate-C2.png
:alt: Container Diagram

The system is centered around a core orchestration class that receives parsed playbook commands and delegates their
execution to appropriate components. It separates concerns between parsing, background task management, session handling,
and command execution, which makes it easy to extend with new command types or external tool integrations.

Future diagrams (e.g., C3 or C4) could describe class-level and code-level structures if needed.

.. note::
The official C4 model site (https://c4model.com) provides detailed guidance if you're unfamiliar with this approach.
22 changes: 13 additions & 9 deletions docs/source/developing/baseexecutor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Adding a New Executor
Base Executor
================

The ``BaseExecutor`` is the core class from which all executors in AttackMate inherit.
The ``BaseExecutor`` is the core class from which all executors in AttackMate inherit.
It provides a structured approach to implementing custom executors.

Key Features
Expand Down Expand Up @@ -64,8 +64,8 @@ Overridable Methods

The following methods can be overridden in custom executors to modify behavior:

**Command Execution**
**Command Execution**

.. code-block:: python

def _exec_cmd(self, command: BaseCommand) -> Result:
Expand All @@ -74,24 +74,28 @@ The following methods can be overridden in custom executors to modify behavior:
This is the core execution function and must be implemented in subclasses.
It should return a ``Result`` object containing the execution outcome.

.. note::
.. note::

The ``_exec_cmd()`` method **must** be implemented in any subclass of ``BaseExecutor``.
This method defines the core execution logic for the command and is responsible for returning a ``Result`` object.
The ``_exec_cmd()`` method **must** be implemented in any subclass of ``BaseExecutor``.
This method defines the core execution logic for the command and is responsible for returning a ``Result`` object.


**Logging Functions**
**Logging Functions**

The methods ``log_command``, ``log_matadata`` and ``log_json`` log command execution details and can be overridden for custom logging formats.

**Command Execution Flow**
**Command Execution Flow**

The ``run()`` method defines the high-level execution flow of a command.
It includes condition checking, logging, and calling the actual execution logic.

**Output Handling**
**Output Handling**

The ``save_output()`` function manages saving output to a file. It can be overridden to implement alternative storage methods.


executor __init__.py
--------------------
.. note::

Add the new executor to the ``__all__`` list in the ``__init__.py`` file of the ``attackmate.executors`` module.
Binary file added docs/source/images/AttackMate-C1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/AttackMate-C2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading