Skip to content

Commit

Permalink
fixes defaults in webproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
RicYaben committed Jul 28, 2024
1 parent d209322 commit 1b58107
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/upnp/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func (scanner *Scanner) Scan(target zgrab2.ScanTarget) (zgrab2.ScanStatus, inter
}

ret.Response = resp
// [4/3/2024] TODO: Handle the different HTTP status and parse the response somehow?
// [4/3/2024] TODO: Handle the different HTTP status?
// We may want to parse the location and send requests to all these places
return zgrab2.SCAN_SUCCESS, ret, nil
}
8 changes: 8 additions & 0 deletions modules/webproxy/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"errors"
"fmt"
"strings"
"time"

log "github.com/sirupsen/logrus"
"github.com/zmap/zgrab2"
Expand Down Expand Up @@ -118,13 +119,20 @@ func (scanner *Scanner) Init(flags zgrab2.ScanFlags) error {
}

// Set the request builder
if fl.Method == "" {
fl.Method = "POST"
}
reqBuilder, err := request.NewHttpRequestBuilder(fl.Method, fl.Endpoint, headers)
if err != nil {
return err
}
scanner.requestBuilder = reqBuilder

// Set the scan builder
if fl.Timeout == 0 {
fl.Timeout = 10 * time.Second
}

scanBuilder := scan.NewProxyHttpScanBuilder(fl.MaxRedirects, fl.RawHeaders, fl.UserAgent, fl.Timeout, fl.MaxSize)
scanner.scanBuilder = scanBuilder

Expand Down

0 comments on commit 1b58107

Please sign in to comment.