Merge branch 'origin/proxy_v2' into proxy_v2/playground

This commit is contained in:
joncrangle
2023-12-10 23:44:46 -05:00
committed by GitHub
67 changed files with 463 additions and 125 deletions

View File

@@ -1,9 +1,10 @@
package handlers
import (
"ladder/proxychain"
rx "ladder/proxychain/requestmodifiers"
tx "ladder/proxychain/responsemodifiers"
rx "github.com/everywall/ladder/proxychain/requestmodifiers"
tx "github.com/everywall/ladder/proxychain/responsemodifiers"
"github.com/everywall/ladder/proxychain"
"github.com/gofiber/fiber/v2"
)

View File

@@ -2,8 +2,9 @@ package handlers
import (
"encoding/json"
"github.com/everywall/ladder/proxychain/responsemodifiers/api"
"github.com/gofiber/fiber/v2"
"ladder/proxychain/responsemodifiers/api"
)
func NewAPIModifersListHandler(opts *ProxyOptions) fiber.Handler {

View File

@@ -146,7 +146,7 @@ package handlers
// for use in proxychains.
import (
"ladder/proxychain/responsemodifiers/api"
"github.com/everywall/ladder/proxychain/responsemodifiers/api"
)
type ModifiersAPIResponse struct {

View File

@@ -5,7 +5,7 @@ package handlers
// for use in proxychains.
import (
"ladder/proxychain/responsemodifiers/api"
"github.com/everywall/ladder/proxychain/responsemodifiers/api"
)
type ModifiersAPIResponse struct {
@@ -160,7 +160,7 @@ var AllMods Modifiers = Modifiers{
Description: "DeleteOutGoingCookiesExcept prevents non-whitelisted cookies from being sent from the client to the upstream proxy server. Cookies whose names are in the whitelist are not removed.",
CodeEditLink: "https://github.com/joncrangle/ladder.git/edit/proxy_v2/playground/proxychain/requestmodifiers/modify_outgoing_cookies.go",
Params: []Param{
{Name: "whitelist", Type: "&{Ellipsis:12348 Elt:string}"},
{Name: "whitelist", Type: "&{Ellipsis:12476 Elt:string}"},
},
},
{
@@ -485,7 +485,7 @@ var AllMods Modifiers = Modifiers{
Description: "DeleteIncomingCookies prevents ALL cookies from being sent from the proxy server back down to the client.",
CodeEditLink: "https://github.com/joncrangle/ladder.git/edit/proxy_v2/playground/proxychain/responsemodifiers/modify_incoming_cookies.go",
Params: []Param{
{Name: "_", Type: "&{Ellipsis:16319 Elt:string}"},
{Name: "_", Type: "&{Ellipsis:18780 Elt:string}"},
},
},
{
@@ -493,7 +493,7 @@ var AllMods Modifiers = Modifiers{
Description: "DeleteIncomingCookiesExcept prevents non-whitelisted cookies from being sent from the proxy server to the client. Cookies whose names are in the whitelist are not removed.",
CodeEditLink: "https://github.com/joncrangle/ladder.git/edit/proxy_v2/playground/proxychain/responsemodifiers/modify_incoming_cookies.go",
Params: []Param{
{Name: "whitelist", Type: "&{Ellipsis:16864 Elt:string}"},
{Name: "whitelist", Type: "&{Ellipsis:19325 Elt:string}"},
},
},
{
@@ -513,6 +513,15 @@ var AllMods Modifiers = Modifiers{
{Name: "val", Type: "string"},
},
},
{
Name: "ModifyIncomingScriptsWithRegex",
Description: "ModifyIncomingScriptsWithRegex modifies all incoming javascript (application/javascript and inline <script> in text/html) using a regex match and replacement.",
CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/modify_incoming_scripts_with_regex.go",
Params: []Param{
{Name: "matchRegex", Type: "string"},
{Name: "replacement", Type: "string"},
},
},
{
Name: "SetResponseHeader",
Description: "SetResponseHeader modifies response headers from the upstream server",

View File

@@ -1,9 +1,10 @@
package handlers
import (
"ladder/proxychain"
rx "ladder/proxychain/requestmodifiers"
tx "ladder/proxychain/responsemodifiers"
rx "github.com/everywall/ladder/proxychain/requestmodifiers"
tx "github.com/everywall/ladder/proxychain/responsemodifiers"
"github.com/everywall/ladder/proxychain"
"github.com/gofiber/fiber/v2"
)

View File

@@ -1,9 +1,10 @@
package handlers
import (
"ladder/proxychain"
rx "ladder/proxychain/requestmodifiers"
tx "ladder/proxychain/responsemodifiers"
rx "github.com/everywall/ladder/proxychain/requestmodifiers"
tx "github.com/everywall/ladder/proxychain/responsemodifiers"
"github.com/everywall/ladder/proxychain"
"github.com/gofiber/fiber/v2"
)

View File

@@ -1,10 +1,11 @@
package handlers
import (
"ladder/proxychain"
rx "ladder/proxychain/requestmodifiers"
tx "ladder/proxychain/responsemodifiers"
"ladder/proxychain/ruleset"
rx "github.com/everywall/ladder/proxychain/requestmodifiers"
tx "github.com/everywall/ladder/proxychain/responsemodifiers"
"github.com/everywall/ladder/proxychain"
ruleset_v2 "github.com/everywall/ladder/proxychain/ruleset"
"github.com/gofiber/fiber/v2"
)
@@ -44,7 +45,7 @@ func NewProxySiteHandler(opts *ProxyOptions) fiber.Handler {
).
AddResponseModifications(
tx.ForwardResponseHeaders(),
//tx.BlockThirdPartyScripts(),
tx.BlockThirdPartyScripts(),
tx.DeleteIncomingCookies(),
tx.DeleteLocalStorageData(),
tx.DeleteSessionStorageData(),
@@ -53,7 +54,7 @@ func NewProxySiteHandler(opts *ProxyOptions) fiber.Handler {
tx.RewriteHTMLResourceURLs(),
tx.PatchDynamicResourceURLs(),
tx.PatchTrackerScripts(),
tx.BlockElementRemoval(".article-content"), // techcrunch
//tx.BlockElementRemoval(".article-content"), // techcrunch
//tx.BlockElementRemoval(".available-content"), // substack
// tx.SetContentSecurityPolicy("default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;"),
)