File tree Expand file tree Collapse file tree 3 files changed +12
-13
lines changed Expand file tree Collapse file tree 3 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ fuzz "My Web App" do
190
190
data " JSON generated from a template" do
191
191
t = FuzzBert ::Template .new ' { user: { id: ${id}, name: "${name}" } }'
192
192
t.set(:id , FuzzBert ::Generators .cycle(1 ..10000 ))
193
- t.set(:name ) { " fixed " + FuzzBert ::Generators .random_fixlen(2 ).call }
193
+ t.set(:name ) { " Fixed text plus two random bytes: #{ FuzzBert ::Generators .random_fixlen(2 ).call} " }
194
194
t.generator
195
195
end
196
196
Original file line number Diff line number Diff line change @@ -15,21 +15,16 @@ def handle(error_data)
15
15
end
16
16
end
17
17
18
- fuzz "OpenSSL command line (asn1parse) " do
18
+ fuzz "Some application " do
19
19
20
20
deploy do |data |
21
- IO . popen ( "openssl asn1parse -inform DER -noout" , "w" ) do |io |
22
- io . write ( data )
23
- end
24
- status = $?
25
- unless status . exited? && status . success?
26
- raise RuntimeError . new ( "bug!" )
27
- end
21
+ #send the generated data to your application here instead
22
+ p data
28
23
end
29
24
30
25
data ( "completely random" ) { FuzzBert ::Generators . random }
31
26
32
- data "Indefinite length sequence " do
27
+ data "Payload " do
33
28
c = FuzzBert ::Container . new
34
29
c << FuzzBert ::Generators . fixed ( "\x30 \x80 " )
35
30
c << FuzzBert ::Generators . random
Original file line number Diff line number Diff line change 2
2
3
3
fuzz "Web App" do
4
4
deploy do |data |
5
- #send JSON data via HTTP
5
+ #send JSON data via HTTP here instead
6
+ p data
6
7
end
7
8
8
9
data "template" do
9
10
t = FuzzBert ::Template . new <<-EOS
10
11
{ user: { id: ${id}, name: "${name}", text: "${text}" } }
11
12
EOS
12
13
t . set ( :id , FuzzBert ::Generators . cycle ( 1 ..10000 ) )
13
- t . set ( :name ) { "fixed" + FuzzBert ::Generators . random . call }
14
- t . set ( :text , FuzzBert ::Generators . random )
14
+ name = FuzzBert ::Container . new
15
+ name << FuzzBert ::Generators . fixed ( "fixed" )
16
+ name << FuzzBert ::Generators . random_fixlen ( 2 )
17
+ t . set ( :name , name . generator )
18
+ t . set ( :text ) { "Fixed text plus two random bytes: #{ FuzzBert ::Generators . random_fixlen ( 2 ) . call } " }
15
19
t . generator
16
20
end
17
21
end
You can’t perform that action at this time.
0 commit comments