Skip to content

Commit 9575b7f

Browse files
committed
restructure documentation a bit
1 parent 88f5e14 commit 9575b7f

File tree

7 files changed

+92
-87
lines changed

7 files changed

+92
-87
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: Executables
3+
nextjs:
4+
metadata:
5+
title: Executables
6+
description: 'HackingBuddyGPT: how to execute?'
7+
---
8+
9+
When it comes to executables, the most important tool is `wintermute.py`. This python program identifies all implemented use-cases/agents and their respective configuration options, and allows end-users to configure and start an use-case/agent.
10+
11+
The following `wintermute` output lists all currently available use-cases (`linux_privesc_hintfile`, `linux_privesc_guided`, `linux_privesc`, `windows_privesc`, `minimal_linux_privesc`, `simple_web_test`):
12+
13+
```bash
14+
$ python wintermute.py
15+
usage: wintermute.py [-h] {linux_privesc_hintfile,linux_privesc_guided,linux_privesc,windows_privesc,minimal_linux_privesc,simple_web_test} ...
16+
wintermute.py: error: the following arguments are required: {linux_privesc_hintfile,linux_privesc_guided,linux_privesc,windows_privesc,minimal_linux_privesc,simple_web_test}
17+
```
18+
19+
When called with a concrete use-case and the `--help` option, all available configuration options for the given use-case are shown:
20+
21+
```bash
22+
$python wintermute.py linux_privesc_hintfile --help
23+
usage: wintermute.py linux_privesc_hintfile [-h] [--conn.host CONN.HOST] [--conn.hostname CONN.HOSTNAME] [--conn.username CONN.USERNAME] [--conn.password CONN.PASSWORD]
24+
[--conn.port CONN.PORT] [--system SYSTEM] [--enable_explanation ENABLE_EXPLANATION] [--enable_update_state ENABLE_UPDATE_STATE]
25+
[--disable_history DISABLE_HISTORY] [--hints HINTS] [--log_db.connection_string LOG_DB.CONNECTION_STRING] [--llm.api_key LLM.API_KEY]
26+
[--llm.model LLM.MODEL] [--llm.context_size LLM.CONTEXT_SIZE] [--llm.api_url LLM.API_URL] [--llm.api_timeout LLM.API_TIMEOUT]
27+
[--llm.api_backoff LLM.API_BACKOFF] [--llm.api_retries LLM.API_RETRIES] [--tag TAG] [--max_turns MAX_TURNS]
28+
29+
options:
30+
-h, --help show this help message and exit
31+
--conn.host CONN.HOST
32+
--conn.hostname CONN.HOSTNAME
33+
--conn.username CONN.USERNAME
34+
--conn.password CONN.PASSWORD
35+
--conn.port CONN.PORT
36+
--system SYSTEM
37+
--enable_explanation ENABLE_EXPLANATION
38+
--enable_update_state ENABLE_UPDATE_STATE
39+
--disable_history DISABLE_HISTORY
40+
--hints HINTS
41+
--log_db.connection_string LOG_DB.CONNECTION_STRING
42+
sqlite3 database connection string for logs
43+
--llm.api_key LLM.API_KEY
44+
OpenAI API Key
45+
--llm.model LLM.MODEL
46+
OpenAI model name
47+
--llm.context_size LLM.CONTEXT_SIZE
48+
Maximum context size for the model, only used internally for things like trimming to the context size
49+
--llm.api_url LLM.API_URL
50+
URL of the OpenAI API
51+
--llm.api_timeout LLM.API_TIMEOUT
52+
Timeout for the API request
53+
--llm.api_backoff LLM.API_BACKOFF
54+
Backoff time in seconds when running into rate-limits
55+
--llm.api_retries LLM.API_RETRIES
56+
Number of retries when running into rate-limits
57+
--tag TAG
58+
--max_turns MAX_TURNS
59+
```
60+
61+
Finally you can execute a use-case by calling it through `wintermute.py`. Configuration for the use-case will be initially be populated from an `.env` file. If any command line arguments are given, these over-write configuration options read form configuration files.
62+
63+
We provide scripts for later analysis of use-cases/agent runs, e.g., `stats.py` and `viewer.py`, but we will extend and move them into a dedicated analysis-scripts directory soon.

