Skip to content

Commit 11d2879

Browse files
authored
Merge pull request #247 from IntelLabs/docs/fixes
Docs/fixes
2 parents ef76826 + 5d88f26 commit 11d2879

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

.github/workflows/CI.yml

+2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ on:
99
paths-ignore:
1010
- '**/README.md'
1111
- '.github/RELEASE.md'
12+
- 'docs'
1213
pull_request:
1314
paths-ignore:
1415
- '**/README.md'
1516
- '.github/RELEASE.md'
17+
- 'docs'
1618

1719
env:
1820
image_name: intellabs/kafl

docs/source/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ The project is structured around multiple components:
3636
3737
tutorials/introduction
3838
tutorials/installation
39+
tutorials/concepts
3940
tutorials/fuzzing_linux_kernel
4041
tutorials/windows/index
4142
```

docs/source/reference/hypercall_api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ control and start injecting inputs at any point in VM guest execution.
88

99
The hypercall API can be found in the [nyx_api.h](https://github.com/IntelLabs/kafl.targets/blob/master/nyx_api.h) C header.
1010

11-
The following hypercalls should be prefixed by `kAFL_HYPERCALL_`.
11+
The following hypercalls should be prefixed by `HYPERCALL_KAFL_`.
1212

1313
## Essential hypercalls
1414

docs/source/tutorials/concepts.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Concepts
2+
3+
Before we dive into a specific target, we need to introduce the concept of a _kAFL Agent_ that will used at the next step of the tutorial
4+
5+
We assume you are already familiar with fuzzing vocabulary ([Google's fuzzing glossary](https://github.com/google/fuzzing/blob/master/docs/glossary.md) can be helpful here).
6+
7+
## kAFL Agent
8+
9+
The term _kAFL Agent_ simply refers to the implementation of a fuzzing harness in the guest.
10+
11+
The _Agent_ is responsible for both instrumenting and overseeing a specific portion of the SUT (_System Under Test_) through a set of [hypercalls](../reference/hypercall_api.md).
12+
13+
Considering that these hypercalls constitues a communication channel with the external virtual machine environment, the term _agent_ has been employed, akin to a guest agent.
14+
15+
```{mermaid}
16+
graph LR
17+
fuzzer["kAFL Fuzzer"] <--> QEMU["QEMU/KVM"]
18+
subgraph Virtual Machine
19+
Agent["kAFL Agent"] <-- Instruments --> SUT["Software Under Test"]
20+
end
21+
QEMU <-- Hypercalls --> Agent
22+
```
23+
24+
```{code-block} C
25+
---
26+
caption: Example of a simplified kAFL Agent fuzzing a target function called `target()`
27+
---
28+
// 🤝 kAFL handshake
29+
kAFL_hypercall(HYPERCALL_KAFL_ACQUIRE, 0);
30+
kAFL_hypercall(HYPERCALL_KAFL_RELEASE, 0);
31+
// allocate kAFL payload buffer
32+
kAFL_payload *payload_buffer = malloc(PAYLOAD_SIZE);
33+
// kAFL configuration, filters, etc...
34+
// 🟢 Enable feedback collection
35+
kAFL_hypercall(KAFL_HYPERCALL_ACQUIRE);
36+
// ⚡call target func ...
37+
target(payload_buffer->data, payload_buffer->size);
38+
// ⚪ Disable feedback collection
39+
kAFL_hypercall(KAFL_HYPERCALL_RELEASE);
40+
```
41+
42+
## Pick a Target !
43+
44+
Now you are ready to configure one of our pre-baked kAFL targets, and start the fuzzer !
45+
46+
- ➡️ Continue by [fuzzing the Linux Kernel](./fuzzing_linux_kernel.md)
47+
- ➡️ Continue by [fuzzing Windows programs](./windows/index.md)

0 commit comments

Comments
 (0)