Documentation ¶
Index ¶
- type Scanner
- func (s *Scanner) DebugRequest(req *http.Request)
- func (s *Scanner) DebugResponse(resp *http.Response)
- func (s *Scanner) MakeRequest(method string, payload string, link string, header string, ...)
- func (s *Scanner) Scan(url string, payload string, header string)
- func (s *Scanner) Setheaders(host string, headers map[string]interface{}, res *string) chromedp.Tasks
- type ScannerInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scanner ¶
type Scanner struct { AppendMode bool IsParameters bool RateLimit float64 FollowRedirects bool Client *http.Client Limiter *rate.Limiter Debug bool ShowTimestamp bool }
func NewScanner ¶
func (*Scanner) DebugRequest ¶
DebugRequest dumps the request to the console in a human-readable format if s.Debug is true.
func (*Scanner) DebugResponse ¶
DebugResponse dumps the response to the console in a human-readable format if s.Debug is true. This includes the response headers and the response body.
func (*Scanner) MakeRequest ¶
func (s *Scanner) MakeRequest(method string, payload string, link string, header string, appendMode, isParameters bool)
MakeRequest constructs and sends an HTTP request with the specified method, payload, and headers to the given link. If isParameters is true, the payload is appended to each query parameter. The function also allows setting custom headers and handles special cases for the User-Agent header. It uses chromedp to modify the request and navigate to the link. If ShowTimestamp is true, a timestamp is printed. If Debug is true, the request and response are dumped to the console. The function returns no value.
func (*Scanner) Scan ¶
Scan sends HTTP requests with different methods to a specified URL using a given payload and header. It respects the rate limiting if a limiter is set, pausing for a short duration between requests. The function iterates over a list of HTTP methods (GET, POST, OPTIONS, PUT) and invokes MakeRequest for each, using the provided payload and header. The function outputs the header and payload details to the console in a colored format.
type ScannerInterface ¶
type ScannerInterface interface {
Scan(url string)
}