‎src/app/docs/core-concepts/project-layout/page.md‎

Lines changed: 17 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,35 @@ title: Project Layout
33
nextjs:
44
metadata:
55
title: Project Layout
6-
description: On this page we'll give you a high-level overview of our project's structure.
6+
description: 'HackingBuddyGPT: High-Level Overview'
77
---
88

9-
hackingBuddyGPT uses a simple project structure to make onboarding of new developers easier.
9+
After you checked out the project's source [from github](https://github.com/ipa-lab/hackingBuddyGPT) you might wonder where all the juicy bits are.
1010

11-
## Source Code and Components
11+
Let's do a quick overview before we delve deeper into our components.
1212

13-
The project's source code is roughly structured into three directories:
13+
Broadly speaking, we have separated our code base into three concerns:
1414

15-
- `usecases`: use-case (often also named agents) describe one pen-testing strategy. For example, you might want to write an use-case for hacking a linux system, or write an use-case to hack a web-site. Typically you call an use-case through our command line tool (`wintermute.py`) and pass the target information, e.g., the to be tested website, also through command line parameters.
15+
1. The Hacking 'Use-Cases' which are python classes describing how our hacking automatons should work.
16+
2. Capabilities (or in simpler terms, 'actions') that describe how our hacking automatons can interact with the outside world.
17+
3. Helpers in 'utils' that are reused between the different hacking use-cases, e.g., output or database helpers.
1618

17-
- `capabilities`: use-case/agents needs to interact with the real world (otherwise hacking would be a bit boring) and they do this through capabilities. We intend for capabilities to be shared between multiple use-cases so that new use-cases can be developed rapidly. Examples for capabilities are executing a system command over SSH, test for credentials, or executing a HTTP request.
19+
## Source Code and Components
1820

19-
- `utils`: this project area includes helper infrastructure for operating the use-cases/agents. For example, this section includes a general OpenAI connector that abstracts away most of the tedious bits of creating a connection to an LLM API.
21+
Our project structure roughly mirrors the just mentioned three concerns:
2022

21-
## Executable files
23+
- [`usecases/`](/docs/core-concepts/use-cases): within this directory are all out implemented 'use-cases' (or hacking automatons). We use subdirectories for additional structure, e.g., all local privilege escalation automatons are located in `usecases/privesc/`.
2224

23-
When it comes to executables, the most important tool is `wintermute.py`. This python program identifies all implemented use-cases/agents and their respective configuration options, and allows end-users to configure and start an use-case/agent.
25+
To prevent code-duplication we provide additional base-classes such as `Agent` which implement use-cases that contain capabilities (see next section) as well as a maximum round limit (so that the automaton will not run forever and thus use up lots of credits).
2426

25-
The following output shows how `wintermute.py` lists all available use-cases (`linux_privesc_hintfile`, `linux_privesc_guided`, `linux_privesc`, `windows_privesc`, `minimal_linux_privesc`, `simple_web_test`) when called without parameters:
27+
Once you implement a custom use-case, you can configure and start it through [wintermute.py](/docs/core-concepts/executables).
2628

27-
```bash
28-
$ python wintermute.py
29-
usage: wintermute.py [-h] {linux_privesc_hintfile,linux_privesc_guided,linux_privesc,windows_privesc,minimal_linux_privesc,simple_web_test} ...
30-
wintermute.py: error: the following arguments are required: {linux_privesc_hintfile,linux_privesc_guided,linux_privesc,windows_privesc,minimal_linux_privesc,simple_web_test}
31-
```
29+
- [`capabilities/`](/docs/core-concepts/capabilities): our automatons need to interact with the real world (otherwise hacking would be a bit boring) and they do this through capabilities.
3230

33-
When called with a concrete use-case and passed the `--help` option, all available configuration options for the given use-case are shown:
31+
Examples for capabilities are executing a system command over SSH, test for credentials, or executing a HTTP request.
3432

