From bfc867e0f07555b906ab7f3673aa3f6946a83bf9 Mon Sep 17 00:00:00 2001 From: Bluesaxorcist Date: Fri, 30 Aug 2019 14:58:15 -0500 Subject: added Dust and commented in replicant's code to the four modes for future use --- modes/pt_socks5/pt_socks5.go | 15 +++++++++++++++ modes/stun_udp/stun_udp.go | 17 +++++++++++++++++ modes/transparent_tcp/transparent_tcp.go | 25 +++++++++++++++++++++++++ modes/transparent_udp/transparent_udp.go | 17 +++++++++++++++++ 4 files changed, 74 insertions(+) diff --git a/modes/pt_socks5/pt_socks5.go b/modes/pt_socks5/pt_socks5.go index 240f3c0..dfd7359 100644 --- a/modes/pt_socks5/pt_socks5.go +++ b/modes/pt_socks5/pt_socks5.go @@ -31,6 +31,7 @@ package pt_socks5 import ( "github.com/OperatorFoundation/shapeshifter-dispatcher/common/pt_extras" + "github.com/OperatorFoundation/shapeshifter-transports/transports/Dust" "github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite" "github.com/OperatorFoundation/shapeshifter-transports/transports/shadow" "io" @@ -191,6 +192,20 @@ 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 "Dust": + idPath, ok :=args.Get("idPath") + if !ok { + return false, nil + } + transport := Dust.NewDustServer(idPath) + listen = transport.Listen case "meeklite": Url, ok := args.Get("Url") if !ok { diff --git a/modes/stun_udp/stun_udp.go b/modes/stun_udp/stun_udp.go index 511d7c9..f12e69e 100644 --- a/modes/stun_udp/stun_udp.go +++ b/modes/stun_udp/stun_udp.go @@ -32,6 +32,7 @@ package stun_udp import ( "fmt" "github.com/OperatorFoundation/shapeshifter-dispatcher/common/pt_extras" + "github.com/OperatorFoundation/shapeshifter-transports/transports/Dust" "github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite" "github.com/OperatorFoundation/shapeshifter-transports/transports/shadow" "io" @@ -242,6 +243,22 @@ func ServerSetup(termMon *termmon.TermMonitor, bindaddrString string, ptServerIn log.Errorf("meeklite transport missing Front argument: %s", args) return } + //case "replicant": + // if config, ok := args["config"]; ok { + // transport := replicant.New(config[0]) + // listen = transport.Listen + // } else { + // log.Errorf("replicant transport missing config argument: %s", args) + // return + // } + case "Dust": + if idPath, ok := args["idPath"]; ok { + transport := Dust.NewDustServer(idPath[0]) + listen = transport.Listen + } else { + log.Errorf("Dust transport missing idPath argument: %s", args) + return + } case "shadow": if password, ok := args["password"]; ok { if cipher, ok2 := args["cipherName"]; ok2 { diff --git a/modes/transparent_tcp/transparent_tcp.go b/modes/transparent_tcp/transparent_tcp.go index def348f..faffa15 100644 --- a/modes/transparent_tcp/transparent_tcp.go +++ b/modes/transparent_tcp/transparent_tcp.go @@ -32,6 +32,7 @@ package transparent_tcp import ( "fmt" "github.com/OperatorFoundation/shapeshifter-dispatcher/common/pt_extras" + "github.com/OperatorFoundation/shapeshifter-transports/transports/Dust" "github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite" "github.com/OperatorFoundation/shapeshifter-transports/transports/obfs2" "io" @@ -165,6 +166,30 @@ 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 "Dust": + shargs, aok := args["Dust"] + if !aok { + return false, nil + } + + idPath, ok := shargs.Get("Url") + if !ok { + return false, nil + } + transport := Dust.NewDustServer(idPath) + listen = transport.Listen case "meeklite": shargs, aok := args["meeklite"] if !aok { diff --git a/modes/transparent_udp/transparent_udp.go b/modes/transparent_udp/transparent_udp.go index eeb8f35..3352228 100644 --- a/modes/transparent_udp/transparent_udp.go +++ b/modes/transparent_udp/transparent_udp.go @@ -34,6 +34,7 @@ import ( "encoding/binary" "fmt" "github.com/OperatorFoundation/shapeshifter-dispatcher/common/pt_extras" + "github.com/OperatorFoundation/shapeshifter-transports/transports/Dust" "github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite" "github.com/OperatorFoundation/shapeshifter-transports/transports/shadow" "io" @@ -241,6 +242,22 @@ 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 "Dust": + idPath, ok := args.Get("idPath") + if !ok { + return false, nil + } + + transport := Dust.NewDustServer(idPath) + listen = transport.Listen case "meeklite": Url, ok := args.Get("Url") if !ok { -- cgit v1.2.3