Skip to content

Commit

Permalink
Doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-zeller committed Oct 14, 2023
1 parent 2b46e55 commit 3c72449
Show file tree
Hide file tree
Showing 356 changed files with 128,640 additions and 72,267 deletions.
6 changes: 2 additions & 4 deletions README.md
Expand Up @@ -93,13 +93,11 @@ If mybinder.org does not work or match your needs, you have a number of alternat

2. **Download the Jupyter Notebooks** (using the menu at the top) and open them in Jupyter. Here's [how to install jupyter notebook on your machine](https://www.dataquest.io/blog/jupyter-notebook-tutorial/).

3. **Run the notebook locally** in a Docker container. For more information, see [How to use the book with Docker](https://github.com/uds-se/fuzzingbook/blob/master/deploy/README.md).

4. If you want to use the book in a classroom, and depend on your users having access to the interactive notebooks, consider using or deploying a [JupyterHub](http://jupyter.org/hub) or [BinderHub](https://github.com/jupyterhub/binderhub) instance.
3. If you want to use the book in a classroom, and depend on your users having access to the interactive notebooks, consider using or deploying a [JupyterHub](http://jupyter.org/hub) or [BinderHub](https://github.com/jupyterhub/binderhub) instance.

#### Can I run the code on my Windows machine?

We try to keep the code as general as possible, but occasionally, when we interact with the operating system, we assume a Unix-like environment (because that is what Binder provides). To run these examples on your own Windows machine, you can install a Linux VM or a [Docker environment](https://github.com/uds-se/fuzzingbook/blob/master/deploy/README.md).
We try to keep the code as general as possible, but occasionally, when we interact with the operating system, we assume a Unix-like environment (because that is what Binder provides). To run these examples on your own Windows machine, you can install a Linux Subsystem or a Linux Virtual Machine.

#### Can't you run your own dedicated cloud service?

Expand Down
8 changes: 5 additions & 3 deletions docs/404.html
Expand Up @@ -11904,7 +11904,7 @@
<li><a href="/html/Reducer.html">Reducing Failure-Inducing Inputs</a></li>
</ul><li class="has-sub"><a href="/html/04_Semantical_Fuzzing.html" class="chapters"><span class="part_number">IV</span> Semantic Fuzzing <i class="fa fa-fw fa-caret-right"></i></a>
<ul>
<li><a href="/html/FuzzingWithConstraints.html">Fuzzing with Constraints <strong class="new_chapter">&bull;</strong></a></li>
<li><a href="/html/FuzzingWithConstraints.html">Fuzzing with Constraints</a></li>
<li><a href="/html/GrammarMiner.html">Mining Input Grammars</a></li>
<li><a href="/html/InformationFlow.html">Tracking Information Flow</a></li>
<li><a href="/html/ConcolicFuzzer.html">Concolic Fuzzing</a></li>
Expand All @@ -11915,6 +11915,7 @@
<li><a href="/html/ConfigurationFuzzer.html">Testing Configurations</a></li>
<li><a href="/html/APIFuzzer.html">Fuzzing APIs</a></li>
<li><a href="/html/Carver.html">Carving Unit Tests</a></li>
<li><a href="/html/PythonFuzzer.html">Testing Compilers <strong class="new_chapter">&bull;</strong></a></li>
<li><a href="/html/WebFuzzer.html">Testing Web Applications</a></li>
<li><a href="/html/GUIFuzzer.html">Testing Graphical User Interfaces</a></li>
</ul><li class="has-sub"><a href="/html/06_Managing_Fuzzing.html" class="chapters"><span class="part_number">VI</span> Managing Fuzzing <i class="fa fa-fw fa-caret-right"></i></a>
Expand Down Expand Up @@ -12019,7 +12020,7 @@
<li><a href="/html/Reducer.html">Reducing Failure-Inducing Inputs</a></li>
</ul><li class="has-sub"><a href="/html/04_Semantical_Fuzzing.html" class="chapters"><span class="part_number">IV</span> Semantic Fuzzing <i class="fa fa-fw fa-caret-right"></i></a>
<ul>
<li><a href="/html/FuzzingWithConstraints.html">Fuzzing with Constraints <strong class="new_chapter">&bull;</strong></a></li>
<li><a href="/html/FuzzingWithConstraints.html">Fuzzing with Constraints</a></li>
<li><a href="/html/GrammarMiner.html">Mining Input Grammars</a></li>
<li><a href="/html/InformationFlow.html">Tracking Information Flow</a></li>
<li><a href="/html/ConcolicFuzzer.html">Concolic Fuzzing</a></li>
Expand All @@ -12030,6 +12031,7 @@
<li><a href="/html/ConfigurationFuzzer.html">Testing Configurations</a></li>
<li><a href="/html/APIFuzzer.html">Fuzzing APIs</a></li>
<li><a href="/html/Carver.html">Carving Unit Tests</a></li>
<li><a href="/html/PythonFuzzer.html">Testing Compilers <strong class="new_chapter">&bull;</strong></a></li>
<li><a href="/html/WebFuzzer.html">Testing Web Applications</a></li>
<li><a href="/html/GUIFuzzer.html">Testing Graphical User Interfaces</a></li>
</ul><li class="has-sub"><a href="/html/06_Managing_Fuzzing.html" class="chapters"><span class="part_number">VI</span> Managing Fuzzing <i class="fa fa-fw fa-caret-right"></i></a>
Expand Down Expand Up @@ -12133,7 +12135,7 @@

<div class="output_subarea output_stream output_stderr output_text">
<pre>Traceback (most recent call last):
File &#34;/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_90719/1830731544.py&#34;, line 4, in &lt;cell line: 3&gt;
File &#34;/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_63672/1830731544.py&#34;, line 4, in &lt;cell line: 3&gt;
raise NotFoundError
NotFoundError: &#39;404&#39; (expected)
</pre>
Expand Down
2 changes: 1 addition & 1 deletion docs/code/01_Intro.py
Expand Up @@ -3,7 +3,7 @@

# "Part I: Whetting Your Appetite" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/01_Intro.html
# Last change: 2023-01-07 15:36:14+01:00
# Last change: 2023-10-14 22:50:52+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/code/02_Lexical_Fuzzing.py
Expand Up @@ -3,7 +3,7 @@

# "Part II: Lexical Fuzzing" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/02_Lexical_Fuzzing.html
# Last change: 2023-01-07 15:36:32+01:00
# Last change: 2023-10-14 22:51:10+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/code/03_Syntactical_Fuzzing.py
Expand Up @@ -3,7 +3,7 @@

# "Part III: Syntactic Fuzzing" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/03_Syntactical_Fuzzing.html
# Last change: 2023-01-07 15:52:35+01:00
# Last change: 2023-10-14 22:53:15+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/code/04_Semantical_Fuzzing.py
Expand Up @@ -3,7 +3,7 @@

# "Part IV: Semantic Fuzzing" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/04_Semantical_Fuzzing.html
# Last change: 2023-01-07 15:52:54+01:00
# Last change: 2023-10-14 22:56:30+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/code/05_Domain-Specific_Fuzzing.py
Expand Up @@ -3,7 +3,7 @@

# "Part V: Domain-Specific Fuzzing" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/05_Domain-Specific_Fuzzing.html
# Last change: 2023-01-07 15:39:21+01:00
# Last change: 2023-10-14 22:58:36+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/code/06_Managing_Fuzzing.py
Expand Up @@ -3,7 +3,7 @@

# "Part VI: Managing Fuzzing" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/06_Managing_Fuzzing.html
# Last change: 2023-01-07 15:22:35+01:00
# Last change: 2023-10-14 23:06:17+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/code/99_Appendices.py
Expand Up @@ -3,7 +3,7 @@

# "Appendices" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/99_Appendices.html
# Last change: 2023-01-07 15:24:49+01:00
# Last change: 2023-10-14 23:08:54+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/code/APIFuzzer.py
Expand Up @@ -3,7 +3,7 @@

# "Fuzzing APIs" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/APIFuzzer.html
# Last change: 2023-01-07 15:21:26+01:00
# Last change: 2023-10-14 22:58:57+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/code/AcademicPrototyping.py
Expand Up @@ -3,7 +3,7 @@

# "Academic Prototyping" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/AcademicPrototyping.html
# Last change: 2023-01-07 15:24:54+01:00
# Last change: 2023-10-14 23:08:59+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/code/Carver.py
Expand Up @@ -3,7 +3,7 @@

# "Carving Unit Tests" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/Carver.html
# Last change: 2023-01-07 15:21:35+01:00
# Last change: 2023-10-14 22:59:06+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/code/ClassDiagram.py
Expand Up @@ -3,7 +3,7 @@

# "Class Diagrams" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/ClassDiagram.html
# Last change: 2023-01-07 15:25:37+01:00
# Last change: 2023-10-14 23:09:44+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
61 changes: 27 additions & 34 deletions docs/code/ConcolicFuzzer.py
Expand Up @@ -3,7 +3,7 @@

# "Concolic Fuzzing" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/ConcolicFuzzer.html
# Last change: 2023-01-07 15:20:37+01:00
# Last change: 2023-10-14 22:58:07+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down Expand Up @@ -89,32 +89,34 @@
>>> _[cgi_decode](v)
>>> scf.add_trace(_, v)
' '
'%'
'AB'
''
'ABC'
'A'
'AB+'
'+'
'AB'
'ABCD'
'+'
'%'
'A+'
'%'
'+'
'ABC'
IndexError: string index out of range (expected)
IndexError: string index out of range (expected)
IndexError: string index out of range (expected)
'ABC+'
'A'
'ABC'
'ABC%'
'A%'
'ABC+DE'
'AB'
'A+'
'ABCD'
'ABCDEF'
'AB+'
'%'
'A%'
'ABCD%'
'ABC+'
'ABCDE'
IndexError: string index out of range (expected)
IndexError: string index out of range (expected)
'A'
'ABCD'
'A'
IndexError: string index out of range (expected)
We see how the additional inputs generated explore additional paths.
Expand All @@ -139,27 +141,18 @@
>>> print(e)
>>> cgf.update_grammar(_)
>>> print()
insert into W (Ru_2,.Wj186518W8) values ('@','}','h')
Table ('W') was not found
select S>R(j),A from C3 where U4==9249
Table ('C3') was not found
select I/I*U/n1(M),T/E*d(S) from vehicles
Invalid WHERE ('(I/I*U/n1(M),T/E*d(S))')
select (v==X),t,h,E from months where r8(w)B/P(g)
select x/z+.(L)-h from months where -9!=Y>G(A)
delete from g6M where (H(J)-r+Z)==b+p!=h==o
Table ('g6M') was not found
delete from h4OB60J where K-w/MA) from vehicles where B(e,R)>D
insert into A7 (U,v) values (98.3)
Table ('A7') was not found
select (j/c/WX==d+f/jb5(W))(X-I)
Invalid WHERE ('J+R+z/b-O+C/W>(X-I)')
TypeError: 'NotImplementedType' object is not callable (expected)
TypeError: 'NotImplementedType' object is not callable (expected)
TypeError: 'NotImplementedType' object is not callable (expected)
TypeError: 'NotImplementedType' object is not callable (expected)
select e(p)/D-g(X) from months where N+T>O-y-D
select ((A!=S)TT
For more details, source, and documentation, see
"The Fuzzing Book - Concolic Fuzzing"
at https://www.fuzzingbook.org/html/ConcolicFuzzer.html
Expand Down
12 changes: 6 additions & 6 deletions docs/code/ConfigurationFuzzer.py
Expand Up @@ -3,7 +3,7 @@

# "Testing Configurations" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/ConfigurationFuzzer.html
# Last change: 2023-01-07 15:21:20+01:00
# Last change: 2023-10-14 22:58:50+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down Expand Up @@ -193,18 +193,18 @@
>>> from Grammars import convert_ebnf_grammar
>>> fuzzer = GrammarCoverageFuzzer(convert_ebnf_grammar(option_ebnf_grammar))
>>> [fuzzer.fuzz() for i in range(3)]
[' foo.py',
' --verbose --ignore-local-config --line-range -1 78 --jobs -43 --pep8-passes 6 -i --indent-size 2 --range -59330 -0 -r --diff --exit-code --global-config KC --aggressive --recursive --ignore 37~ --help --experimental -v -p 7 --hang-closing --exclude t -d -h --in-place --version -a --list-fixes --max-line-length 4 --select e* -j 635 --select 5ulP --ignore G --global-config -E --ignore q --exclude 2^ --global-config "r --select z --ignore F6 --exclude Xd --exclude ,8 --global-config A --ignore L --ignore Q --global-config 4 --ignore O= --ignore /.m[ --ignore Dy --ignore :s --ignore v --exclude R --ignore B --global-config pb --select V --global-config 9 --global-config Hcwg{Sj --global-config ` --global-config i}W --ignore x --select _ --select ](\'f+6 --select a]Y --exclude * --global-config z --ignore-local-config --aggressive foo.py',
' foo.py']
[' --list-fixes foo.py',
' --version -i --range -5 04 --aggressive --diff -j 817 --help -d --hang-closing -p 26 -a --verbose --exclude |g -v --global-config f --recursive --ignore .= -r --experimental -h --line-range -317 9 --pep8-passes 8 --max-line-length 2 --indent-size 0 --in-place foo.py',
' --ignore-local-config --jobs 92 --exit-code --select Q"6 --global-config (h --ignore )` --select M --select t,\\Z --global-config u5 --global-config ! --ignore lUSb --exclude V^ --global-config LBj --global-config X --select _ --exclude n4 --global-config %&/: --select a --global-config k --ignore 1 --ignore G~m?7 --exclude PJX --select I --select w -d foo.py']
The `OptionFuzzer` class summarizes these steps. Its constructor takes an `OptionRunner` to automatically extract the grammar; it does the necessary steps to extract the grammar and fuzz with it.
>>> autopep8_runner = OptionRunner("autopep8", "foo.py")
>>> autopep8_fuzzer = OptionFuzzer(autopep8_runner)
>>> [autopep8_fuzzer.fuzz() for i in range(3)]
[' foo.py',
" -a -d -i --help --verbose --exclude + --in-place --max-line-length -29 --line-range -7 3 -v --aggressive --indent-size -01 --jobs 6489550 --global-config !KGD'V -r -j 106 --list-fixes --hang-closing foo.py",
' --exit-code -h --recursive --pep8-passes -0 --ignore ) --ignore-local-config --diff --experimental --version --range 3 -542 -p 56 --select k --diff -h --diff foo.py']
' -a --hang-closing --aggressive --help -h --ignore : --verbose --diff --jobs 68 --line-range 4 -159 --indent-size -0 -d -i --range 27 38 --experimental --global-config gt --ignore-local-config --exit-code --in-place -v foo.py',
' --select ?H --pep8-passes 7 --max-line-length -154 -r --exclude P --recursive --list-fixes -j 77 --version -p 71 --global-config )c --select 4!m/ --ignore 1d3 --select ~ --ignore b[^ --global-config qn --exclude >V --exclude 2 --select $_iUzQ].0 --select ; --ignore 5M --ignore 9 --select pN`C --ignore 76(J --select Dh --exclude ov" -h foo.py']
The final step in testing would now to invoke the program with these arguments.
Expand Down
2 changes: 1 addition & 1 deletion docs/code/ControlFlow.py
Expand Up @@ -3,7 +3,7 @@

# "Control Flow Graph" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/ControlFlow.html
# Last change: 2023-01-07 15:25:49+01:00
# Last change: 2023-10-14 23:09:56+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/code/Coverage.py
Expand Up @@ -3,7 +3,7 @@

# "Code Coverage" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/Coverage.html
# Last change: 2023-01-07 15:13:47+01:00
# Last change: 2023-10-14 22:51:37+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/code/DynamicInvariants.py
Expand Up @@ -3,7 +3,7 @@

# "Mining Function Specifications" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/DynamicInvariants.html
# Last change: 2023-01-07 15:21:00+01:00
# Last change: 2023-10-14 22:58:31+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
8 changes: 4 additions & 4 deletions docs/code/ExpectError.py
Expand Up @@ -3,7 +3,7 @@

# "Error Handling" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/ExpectError.html
# Last change: 2023-01-07 15:25:21+01:00
# Last change: 2023-10-14 23:09:27+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down Expand Up @@ -47,7 +47,7 @@
>>> with ExpectError():
>>> x = 1 / 0
Traceback (most recent call last):
File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_89181/2664980466.py", line 2, in
File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_61641/2664980466.py", line 2, in
x = 1 / 0
ZeroDivisionError: division by zero (expected)
Expand All @@ -63,9 +63,9 @@
3 seconds have passed
Traceback (most recent call last):
File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_89181/1223755941.py", line 2, in
File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_61641/1223755941.py", line 2, in
long_running_test()
File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_89181/3930412460.py", line 4, in long_running_test
File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_61641/3930412460.py", line 4, in long_running_test
time.sleep(1)
File "/Users/zeller/Projects/fuzzingbook/notebooks/Timeout.ipynb", line 43, in timeout_handler
raise TimeoutError()
Expand Down
9 changes: 6 additions & 3 deletions docs/code/Fuzzer.py
Expand Up @@ -3,7 +3,7 @@

# "Fuzzing: Breaking Things with Random Inputs" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/Fuzzer.html
# Last change: 2023-01-07 15:36:45+01:00
# Last change: 2023-10-14 22:51:24+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down Expand Up @@ -240,10 +240,13 @@ def fuzzer(max_length: int = 100, char_start: int = 32, char_range: int = 32) ->
], "9 ** 0.5")

if __name__ == '__main__':
1/100 * 3/32
1/101 * 2/32

if __name__ == '__main__':
3/32 * 1/32
3/94 * 1/94 * 99/101

if __name__ == '__main__':
2/32 * 1/32 * 99/101

### Long-Running Fuzzing

Expand Down
2 changes: 1 addition & 1 deletion docs/code/FuzzingInTheLarge.py
Expand Up @@ -3,7 +3,7 @@

# "Fuzzing in the Large" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/FuzzingInTheLarge.html
# Last change: 2023-01-07 15:55:19+01:00
# Last change: 2023-10-14 23:08:00+02:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down

0 comments on commit 3c72449

Please sign in to comment.