For Http Injector: Remote Proxy
- remote proxy for http injector
- remote proxy for http injector
For Http Injector: Remote Proxy
type connPool struct { sync.Mutex conns map[string][]net.Conn } func (p *connPool) Get(addr string) net.Conn { p.Lock() defer p.Unlock() if pool, ok := p.conns[addr]; ok && len(pool) > 0 { conn := pool[len(pool)-1] p.conns[addr] = pool[:len(pool)-1] return conn } return nil }
var ( listenAddr = flag.String("listen", ":8080", "HTTP proxy listen address") ) remote proxy for http injector
// Ensure port is present if !strings.Contains(dest, ":") { dest = dest + ":80" // default to HTTP } type connPool struct { sync
go build -o remote-proxy proxy.go
func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { // Handle both CONNECT and normal HTTP requests with custom payload if r.Method == http.MethodConnect { handleInjectorTunnel(w, r) return } handleInjectorTunnel(w, r) // also handle GET/POST injector payloads }) ok := p.conns[addr]
func handleInjectorTunnel(w http.ResponseWriter, r *http.Request) { dest, err := extractDestination(r) if err != nil { http.Error(w, "Missing destination", http.StatusBadRequest) return }
Example payload from Injector:
