Add missing 's'

This commit is contained in:
Joshua Martinelle 2023-09-01 15:05:06 +02:00
parent 715c91b827
commit 467ceca320
2 changed files with 62 additions and 62 deletions

View File

@ -1519,10 +1519,10 @@ retry:
}
var (
serverResponseRaw string
request string
rawResponseHeader string
responseHeader map[string]interface{}
serverResponseRaw string
request string
rawResponseHeaders string
responseHeaders map[string]interface{}
)
respData := string(resp.Data)
@ -1533,13 +1533,13 @@ retry:
if scanopts.ResponseInStdout || r.options.OutputMatchCondition != "" || r.options.OutputFilterCondition != "" {
serverResponseRaw = string(respData)
request = string(requestDump)
responseHeader = normalizeHeaders(resp.Headers)
rawResponseHeader = resp.RawHeaders
responseHeaders = normalizeHeaders(resp.Headers)
rawResponseHeaders = resp.RawHeaders
} else if scanopts.Base64ResponseInStdout {
serverResponseRaw = stringz.Base64([]byte(respData))
request = stringz.Base64(requestDump)
responseHeader = normalizeHeaders(resp.Headers)
rawResponseHeader = stringz.Base64([]byte(resp.RawHeaders))
responseHeaders = normalizeHeaders(resp.Headers)
rawResponseHeaders = stringz.Base64([]byte(resp.RawHeaders))
}
// check for virtual host
@ -1882,8 +1882,8 @@ retry:
result := Result{
Timestamp: time.Now(),
Request: request,
ResponseHeader: responseHeader,
RawHeader: rawResponseHeader,
ResponseHeaders: responseHeaders,
RawHeaders: rawResponseHeaders,
Scheme: parsed.Scheme,
Port: finalPort,
Path: finalPath,

View File

@ -26,64 +26,64 @@ func (o AsnResponse) String() string {
// Result of a scan
type Result struct {
Timestamp time.Time `json:"timestamp,omitempty" csv:"timestamp"`
ASN *AsnResponse `json:"asn,omitempty" csv:"asn"`
Err error `json:"-" csv:"-"`
CSPData *httpx.CSPData `json:"csp,omitempty" csv:"csp"`
TLSData *clients.Response `json:"tls,omitempty" csv:"tls"`
Hashes map[string]interface{} `json:"hash,omitempty" csv:"hash"`
ExtractRegex []string `json:"extract_regex,omitempty" csv:"extract_regex"`
CDNName string `json:"cdn_name,omitempty" csv:"cdn_name"`
Port string `json:"port,omitempty" csv:"port"`
Raw string `json:"-" csv:"-"`
URL string `json:"url,omitempty" csv:"url"`
Input string `json:"input,omitempty" csv:"input"`
Location string `json:"location,omitempty" csv:"location"`
Title string `json:"title,omitempty" csv:"title"`
Timestamp time.Time `json:"timestamp,omitempty" csv:"timestamp"`
ASN *AsnResponse `json:"asn,omitempty" csv:"asn"`
Err error `json:"-" csv:"-"`
CSPData *httpx.CSPData `json:"csp,omitempty" csv:"csp"`
TLSData *clients.Response `json:"tls,omitempty" csv:"tls"`
Hashes map[string]interface{} `json:"hash,omitempty" csv:"hash"`
ExtractRegex []string `json:"extract_regex,omitempty" csv:"extract_regex"`
CDNName string `json:"cdn_name,omitempty" csv:"cdn_name"`
Port string `json:"port,omitempty" csv:"port"`
Raw string `json:"-" csv:"-"`
URL string `json:"url,omitempty" csv:"url"`
Input string `json:"input,omitempty" csv:"input"`
Location string `json:"location,omitempty" csv:"location"`
Title string `json:"title,omitempty" csv:"title"`
str string
Scheme string `json:"scheme,omitempty" csv:"scheme"`
Error string `json:"error,omitempty" csv:"error"`
WebServer string `json:"webserver,omitempty" csv:"webserver"`
ResponseBody string `json:"body,omitempty" csv:"body"`
ContentType string `json:"content_type,omitempty" csv:"content_type"`
Method string `json:"method,omitempty" csv:"method"`
Host string `json:"host,omitempty" csv:"host"`
Path string `json:"path,omitempty" csv:"path"`
FavIconMMH3 string `json:"favicon,omitempty" csv:"favicon"`
FaviconPath string `json:"favicon_path,omitempty" csv:"favicon_path"`
FinalURL string `json:"final_url,omitempty" csv:"final_url"`
ResponseHeader map[string]interface{} `json:"header,omitempty" csv:"header"`
RawHeader string `json:"raw_header,omitempty" csv:"raw_header"`
Request string `json:"request,omitempty" csv:"request"`
ResponseTime string `json:"time,omitempty" csv:"time"`
Jarm string `json:"jarm,omitempty" csv:"jarm"`
ChainStatusCodes []int `json:"chain_status_codes,omitempty" csv:"chain_status_codes"`
A []string `json:"a,omitempty" csv:"a"`
CNAMEs []string `json:"cname,omitempty" csv:"cname"`
Technologies []string `json:"tech,omitempty" csv:"tech"`
Extracts map[string][]string `json:"extracts,omitempty" csv:"extracts"`
Chain []httpx.ChainItem `json:"chain,omitempty" csv:"chain"`
Words int `json:"words" csv:"words"`
Lines int `json:"lines" csv:"lines"`
StatusCode int `json:"status_code,omitempty" csv:"status_code"`
ContentLength int `json:"content_length,omitempty" csv:"content_length"`
Failed bool `json:"failed" csv:"failed"`
VHost bool `json:"vhost,omitempty" csv:"vhost"`
WebSocket bool `json:"websocket,omitempty" csv:"websocket"`
CDN bool `json:"cdn,omitempty" csv:"cdn"`
HTTP2 bool `json:"http2,omitempty" csv:"http2"`
Pipeline bool `json:"pipeline,omitempty" csv:"pipeline"`
HeadlessBody string `json:"headless_body,omitempty" csv:"headless_body"`
ScreenshotBytes []byte `json:"screenshot_bytes,omitempty" csv:"screenshot_bytes"`
StoredResponsePath string `json:"stored_response_path,omitempty" csv:"stored_response_path"`
ScreenshotPath string `json:"screenshot_path,omitempty" csv:"screenshot_path"`
KnowledgeBase map[string]interface{} `json:"knowledgebase,omitempty" csv:"knowledgebase"`
Scheme string `json:"scheme,omitempty" csv:"scheme"`
Error string `json:"error,omitempty" csv:"error"`
WebServer string `json:"webserver,omitempty" csv:"webserver"`
ResponseBody string `json:"body,omitempty" csv:"body"`
ContentType string `json:"content_type,omitempty" csv:"content_type"`
Method string `json:"method,omitempty" csv:"method"`
Host string `json:"host,omitempty" csv:"host"`
Path string `json:"path,omitempty" csv:"path"`
FavIconMMH3 string `json:"favicon,omitempty" csv:"favicon"`
FaviconPath string `json:"favicon_path,omitempty" csv:"favicon_path"`
FinalURL string `json:"final_url,omitempty" csv:"final_url"`
ResponseHeaders map[string]interface{} `json:"header,omitempty" csv:"headers"`
RawHeaders string `json:"raw_headers,omitempty" csv:"raw_headers"`
Request string `json:"request,omitempty" csv:"request"`
ResponseTime string `json:"time,omitempty" csv:"time"`
Jarm string `json:"jarm,omitempty" csv:"jarm"`
ChainStatusCodes []int `json:"chain_status_codes,omitempty" csv:"chain_status_codes"`
A []string `json:"a,omitempty" csv:"a"`
CNAMEs []string `json:"cname,omitempty" csv:"cname"`
Technologies []string `json:"tech,omitempty" csv:"tech"`
Extracts map[string][]string `json:"extracts,omitempty" csv:"extracts"`
Chain []httpx.ChainItem `json:"chain,omitempty" csv:"chain"`
Words int `json:"words" csv:"words"`
Lines int `json:"lines" csv:"lines"`
StatusCode int `json:"status_code,omitempty" csv:"status_code"`
ContentLength int `json:"content_length,omitempty" csv:"content_length"`
Failed bool `json:"failed" csv:"failed"`
VHost bool `json:"vhost,omitempty" csv:"vhost"`
WebSocket bool `json:"websocket,omitempty" csv:"websocket"`
CDN bool `json:"cdn,omitempty" csv:"cdn"`
HTTP2 bool `json:"http2,omitempty" csv:"http2"`
Pipeline bool `json:"pipeline,omitempty" csv:"pipeline"`
HeadlessBody string `json:"headless_body,omitempty" csv:"headless_body"`
ScreenshotBytes []byte `json:"screenshot_bytes,omitempty" csv:"screenshot_bytes"`
StoredResponsePath string `json:"stored_response_path,omitempty" csv:"stored_response_path"`
ScreenshotPath string `json:"screenshot_path,omitempty" csv:"screenshot_path"`
KnowledgeBase map[string]interface{} `json:"knowledgebase,omitempty" csv:"knowledgebase"`
}
// function to get dsl variables from result struct
func dslVariables() ([]string, error) {
fakeResult := Result{}
fieldsToIgnore := []string{"Hashes", "ResponseHeader", "Err", "KnowledgeBase"}
fieldsToIgnore := []string{"Hashes", "ResponseHeaders", "Err", "KnowledgeBase"}
if err := faker.FakeData(&fakeResult, options.WithFieldsToIgnore(fieldsToIgnore...)); err != nil {
return nil, err
}