35-
```bash
36-
$python wintermute.py linux_privesc_hintfile --help
37-
usage: wintermute.py linux_privesc_hintfile [-h] [--conn.host CONN.HOST] [--conn.hostname CONN.HOSTNAME] [--conn.username CONN.USERNAME] [--conn.password CONN.PASSWORD]
38-
[--conn.port CONN.PORT] [--system SYSTEM] [--enable_explanation ENABLE_EXPLANATION] [--enable_update_state ENABLE_UPDATE_STATE]
39-
[--disable_history DISABLE_HISTORY] [--hints HINTS] [--log_db.connection_string LOG_DB.CONNECTION_STRING] [--llm.api_key LLM.API_KEY]
40-
[--llm.model LLM.MODEL] [--llm.context_size LLM.CONTEXT_SIZE] [--llm.api_url LLM.API_URL] [--llm.api_timeout LLM.API_TIMEOUT]
41-
[--llm.api_backoff LLM.API_BACKOFF] [--llm.api_retries LLM.API_RETRIES] [--tag TAG] [--max_turns MAX_TURNS]
33+
To prevent code duplications capabilities can easily be shared between multiple usecases.
4234

43-
options:
44-
-h, --help show this help message and exit
45-
--conn.host CONN.HOST
46-
--conn.hostname CONN.HOSTNAME
47-
--conn.username CONN.USERNAME
48-
--conn.password CONN.PASSWORD
49-
--conn.port CONN.PORT
50-
--system SYSTEM
51-
--enable_explanation ENABLE_EXPLANATION
52-
--enable_update_state ENABLE_UPDATE_STATE
53-
--disable_history DISABLE_HISTORY
54-
--hints HINTS
55-
--log_db.connection_string LOG_DB.CONNECTION_STRING
56-
sqlite3 database connection string for logs
57-
--llm.api_key LLM.API_KEY
58-
OpenAI API Key
59-
--llm.model LLM.MODEL
60-
OpenAI model name
61-
--llm.context_size LLM.CONTEXT_SIZE
62-
Maximum context size for the model, only used internally for things like trimming to the context size
63-
--llm.api_url LLM.API_URL
64-
URL of the OpenAI API
65-
--llm.api_timeout LLM.API_TIMEOUT
66-
Timeout for the API request
67-
--llm.api_backoff LLM.API_BACKOFF
68-
Backoff time in seconds when running into rate-limits
69-
--llm.api_retries LLM.API_RETRIES
70-
Number of retries when running into rate-limits
71-
--tag TAG
72-
--max_turns MAX_TURNS
73-
```
35+
- `utils/`: this area includes helper infrastructure that are re-used for all automatons and use-cases. For example, this section includes a general OpenAI connector that abstracts away most of the tedious bits of creating a connection to an LLM API.
7436

75-
We provide scripts for later analysis of use-cases/agent runs, e.g., `stats.py` and `viewer.py`, but we will extend and move them into a dedicated analysis-scripts directory soon.
37+
To highlight the difference between 'utils' and 'capabilities': capabilities are actions that can be called from LLMs, while utils include common functionality that is often used from within the different use-cases' source code.

‎src/app/docs/core-concepts/python-infrastructure/page.md‎

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,13 @@ title: Python Infrastructure and used Technology
33
nextjs:
44
metadata:
55
title: Python Infrastructure and used Technology
6-
description: Quidem magni aut exercitationem maxime rerum eos.
6+
description: 'HackingBuddyGPT: What technology are we depending upon?'
77
---
88

99
We try to base our software on modern python libraries and techniques and want to highlight some of those here.
1010

11-
## Quis vel iste dicta
11+
Things you will encounter within our source code:
1212

