Skip to content

Commit 2fcd3c9

Browse files
committed
Improve README instructions
Signed-off-by: Amalia Ionescu <[email protected]>
1 parent ac475df commit 2fcd3c9

File tree

1 file changed

+63
-14
lines changed

1 file changed

+63
-14
lines changed

README.md

Lines changed: 63 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `automatic_exploit_generation` 💎
1+
:# `automatic_exploit_generation` 💎
22

33
---
44

@@ -9,9 +9,9 @@
99
- [Development](#development)
1010
- [Usage](#usage)
1111
- [As a CLI Tool](#as-a-cli-tool)
12-
- [Recommending Exploiters to Use](#recommending-exploiters-to-use)
13-
- [Exploiting a Binary](#exploiting-a-binary)
14-
- [Help](#help)
12+
- [Recommend Exploiters to Use](#recommend-exploiters-to-use)
13+
- [Exploit a Binary](#exploit-a-binary)
14+
- [Get Help](#get-help)
1515
- [As a Python Module](#as-a-python-module)
1616

1717
---
@@ -31,31 +31,80 @@ With the input streams, mitigations, and vulnerabilities for the executable to e
3131

3232
## Setup
3333

34-
1. Ensure you have Docker installed.
35-
2. Install the required Python 3 packages via `poetry install --no-dev`.
36-
3. Build the Docker image: `docker build --tag zeratool_lib -f docker/Dockerfile.zeratool_lib .`.
37-
4. Ensure the Docker API is accessible by:
34+
1. Make sure you have set up the repositories and Python environment according to the [top-level instructions](https://github.com/open-crs#requirements).
35+
That is:
36+
37+
- Docker is installed and is properly running.
38+
Check using:
39+
40+
```console
41+
docker version
42+
docker ps -a
43+
docker run --rm hello-world
44+
```
45+
46+
These commands should run without errors.
47+
48+
- The current module repository and all other module repositories (particularly the [`zeratool_lib` repository](https://github.com/open-crs/zeratool_lib) and the [`commons` repository](https://github.com/open-crs/commons)) are cloned in the same directory.
49+
50+
- You are running all commands inside a Python virtual environment.
51+
There should be `(.venv)` prefix to your prompt.
52+
53+
- You have installed Poetry in the virtual environment.
54+
If you run:
55+
56+
```console
57+
which poetry
58+
```
59+
you should get a path ending with `.venv/bin/poetry`.
60+
61+
1. Disable the Python Keyring:
62+
63+
```console
64+
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
65+
```
66+
This is a problem that may occur in certain situations, preventing Poetry from getting packages.
67+
68+
1. Install the required packages with Poetry (based on `pyprojects.toml`):
69+
70+
```console
71+
poetry install --only main
72+
```
73+
74+
1. Build the Docker image:
75+
76+
```console
77+
docker build --tag zeratool_lib -f docker/Dockerfile.zeratool_lib .
78+
```
79+
80+
1. Ensure the Docker API is accessible by:
81+
3882
- Running the module as `root`; or
39-
- Changing the Docker socket permissions (unsecure approach) via `chmod 777 /var/run/docker.sock`.
40-
5. Build the arguments' adapter via `cd others/argv_adapter && make`.
83+
- Changing the Docker socket permissions (unsecure approach) via `sudo chmod 777 /var/run/docker.sock`.
84+
85+
1. Build the arguments' adapter via `cd others/argv_adapter && make`.
4186

4287
## Development
4388

44-
If you make modifications to the Protobuf definition, please regenerate the Python sources with `poetry run python3 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. ./automatic_exploit_generation/exploiters/zeratool/protobuf/exploit.proto`.
89+
If you make modifications to the Protobuf definition, please regenerate the Python sources with
90+
```console
91+
poetry run python3 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=.
92+
./automatic_exploit_generation/exploiters/zeratool/protobuf/exploit.proto
93+
```
4594

4695
## Usage
4796

4897
### As a CLI Tool
4998

50-
#### Recommending Exploiters to Use
99+
#### Recommend Exploiters to Use
51100

52101
```bash
53102
➜ poetry run automatic_exploit_generation recommend --elf=key-manager.elf --stream=STDIN --mitigation=NX --weakness=STACK_OUT_OF_BOUND_WRITE
54103
Exploiters that can be used considering the context are:
55104
- ZERATOOL
56105
```
57106

58-
#### Exploiting a Binary
107+
#### Exploit a Binary
59108

60109
```bash
61110
➜ poetry run automatic_exploit_generation exploit --exploiter=ZERATOOL --elf=key-manager.elf --stream=STDIN --mitigation=NX --weakness=STACK_OUT_OF_BOUND_WRITE
@@ -69,7 +118,7 @@ The exploiter could generate an exploit with the outcome of DENIAL_OF_SERVICE an
69118
00000000: 61 61 61 61 61 61 61 61 aaaaaaaa
70119
```
71120

72-
#### Help
121+
#### Get help
73122

74123
```bash
75124
➜ poetry run automatic_exploit_generation

0 commit comments

Comments
 (0)