You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -33,22 +33,24 @@ The best way to try the features out is to work with the [fuzzer_hevd](src/wtf/f
33
33
-`outputs` is the folder where the current minset files are saved into,
34
34
-`coverage` is the folder where the `.cov` files are expected to be in,
35
35
-`crashes` is where the crashes gets saved in,
36
-
-`state` is where the memory dump (`mem.dmp`) as well as the CPU state (`regs.json`) and the symbol store are stored in (`symbol-store.json`). The symbol store is a simple JSON file that is used on Linux systems to know where to put breakpoints as there is no support for symbols / dbgeng on those platforms. *wtf* generates this file at runtime everytime you run your target on Windows.
36
+
-`state` is where the memory dump (`mem.dmp`) as well as the CPU state (`regs.json`) and the symbol store are stored in (`symbol-store.json`). The symbol store is a simple JSON file that is used on Linux systems to know where to put breakpoints as there is no support for symbols / dbgeng on those platforms. **wtf** generates this file at runtime everytime you run your target on Windows.
37
+
38
+
What follows assume that you downloaded the [target-hevd.7z](https://github.com/0vercl0k/wtf/releases) file attached to the latest release, and extracted it in the `targets` directory of your clone of **wtf**. You should have `wtf/targets/hevd` in which you find the `inputs` / `outputs`, etc. directories.
37
39
38
40
### Starting a server node
39
41
40
42
The server is basically the brain and keeps track of all the state: the aggregated code-coverage, the corpus, it generates and distributes the test-cases to client.
41
43
42
-
This is how you might choose to launch a server node:
44
+
This is how you might choose to launch a local server node:
The `max_len` option is used to limit the size of the generated test-case, `runs` is the number of test-cases it will generate, `address` specify where *wtf* needs to be listening on, `target` is a directory with the directory tree we described above (the user can also choose to override those directories with `--input` / `--output` / `--crashes`) and `name` specifies your fuzzing module name so that the master can invoke your generator function if you have defined one.
50
+
The `max_len` option is used to limit the size of the generated test-case, `runs` is the number of test-cases it will generate, `address` specify where **wtf** needs to be listening on, `target` is a directory with the directory tree we described above (the user can also choose to override those directories with `--input` / `--output` / `--crashes`) and `name` specifies your fuzzing module name so that the master can invoke your generator function if you have defined one.
49
51
50
52
<palign='center'>
51
-
<imgsrc='pics/server.gif'>
53
+
<imgsrc='pics/server.webp'>
52
54
</p>
53
55
54
56
### Fuzzing nodes
@@ -58,13 +60,13 @@ The client nodes run a test-case that has been generated and distributed by the
58
60
This is how you would start a client node that uses the *bochscpu* backend:
The `fuzz` subcommand is used with the `name` option to specify which fuzzer module needs to be used, `backend` specifies the execution backend and `limit` the maximum number of instruction to execute per testcase (depending on the backend, this option has different meaning).
65
67
66
68
<palign='center'>
67
-
<imgsrc='pics/client.gif'>
69
+
<imgsrc='pics/client.webp'>
68
70
</p>
69
71
70
72
### Running a test-case
@@ -74,11 +76,11 @@ If you would like to run a test-case (or a folder filled with test-cases), you c
74
76
This is how you would would run the `crash-0xfffff764b91c0000-0x0-0xffffbf84fb10e780-0x2-0x0` test-case:
75
77
76
78
```
77
-
..\..\src\build\wtf.exe run --name hevd --state state --backend=bochscpu --limit 10000000 --input crashes\crash-0xfffff764b91c0000-0x0-0xffffbf84fb10e780-0x2-0x0
79
+
wtf.exe run --name hevd --limit 10000000 --input crashes\crash-0xfffff764b91c0000-0x0-0xffffbf84fb10e780-0x2-0x0
78
80
```
79
81
80
82
<palign='center'>
81
-
<imgsrc='pics/run.gif'>
83
+
<imgsrc='pics/run.webp'>
82
84
</p>
83
85
84
86
### Minseting a corpus
@@ -88,11 +90,11 @@ To minset a corpus, you need to use a server node and as many client nodes as yo
88
90
This is how you would minset the corpus in `outputs` into the `minset` directory (also highlights how you can override the `inputs` and `outputs` directories):
@@ -102,36 +104,33 @@ The main mechanism available to instrospect in an execution backend is to genera
102
104
This is how you would generate an execution trace for the `crash-0xfffff764b91c0000-0x0-0xffffbf84fb10e780-0x2-0x0` test-case:
103
105
104
106
```
105
-
..\..\src\build\wtf.exe run --name hevd --state state --backend=bochscpu --limit 10000000 --input crashes\crash-0xfffff764b91c0000-0x0-0xffffbf84fb10e780-0x2-0x0 --trace-type=rip
107
+
wtf.exe run --name hevd --limit 10000000 --input crashes\crash-0xfffff764b91c0000-0x0-0xffffbf84fb10e780-0x2-0x0 --trace-type=rip
106
108
```
107
109
108
110
<palign='center'>
109
-
<imgsrc='pics/trace.gif'>
111
+
<imgsrc='pics/trace.webp'>
110
112
</p>
111
113
112
-
The execution traces aren't symbolized because Linux systems wouldn't be able to do that and that is why I wrote [symbolizer](https://github.com/0vercl0k/symbolizer).
113
-
114
-
This is how you would symbolize the `crash-0xfffff764b91c0000-0x0-0xffffbf84fb10e780-0x2-0x0.trace` execution trace generated above:
114
+
To symbolize execution traces you should use [symbolizer-rs](https://github.com/0vercl0k/symbolizer). This is how you would symbolize the `crash-0xfffff764b91c0000-0x0-0xffffbf84fb10e780-0x2-0x0.trace` execution trace generated above:
If you see yourself needing more contextual awareness, the *bochscpu* backend allows you to generate execution traces that can be loaded in the [Tenet](https://github.com/gaasedelen/tenet) trace explorer. In the below, I start from a crash in `memmove` and walk back to find out where the source pointer is coming from (user-mode!):
127
127
128
128
```
129
-
..\..\src\build\wtf.exe run --name hevd --state state --backend=bochscpu --limit 10000000 --input crashes\crash-0xfffff764b91c0000-0x0-0xffffbf84fb10e780-0x2-0x0 --trace-type=tenet
129
+
wtf.exe run --name hevd --limit 10000000 --input crashes\crash-0xfffff764b91c0000-0x0-0xffffbf84fb10e780-0x2-0x0 --trace-type=tenet
130
130
```
131
131
132
-
133
132
<palign='center'>
134
-
<imgsrc='pics/tenet.gif'>
133
+
<imgsrc='pics/tenet.webp'>
135
134
</p>
136
135
137
136
### Generating code-coverage traces
@@ -141,36 +140,36 @@ To generate code-coverage traces you can simply use the `run` subcommand with th
141
140
This is how you would generate code-coverage traces for all the files inside the `minset` folder and store them in the `coverage-traces` folder:
142
141
143
142
```
144
-
..\..\src\build\wtf.exe run --name hevd --state state --backend=whv --input minset --trace-path=coverage-traces --trace-type=cov
143
+
wtf.exe run --name hevd --input minset --trace-path=coverage-traces --trace-type=cov
145
144
```
146
145
147
146
<palign='center'>
148
-
<imgsrc='pics/ccov.gif'>
147
+
<imgsrc='pics/ccov.webp'>
149
148
</p>
150
149
151
150
Those traces aren't directly loadable into [lighthouse](https://github.com/gaasedelen/lighthouse) because they aren't symbolized.
152
151
153
152
This is how you would symbolize all the files inside the `coverage-traces` folder and write the results into `coverage-traces-symbolized`:
And finally, you can load those up in [lighthouse](https://github.com/gaasedelen/lighthouse):
164
163
165
164
<palign='center'>
166
-
<imgsrc='pics/lighthouse.gif'>
165
+
<imgsrc='pics/lighthouse.webp'>
167
166
</p>
168
167
169
168
Also if you don't care about individual code-coverage, the master maintains a `coverage.cov` file contains the unique aggregated code-coverage that has been exercised. It makes it easy to check on the global code-coverage really quick during a fuzzing job.
170
169
171
170
## How does it work?
172
171
173
-
*wtf* runs user & kernel mode through an *execution backend* and relies on the user to insert test-cases in the target. Unlike other classical fuzzer tools, *wtf* doesn't do much of the heavy lifting; the user does. The user needs to know the harnessed target very well and onboarding a target is an iterative process that will take time. It has a lot of flexibility to offer if you are ready to get hacking though :)
172
+
**wtf** runs user & kernel mode through an *execution backend* and relies on the user to insert test-cases in the target. Unlike other classical fuzzer tools, **wtf** doesn't do much of the heavy lifting; the user does. The user needs to know the harnessed target very well and onboarding a target is an iterative process that will take time. It has a lot of flexibility to offer if you are ready to get hacking though :)
174
173
175
174
The usual workflow to harness a target is as follows:
0 commit comments