Skip to content
Snippets Groups Projects
Commit 1cfff28d authored by Will_Zhu MacBook Pro's avatar Will_Zhu MacBook Pro
Browse files

Merge remote-tracking branch 'origin/fuzzer' into Yuqiang-Vulnerabilities

parents d8bc76e4 3618062c
No related branches found
No related tags found
1 merge request!8Yuqiang vulnerabilities
......@@ -28,6 +28,9 @@ Proofs of Concept (PoCs that you should provide for each vulnerability):
Commands for testing (by Yang Liu):<br>
<ol>
<li>
If you want to test with 0 total number of runs (fresh start), delete config.cfg in /fuzzer if it exists.
</li>
<li>
Generate 100 fuzz.txt<br>
<code>
bash ./run_fuzzer.sh
......@@ -48,3 +51,9 @@ bash ./get_coverage.sh ./fuzzer/fuzz.txt
Replace the './fuzzer/fuzz.txt' with the txt file used.
</li>
</ol>
<hr>
<h3>
How to use Fuzzer.java
</h3>
In Fuzzer.java, main, find the 'modes.add' lines. change them or add more to modes.<br>
Those run mode will be executed one by one, one for each Fuzzer run.
\ No newline at end of file
import java.io.IOException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
/* a stub for your team's fuzzer */
......@@ -13,11 +15,26 @@ public class Fuzzer {
FileOutputStream out = null;
PrintWriter pw = null;
try {
int maxInputLineLength = 1022;
int maxNumLines = 1024;
InputGenerator inputGenerator = new InputGenerator(
1022,
1024,
maxInputLineLength,
maxNumLines,
"fuzz.txt");
inputGenerator.generateFuzz(InputGenerator.MODE.TOTAL_RANDOM);
List<InputGenerator.MODE> modes = new ArrayList<>();
// fill the list 'modes', to arrange the generating order across runs
// they will go one by one across Fuzzer runs
// add enough runs to generate all the NUM_CONTINUOUS_PUTS put commands
for (int i = 0; i < Math.ceil(1.0 * InputGenerator.NUM_CONTINUOUS_PUTS / maxNumLines); i++) {
modes.add(InputGenerator.MODE.CONTINUOUS_PUTS);
}
// testing corner cases
modes.add(InputGenerator.MODE.CORNER_CASES_THEN_RANDOM);
// total random testing
modes.add(InputGenerator.MODE.TOTAL_RANDOM);
inputGenerator.generateFuzz(modes);
}catch (Exception e){
e.printStackTrace(System.err);
System.exit(1);
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment