add response / request modifier API to only fire once

This commit is contained in:
Kevin Pham
2023-11-26 23:15:00 -06:00
parent a295f2a167
commit fb63dba8a0
9 changed files with 44 additions and 56 deletions

View File

@@ -21,13 +21,11 @@ func MasqueradeAsBingBot() proxychain.RequestModification {
}
func masqueradeAsTrustedBot(botUA string, botIP string) proxychain.RequestModification {
return func(px *proxychain.ProxyChain) error {
px.AddRequestModifications(
SpoofUserAgent(botUA),
SpoofXForwardedFor(botIP),
SpoofReferrer(""),
SpoofOrigin(""),
)
return func(chain *proxychain.ProxyChain) error {
chain.Request.Header.Set("user-agent", botUA)
chain.Request.Header.Set("x-forwarded-for", botIP)
chain.Request.Header.Del("referrer")
chain.Request.Header.Del("origin")
return nil
}
}