pkg

package
v0.0.0-...-d905b93 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InputFile    *string
	CollabServer *string
	Threads      *int
	RateLimit    *int
	OutDir       *string
	ExtraHeader  *string
	Silent       *bool
	ColorBlind   *bool
	Verbose      *bool

	PayloadsFile  = filepath.Join(os.Getenv("HOME"), ".config", "ressrf", "payloads.cfg")
	HeadersInject = []string{
		"Base-Url", "CF-Connecting_IP", "Client-IP", "Contact",
		"Forwarded", "From", "Http-Url", "Proxy-Host", "Proxy-Url",
		"Real-Ip", "Redirect", "Referer", "Referrer", "Request-Uri",
		"True-Client-IP", "Uri", "Url", "X-Client-IP", "X-Forward-For",
		"X-Forwarded-By", "X-Forwarded-For-Original", "X-Forwarded-For",
		"X-Forwarded-Host", "X-Forwarded-Server", "X-Forwarded",
		"X-Forwarder-For", "X-Host", "X-Http-Destinationurl",
		"X-Http-Host-Override", "X-Original-Remote-Addr", "X-Original-Url",
		"X-Originating-IP", "X-Proxy-Url", "X-Real-Ip", "X-Remote-Addr",
		"X-Rewrite-Url", "X-Wap-Profile",
	}
	AltProtoRegex  = regexp.MustCompile(`169\.254\.169\.254|latest/meta-data|root:|127\.0\.0\.1|localhost|gopher://|dict://|file://`)
	QsReplaceRegex = regexp.MustCompile(`=([^?|&]*)`)
)
View Source
var (
	ClientInstance *client.Client
	SessionDomain  string
)

Global instance pointers for cleaner multi-file state reference

View Source
var HttpClient = &http.Client{
	Timeout: 10 * time.Second,
	Transport: &http.Transport{
		MaxIdleConnsPerHost: 100,
	},
	CheckRedirect: func(req *http.Request, via []*http.Request) error {
		return http.ErrUseLastResponse
	},
}

Functions

func AppendLine

func AppendLine(path, line string)

func BaseHeaders

func BaseHeaders() map[string]string

func EnsurePayloadsConfig

func EnsurePayloadsConfig(silent bool) error

EnsurePayloadsConfig ensures the payloads configuration file exists and contains the embedded default vectors.

If the configured payload file does not exist, it will be created containing the embedded defaults. If the file exists, any default vectors not already present will be appended (with a separator) so existing user content is preserved. When `silent` is false a brief status message is printed.

Errors are returned for filesystem failures such as directory creation, file reads, or writes.

func QsReplace

func QsReplace(rawURL, payload string) string

func ReadLines

func ReadLines(path string) ([]string, error)

func RunPhase

func RunPhase(name string, jobs chan<- func(), wg *sync.WaitGroup, fn func())

func SendRequest

func SendRequest(targetURL string, headers map[string]string) (int, string, error)

func StartInteractsh

func StartInteractsh() (string, error)

StartInteractsh client initializes the real-time background tracker module cleanly in memory

Types

type Options

type Options struct {
	InputFile    string
	CollabServer string
	Threads      int
	RateLimit    int
	OutDir       string
	ExtraHeader  string
	Silent       bool
	ColorBlind   bool
	Verbose      bool
}

func ParseOptions

func ParseOptions() (*Options, error)

ParseOptions parses command-line flags into an Options value and initializes package-level option pointers.

It validates the optional InputFile when provided (must exist, must not be a directory, must be non-empty). It also ensures the payloads configuration is present by running the sync routine and will return an error if that setup fails. Returns the populated *Options on success or a non-nil error if flag parsing, input validation, or config setup fails.

type RateLimiter

type RateLimiter struct{ Ticker *time.Ticker }

func NewRateLimiter

func NewRateLimiter(rps int) *RateLimiter

func (*RateLimiter) Wait

func (r *RateLimiter) Wait()

type VulnerabilityMetadata

type VulnerabilityMetadata struct {
	BaseURL    string
	InjectType string
	HeaderName string
}

Jump to

Keyboard shortcuts

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