scan

package
v2.0.0-...-e50e7ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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 NewScanner(limiter *rate.Limiter, rateLimit float64, followRedirects bool, appendMode, parameters bool, debug bool, showTimeStamp bool) *Scanner

func (*Scanner) DebugRequest

func (s *Scanner) DebugRequest(req *http.Request)

DebugRequest dumps the request to the console in a human-readable format if s.Debug is true.

func (*Scanner) DebugResponse

func (s *Scanner) DebugResponse(resp *http.Response)

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

func (s *Scanner) Scan(url string, payload string, header string)

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.

func (*Scanner) Setheaders

func (s *Scanner) Setheaders(host string, headers map[string]interface{}, res *string) chromedp.Tasks

setheaders returns a task list that sets the passed headers.

type ScannerInterface

type ScannerInterface interface {
	Scan(url string)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL