From 43d0e72c72600a1bc75518a8dfe31c279b4a9400 Mon Sep 17 00:00:00 2001 From: Bluesaxorcist Date: Sun, 15 Sep 2019 20:21:00 -0500 Subject: Added Dust, Meeklite, and Replicant to dispatcher modes Still needs fixing --- modes/pt_socks5/pt_socks5.go | 4 +++- modes/stun_udp/stun_udp.go | 5 +++-- modes/transparent_tcp/transparent_tcp.go | 26 ++++++++++++++------------ modes/transparent_udp/transparent_udp.go | 18 ++++++++++-------- 4 files changed, 30 insertions(+), 23 deletions(-) (limited to 'modes') diff --git a/modes/pt_socks5/pt_socks5.go b/modes/pt_socks5/pt_socks5.go index 45cbbf2..59c4a7c 100644 --- a/modes/pt_socks5/pt_socks5.go +++ b/modes/pt_socks5/pt_socks5.go @@ -30,6 +30,7 @@ package pt_socks5 import ( + "fmt" options2 "github.com/OperatorFoundation/shapeshifter-dispatcher/common" "github.com/OperatorFoundation/shapeshifter-dispatcher/common/pt_extras" "github.com/OperatorFoundation/shapeshifter-transports/transports/Dust" @@ -202,10 +203,11 @@ func ServerSetup(termMon *termmon.TermMonitor, bindaddrString string, ptServerIn } case "replicant": config, ok :=args.Get("config") + fmt.Println(config) if !ok { return false, nil } - transport := replicant.New(config) + transport := replicant.New(replicant.Config{}) listen = transport.Listen case "Dust": idPath, ok :=args.Get("idPath") diff --git a/modes/stun_udp/stun_udp.go b/modes/stun_udp/stun_udp.go index 564e562..70d5565 100644 --- a/modes/stun_udp/stun_udp.go +++ b/modes/stun_udp/stun_udp.go @@ -246,7 +246,8 @@ func ServerSetup(termMon *termmon.TermMonitor, bindaddrString string, ptServerIn return } case "replicant": - if _, ok := args["config"]; ok { + if config, ok := args["config"]; ok { + fmt.Println(config) transport := replicant.New(replicant.Config{}) listen = transport.Listen } else { @@ -436,4 +437,4 @@ func serverHandler(termMon *termmon.TermMonitor, name string, remote net.Conn, i dest.Write(writeBuffer) } -} +} \ No newline at end of file diff --git a/modes/transparent_tcp/transparent_tcp.go b/modes/transparent_tcp/transparent_tcp.go index a1addf3..5535bd6 100644 --- a/modes/transparent_tcp/transparent_tcp.go +++ b/modes/transparent_tcp/transparent_tcp.go @@ -34,6 +34,7 @@ import ( options2 "github.com/OperatorFoundation/shapeshifter-dispatcher/common" "github.com/OperatorFoundation/shapeshifter-dispatcher/common/pt_extras" "github.com/OperatorFoundation/shapeshifter-transports/transports/Dust" + replicant "github.com/OperatorFoundation/shapeshifter-transports/transports/Replicant" "github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite" "github.com/OperatorFoundation/shapeshifter-transports/transports/obfs2" "io" @@ -167,18 +168,18 @@ func ServerSetup(termMon *termmon.TermMonitor, bindaddrString string, ptServerIn case "obfs4": transport := obfs4.NewObfs4Server(statedir) listen = transport.Listen - //case "Replicant": - // shargs, aok := args["Replicant"] - // if !aok { - // return false, nil - // } - // - // config, ok := shargs.Get("config") - // if !ok { - // return false, nil - // } - // transport := replicant.New(config) - // listen = transport.Listen + case "Replicant": + shargs, aok := args["Replicant"] + if !aok { + return false, nil + } + + _, ok := shargs.Get("config") + if !ok { + return false, nil + } + transport := replicant.New(replicant.Config{}) + listen = transport.Listen case "Dust": shargs, aok := args["Dust"] if !aok { @@ -339,3 +340,4 @@ func copyLoop(a net.Conn, b net.Conn) error { return nil } + diff --git a/modes/transparent_udp/transparent_udp.go b/modes/transparent_udp/transparent_udp.go index 05235d7..8d29453 100644 --- a/modes/transparent_udp/transparent_udp.go +++ b/modes/transparent_udp/transparent_udp.go @@ -36,6 +36,7 @@ import ( options2 "github.com/OperatorFoundation/shapeshifter-dispatcher/common" "github.com/OperatorFoundation/shapeshifter-dispatcher/common/pt_extras" "github.com/OperatorFoundation/shapeshifter-transports/transports/Dust" + replicant "github.com/OperatorFoundation/shapeshifter-transports/transports/Replicant" "github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite" "github.com/OperatorFoundation/shapeshifter-transports/transports/shadow" "io" @@ -243,14 +244,15 @@ func ServerSetup(termMon *termmon.TermMonitor, bindaddrString string, ptServerIn log.Errorf("obfs4 transport missing cert argument: %s", args) return } - //case "Replicant": - // Config, ok := args.Get("config") - // if !ok { - // return false, nil - // } - // - // transport := replicant.New(Config) - // listen = transport.Listen + case "Replicant": + config, ok := args.Get("config") + fmt.Println(config) + if !ok { + return false, nil + } + + transport := replicant.New(replicant.Config{}) + listen = transport.Listen case "Dust": idPath, ok := args.Get("idPath") if !ok { -- cgit v1.2.3