Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Commit 83a4a5c

Browse files
committed
fix error logging
1 parent 554cb50 commit 83a4a5c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

utils/engines/pathTraversal.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func RunPathTraversalEngine(ctx context.Context, config *methodwebtest.PathTrave
5353
// Follow redirects to get the correct baseline size and word count
5454
baselineSize, baselineWords, err := baseLine(baseURL, parsedTargetPath, validCodes, config.Timeout, true)
5555
if err != nil {
56+
err = errors.New("failed to get baseline body, stopping enumeration")
5657
allErrors = append(allErrors, err.Error())
5758
continue
5859
}
@@ -64,6 +65,7 @@ func RunPathTraversalEngine(ctx context.Context, config *methodwebtest.PathTrave
6465
// This is to prevent false positives from remote configurations that dont redirect but give blanket responses on all paths
6566
baselineSizeRandomPath, baselineWordsRandomPath, err := baseLine(baseURL, "xxxx", validCodes, config.Timeout, false)
6667
if err != nil {
68+
err = errors.New("failed to get baseline random path, continuing enumeration")
6769
allErrors = append(allErrors, err.Error())
6870
}
6971
if baselineSizeRandomPath != nil && baselineWordsRandomPath != nil {
@@ -168,7 +170,7 @@ func baseLine(baseTarget string, path string, validCodes map[int]bool, timeout i
168170
timeout, followRedirects)
169171

170172
if request.StatusCode == nil || !validCodes[*request.StatusCode] || request.ResponseBody == nil {
171-
return nil, nil, errors.New("failed to get baseline body")
173+
return nil, nil, errors.New("baseline request failed")
172174
}
173175

174176
bodySize := len(*request.ResponseBody)

0 commit comments

Comments
 (0)