Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions afl.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ func runAFL(fuzzingPath string, fuzzerNumber int) {
createScript(fuzzingPath, i)
createSeed(fuzzingPath, i)

u, _ := url.Parse(fuzzStat.Targets[i].TargetPath)
os.Setenv("SCRIPT_FILENAME", "/app" + u.Path)
fmt.Println("SCRIPT_FILENAME" + "/app" + u.Path)

// cmd := exec.Command("sh", fuzzingPath + "/run.sh")
cmd := exec.Command(script[1], script[2:]...)
stdout, _ := cmd.StdoutPipe()
Expand Down Expand Up @@ -248,7 +252,7 @@ func createFuzzStat(fuzzingPath string) {
fuzzStat.Targets = []fuzzTarget{}

for key, value := range requestData.RequestsFound {
targetURL := strings.Split(value.URL, "?")[0]
targetURL := strings.Split(value.URLString, "?")[0]
method := strings.Split(key, " ")[0]
_, exist := uniqCheck[targetURL]

Expand All @@ -263,7 +267,7 @@ func createFuzzStat(fuzzingPath string) {
Methods: make(map[string]int),
}

tempFuzzTarget.TargetPath = strings.Split(value.URL, "?")[0]
tempFuzzTarget.TargetPath = strings.Split(value.URLString, "?")[0]
tempFuzzTarget.Requests = append(tempFuzzTarget.Requests, key)
tempFuzzTarget.Methods[method] = 1

Expand Down
22 changes: 11 additions & 11 deletions json/config.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"testname": "test",
"afl_path": "/afl",
"target_binary": "/httpreqr --json --url ",
"base_url": "http://localhost:@@PORT_INCREMENT@@/",
"base_port": 3000,
"timeout" : 60,
"afl_path": "/afl/",
"target_binary": "/usr/local/bin/php-cgi ",
"base_url": "http://localhost:{PORT}",
"base_port": 80,
"timeout" : 200,
"ld_library_path": "/lib",
"ld_preload": "/lib/hook_recv.so",
"memory": "8G",
"first_crash": true,
"cores": 1,
"login": {
"url": "http://localhost",
"port": 3000,
"postData": "id=admin&pw=admin",
"url": "http://localhost/login.php",
"port": 80,
"postData": "username=admin&password=admin&&Login=Login",
"getData": "id=guest&pw=guest",
"positiveHeaders": {"content-type": "Application/json"},
"positiveHeaders": {"content-type": "application/x-www-form-urlencoded"},
"positiveBody": "",
"method": "POST",
"loginSessionCookie" : ""
"loginSessionCookie" : "PHPSESSID"
}
}
}
Loading