Skip to content

Commit

Permalink
Doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-zeller committed Jan 17, 2024
1 parent 0122626 commit 5bc79e6
Show file tree
Hide file tree
Showing 238 changed files with 31,876 additions and 33,465 deletions.
2 changes: 1 addition & 1 deletion docs/beta/404.html
Expand Up @@ -12153,7 +12153,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_45178/1830731544.py&#34;, line 4, in &lt;cell line: 3&gt;
File &#34;/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_79022/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/beta/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-11-12 13:39:18+01:00
# Last change: 2024-01-17 17:49:08+01: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/beta/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-11-12 13:39:37+01:00
# Last change: 2024-01-17 17:49:31+01: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/beta/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-11-12 13:41:49+01:00
# Last change: 2024-01-17 17:52:00+01: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/beta/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-11-12 13:45:26+01:00
# Last change: 2024-01-17 17:54:58+01: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/beta/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-11-12 13:47:54+01:00
# Last change: 2024-01-17 17:56:46+01: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/beta/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-11-12 13:52:48+01:00
# Last change: 2024-01-17 21:30:18+01: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/beta/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-11-12 13:55:29+01:00
# Last change: 2024-01-17 21:31:52+01: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/beta/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-11-12 13:48:13+01:00
# Last change: 2024-01-17 17:57:01+01: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/beta/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-11-12 13:55:34+01:00
# Last change: 2024-01-17 21:31:58+01: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/beta/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-11-12 13:48:21+01:00
# Last change: 2024-01-17 17:57:08+01: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/beta/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-11-12 13:56:20+01:00
# Last change: 2024-01-17 21:32:43+01:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
48 changes: 25 additions & 23 deletions docs/beta/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-11-12 13:47:22+01:00
# Last change: 2024-01-17 17:56:24+01: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,31 +89,36 @@
>>> _[cgi_decode](v)
>>> scf.add_trace(_, v)
' '
''
'%'
'A'
'%'
'AB'
'+'
'A%'
'%'
'+A'
'AB'
'++'
'++A'
'+++'
'A'
'+A'
'+++A'
'A%'
IndexError: string index out of range (expected)
IndexError: string index out of range (expected)
IndexError: string index out of range (expected)
IndexError: string index out of range (expected)
IndexError: string index out of range (expected)
'+AB'
'++'
'A+'
'+'
'A+B'
'A+%'
'%'
'++AB'
'++A+'
'AB'
'A+'
'+A'
'++'
'+'
'+%'
IndexError: string index out of range (expected)
IndexError: string index out of range (expected)
IndexError: string index out of range (expected)
We see how the additional inputs generated explore additional paths.
Expand All @@ -138,18 +143,15 @@
>>> print(e)
>>> cgf.update_grammar(_)
>>> print()
select 245 from :2 where r(_)-N+e>n
Table (':2') was not found
delete from months where Q/x/j/q(p)/H*h-B==cz
Invalid WHERE ('Q/x/j/q(p)/H*h-B==cz')
select Z/W+_+b+L-e-. from AO where G!=M
Table ('AO') was not found
insert into vehicles (:b) values (22.72)
Column (':b') was not found
select u/.+C+P!=f-.*h+W-o+c from Uok37
Table ('Uok37') was not found
select i*q!=(4) from vehicles where L*S/l/u/b+b==W
delete from gi6 where Je*N,(r),F from vehicles where ((((t))))==o!=g
delete from vehicles where W/V!=A(f)+tL+S))==((:+lL+S))==((:+l
select (z/E
For more details, source, and documentation, see
"The Fuzzing Book - Concolic Fuzzing"
at https://www.fuzzingbook.org/html/ConcolicFuzzer.html
Expand Down
2 changes: 1 addition & 1 deletion docs/beta/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-11-12 13:48:07+01:00
# Last change: 2024-01-17 17:56:57+01: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/beta/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-11-12 13:56:33+01:00
# Last change: 2024-01-17 21:32:56+01:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
42 changes: 21 additions & 21 deletions docs/beta/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-11-12 13:40:08+01:00
# Last change: 2024-01-17 17:50:31+01:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down Expand Up @@ -49,26 +49,26 @@
>>> with Coverage() as cov:
>>> cgi_decode("a+b")
Printing out a coverage object shows the covered functions, with covered lines prefixed as `#`:
Printing out a coverage object shows the covered functions, with non-covered lines prefixed with `#`:
>>> print(cov)
1 def cgi_decode(s: str) -> str:
2 """Decode the CGI-encoded string `s`:
3 * replace '+' by ' '
4 * replace "%xx" by the character with hex number xx.
5 Return the decoded string. Raise `ValueError` for invalid inputs."""
6
7 # Mapping of hex digits to their integer values
# 8 hex_values = {
# 9 '0': 0, '1': 1, '2': 2, '3': 3, '4': 4,
# 10 '5': 5, '6': 6, '7': 7, '8': 8, '9': 9,
# 11 'a': 10, 'b': 11, 'c': 12, 'd': 13, 'e': 14, 'f': 15,
# 12 'A': 10, 'B': 11, 'C': 12, 'D': 13, 'E': 14, 'F': 15,
13 }
14
# 15 t = ""
# 16 i = 0
# 17 while i >> cov.trace()
# 1 def cgi_decode(s: str) -> str:
# 2 """Decode the CGI-encoded string `s`:
# 3 * replace '+' by ' '
# 4 * replace "%xx" by the character with hex number xx.
# 5 Return the decoded string. Raise `ValueError` for invalid inputs."""
# 6
# 7 # Mapping of hex digits to their integer values
8 hex_values = {
9 '0': 0, '1': 1, '2': 2, '3': 3, '4': 4,
10 '5': 5, '6': 6, '7': 7, '8': 8, '9': 9,
11 'a': 10, 'b': 11, 'c': 12, 'd': 13, 'e': 14, 'f': 15,
12 'A': 10, 'B': 11, 'C': 12, 'D': 13, 'E': 14, 'F': 15,
# 13 }
# 14
15 t = ""
16 i = 0
17 while i >> cov.trace()
[('cgi_decode', 8),
('cgi_decode', 9),
('cgi_decode', 8),
Expand Down Expand Up @@ -378,7 +378,7 @@ def __enter__(self) -> Any:
sys.settrace(self.traceit)
return self

def __exit__(self, exc_type: Type, exc_value: BaseException,
def __exit__(self, exc_type: Type, exc_value: BaseException,
tb: TracebackType) -> Optional[bool]:
"""End of `with` block. Turn off tracing."""
sys.settrace(self.original_trace_function)
Expand Down Expand Up @@ -410,7 +410,7 @@ def __repr__(self) -> str:

source_lines, start_line_number = inspect.getsourcelines(fun)
for lineno in range(start_line_number, start_line_number + len(source_lines)):
if (function_name, lineno) in self.trace():
if (function_name, lineno) not in self.trace():
t += "# "
else:
t += " "
Expand Down
2 changes: 1 addition & 1 deletion docs/beta/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-11-12 13:47:49+01:00
# Last change: 2024-01-17 17:56:43+01: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/beta/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-11-12 13:56:02+01:00
# Last change: 2024-01-17 21:32:26+01: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_42596/2664980466.py", line 2, in
File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_76654/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_42596/1223755941.py", line 2, in
File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_76654/1223755941.py", line 2, in
long_running_test()
File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_42596/3930412460.py", line 4, in long_running_test
File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_76654/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
2 changes: 1 addition & 1 deletion docs/beta/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-11-12 13:39:54+01:00
# Last change: 2024-01-17 17:50:02+01: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/beta/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-11-12 13:54:36+01:00
# Last change: 2024-01-17 22:06:58+01:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down
24 changes: 12 additions & 12 deletions docs/beta/code/FuzzingWithConstraints.py
Expand Up @@ -3,7 +3,7 @@

# "Fuzzing with Constraints" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/FuzzingWithConstraints.html
# Last change: 2023-11-12 13:46:31+01:00
# Last change: 2024-01-17 17:55:42+01:00
#
# Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University, authors, and contributors
Expand Down Expand Up @@ -75,24 +75,24 @@
With that, invoking `solver.solve()` returns a _solution_ for the constraints.
>>> str(solver.solve())
'(908)828-1795'
'(903)805-6934'
`solve()` returns a derivation tree, which typically is converted into a string using `str()` as above. The `print()` function does this implicitly.
Subsequent calls of `solve()` return more solutions:
>>> for _ in range(10):
>>> print(solver.solve())
(908)434-2906
(908)244-7907
(908)911-7009
(908)757-9655
(908)524-3710
(908)610-9921
(908)381-6159
(908)560-2418
(908)826-1334
(906)339-8184
(903)671-8520
(903)308-8044
(903)737-2584
(903)500-2834
(903)429-5794
(903)292-0499
(903)977-9111
(903)209-4775
(903)565-2710
(901)223-7794
We see that the solver produces a number of inputs that all satisfy the constraint - the area code is always more than 900.
Expand Down

0 comments on commit 5bc79e6

Please sign in to comment.