fixed #2603 set User-Agent bypass Go-http-client for waf 2022-12-03 (#2958)

dev
51pwn 2022-12-05 01:00:38 +08:00 committed by GitHub
parent 514c6e2d1e
commit 38cfc1c183
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"encoding/base64" "encoding/base64"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/corpix/uarand"
"io" "io"
"net/http" "net/http"
"time" "time"
@ -112,6 +113,7 @@ func (exporter *Exporter) Export(event *output.ResultEvent) error {
if len(exporter.authentication) > 0 { if len(exporter.authentication) > 0 {
req.Header.Add("Authorization", exporter.authentication) req.Header.Add("Authorization", exporter.authentication)
} }
req.Header.Set("User-Agent", uarand.GetRandom())
req.Header.Add("Content-Type", "application/json") req.Header.Add("Content-Type", "application/json")
d := data{ d := data{