13-
Sit commodi iste iure molestias qui amet voluptatem sed quaerat. Nostrum aut pariatur. Sint ipsa praesentium dolor error cumque velit tenetur.
14-
15-
### Et pariatur ab quas
16-
17-
Sit commodi iste iure molestias qui amet voluptatem sed quaerat. Nostrum aut pariatur. Sint ipsa praesentium dolor error cumque velit tenetur quaerat exercitationem. Consequatur et cum atque mollitia qui quia necessitatibus.
18-
19-
```js
20-
/** @type {import('@tailwindlabs/lorem').ipsum} */
21-
export default {
22-
lorem: 'ipsum',
23-
dolor: ['sit', 'amet', 'consectetur'],
24-
adipiscing: {
25-
elit: true,
26-
},
27-
}
28-
```
29-
30-
Possimus saepe veritatis sint nobis et quam eos. Architecto consequatur odit perferendis fuga eveniet possimus rerum cumque. Ea deleniti voluptatum deserunt voluptatibus ut non iste. Provident nam asperiores vel laboriosam omnis ducimus enim nesciunt quaerat. Minus tempora cupiditate est quod.
31-
32-
### Natus aspernatur iste
33-
34-
Sit commodi iste iure molestias qui amet voluptatem sed quaerat. Nostrum aut pariatur. Sint ipsa praesentium dolor error cumque velit tenetur quaerat exercitationem. Consequatur et cum atque mollitia qui quia necessitatibus.
35-
36-
Voluptas beatae omnis omnis voluptas. Cum architecto ab sit ad eaque quas quia distinctio. Molestiae aperiam qui quis deleniti soluta quia qui. Dolores nostrum blanditiis libero optio id. Mollitia ad et asperiores quas saepe alias.
13+
- [Python Type Hints](https://docs.python.org/3/library/typing.html)
14+
- [Pydantic Mdoels](https://docs.pydantic.dev/latest/)
15+
- [abc -- Abstract Base Classes](https://docs.python.org/3/library/abc.html)

‎src/app/docs/core-concepts/use-cases/page.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: Use-Cases
2+
title: Use-Cases and Agents
33
nextjs:
44
metadata:
5-
title: Use-Cases
6-
description: Quidem magni aut exercitationem maxime rerum eos.
5+
title: Use-Cases and Agents
6+
description: 'HackingBuddyGPT: Use-Case and Agent Infrastructure'
77
---
88

99
Wintermute consists of different use-cases (classes extending `UseCase`, being annotated with `@use_case` and being imported somewhere from the main `wintermute.py` file), which can be run individually.
File renamed without changes.

‎src/app/docs/introduction/how-to-contribute/page.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: How to Contribute?
33
nextjs:
44
metadata:
55
title: How to Contribute?
6-
description: 'You want to contribute to HackingBuddyGPT? Please do (:'
6+
description: 'HackingBuddyGPT: You want to contribute to HackingBuddyGPT? Please do (:'
77
---
88

99
So you want to contribute to hackingBuddyGPT? First of all, thank you! Second of all, how to best continue?
@@ -12,6 +12,6 @@ So you want to contribute to hackingBuddyGPT? First of all, thank you! Second of
1212
2. Maybe check the [list of open issues](https://github.com/ipa-lab/hackingBuddyGPT/issues), some of them are tagged as `good first issue` even
1313
3. fork the projects
1414
4. have fun and work on the issue (or your new hacking agent)
15-
5. create a pull request to contribute the code back to hackingBuddyGPT
15+
5. [create a pull request](https://github.com/ipa-lab/hackingBuddyGPT/pulls) to contribute the code back to hackingBuddyGPT
1616
6. get your code reviewed and maybe improvments suggested by a maintainer
1717
7. Fame and Profit!

‎src/lib/navigation.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const navigation = [
1616
{ title: 'Python Infrastructure', href: '/docs/core-concepts/python-infrastructure' },
1717
{ title: 'Use-Cases and Agents', href: '/docs/core-concepts/use-cases', },
1818
{ title: 'Capabilities: Adding Actions', href: '/docs/core-concepts/capabilities', },
19-
{ title: 'Configuration Magic', href: '/docs/core-concepts/configuration-magic' },
19+
{ title: 'Executables', href: '/docs/core-concepts/executables', },
2020
],
2121
},
2222
{
@@ -33,6 +33,7 @@ export const navigation = [
3333
title: 'Developer Guide',
3434
links: [
3535
{ title: 'Quickstart', href: '/docs/dev-guide/dev-quickstart' },
36+
{ title: 'Configuration Magic', href: '/docs/dev-guide/configuration-magic' },
3637
{ title: 'Using Usecases from Agents', href: '/docs/dev-guide/including-use-cases' },
3738
{ title: 'Multiple LLMs within an Agent', href: '/docs/dev-guide/using-multiple-llms' },
3839
],

0 commit comments

Comments
 (0)