add common referrer options

This commit is contained in:
Kevin Pham
2023-11-21 20:33:52 -06:00
parent 0e620e46ab
commit a4e016b36c
12 changed files with 263 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package requestmodifers
import (
"fmt"
"ladder/proxychain"
"math/rand"
)
// SpoofReferrerFromWeiboPost modifies the referrer header
// pretending to be from a Weibo post (popular in China)
func SpoofReferrerFromWeiboPost(url string) proxychain.RequestModification {
return func(chain *proxychain.ProxyChain) error {
referrer := fmt.Sprintf("http://weibo.com/u/%d", rand.Intn(90001))
chain.AddRequestModifications(
SpoofReferrer(referrer),
SetRequestHeader("sec-fetch-site", "cross-site"),
SetRequestHeader("sec-fetch-dest", "document"),
SetRequestHeader("sec-fetch-mode", "navigate"),
)
return nil
}
}