add localstorage clearer, sessionstorage cleaer, and cachebuster modifiers

This commit is contained in:
Kevin Pham
2023-12-06 08:41:45 -06:00
parent 6192373587
commit b4dd0e5380
9 changed files with 130 additions and 28 deletions

View File

@@ -0,0 +1,28 @@
package requestmodifiers
import (
"ladder/proxychain"
"math/rand"
)
// AddCacheBusterQuery modifies query params to add a random parameter key
// In order to get the upstream network stack to serve a fresh copy of the page.
func AddCacheBusterQuery() proxychain.RequestModification {
return func(chain *proxychain.ProxyChain) error {
chain.AddOnceRequestModifications(
ModifyQueryParams("ord", randomString(15)),
)
return nil
}
}
func randomString(length int) string {
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789."
b := make([]byte, length)
for i := range b {
b[i] = charset[rand.Intn(len(charset))]
}
return string(b)
}

View File

@@ -1,6 +1,7 @@
package requestmodifiers
import (
"fmt"
"net/url"
"ladder/proxychain"
@@ -12,6 +13,7 @@ func ModifyQueryParams(key string, value string) proxychain.RequestModification
return func(chain *proxychain.ProxyChain) error {
q := chain.Request.URL.Query()
chain.Request.URL.RawQuery = modifyQueryParams(key, value, q)
fmt.Println(chain.Request.URL.String())
return nil
}
}