From a7bf81fbdbb26a012aeb492ad16ffdd3ce7cc8cd Mon Sep 17 00:00:00 2001 From: Sonya Date: Thu, 13 Apr 2023 11:57:05 +0330 Subject: [PATCH 1/4] added xray-core --- golang/cmd.go | 2 - golang/configuration/config.go | 1 - golang/go.mod | 47 ++- golang/go.sum | 349 +++++++++++++++++- golang/main.go | 2 +- golang/run.go | 8 +- golang/scanner/scanner.go | 43 ++- golang/speedtest/download.go | 18 +- golang/speedtest/fronting.go | 16 +- golang/speedtest/upload.go | 11 +- .../{v2raysvc/v2raysvc.go => vpn/config.go} | 59 +-- golang/vpn/load.go | 21 ++ golang/vpn/types.go | 9 + golang/vpn/xray.go | 152 ++++++++ 14 files changed, 638 insertions(+), 100 deletions(-) rename golang/{v2raysvc/v2raysvc.go => vpn/config.go} (57%) create mode 100644 golang/vpn/load.go create mode 100644 golang/vpn/types.go create mode 100644 golang/vpn/xray.go diff --git a/golang/cmd.go b/golang/cmd.go index 093293d5..64c31b12 100644 --- a/golang/cmd.go +++ b/golang/cmd.go @@ -7,7 +7,6 @@ var nTries int var configPath string var subnets string -var vpnPath string var Vpn bool var doUploadTest bool @@ -45,7 +44,6 @@ func RegisterCommands(rootCmd *cobra.Command) { rootCmd.PersistentFlags().Float64Var(&maxDLLatency, "download-latency", 3.0, "Maximum allowed latency for download") rootCmd.PersistentFlags().Float64Var(&maxULLatency, "upload-latency", 3.0, "Maximum allowed latency for upload") rootCmd.PersistentFlags().Float64Var(&startProcessTimeout, "startprocess-timeout", 12, "Process timeout for v2ray") - rootCmd.PersistentFlags().StringVar(&vpnPath, "vpn-path", "", "Custom V2Ray binary path for using v2ray binary in another directory") rootCmd.PersistentFlags().StringVar(&writerType, "writer", "csv", "Custom output writer for writing interim results. [csv/json]") } diff --git a/golang/configuration/config.go b/golang/configuration/config.go index ef98f97d..eb14112d 100644 --- a/golang/configuration/config.go +++ b/golang/configuration/config.go @@ -14,7 +14,6 @@ import ( var ( PROGRAMDIR = filepath.Dir(os.Args[0]) - BIN = filepath.Join(PROGRAMDIR, "..", "bin", "v2ray") DIR = filepath.Join(PROGRAMDIR, "config") RESULTDIR = filepath.Join(PROGRAMDIR, "result") StartDtStr = time.Now().Format("2006-01-02_15:04:05") diff --git a/golang/go.mod b/golang/go.mod index 4d3937c3..73a879b7 100644 --- a/golang/go.mod +++ b/golang/go.mod @@ -1,14 +1,57 @@ module CFScanner -go 1.18 +go 1.20 require ( github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203 github.com/spf13/cobra v1.6.1 + github.com/xtls/xray-core v1.8.0 ) require ( + github.com/andybalholm/brotli v1.0.5 // indirect + github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 // indirect + github.com/francoispqt/gojay v1.2.13 // indirect + github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344 // indirect + github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect + github.com/golang/mock v1.6.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/btree v1.1.2 // indirect + github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 // indirect + github.com/gorilla/websocket v1.5.0 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/klauspost/compress v1.16.0 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect + github.com/miekg/dns v1.1.51 // indirect + github.com/onsi/ginkgo/v2 v2.9.0 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pires/go-proxyproto v0.6.2 // indirect + github.com/quic-go/qtls-go1-19 v0.2.1 // indirect + github.com/quic-go/qtls-go1-20 v0.1.1 // indirect + github.com/quic-go/quic-go v0.33.0 // indirect + github.com/refraction-networking/utls v1.2.3-0.20230308205431-4f1df6c200db // indirect + github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect + github.com/sagernet/sing v0.1.7 // indirect + github.com/sagernet/sing-shadowsocks v0.1.1 // indirect + github.com/sagernet/wireguard-go v0.0.0-20221116151939-c99467f53f2c // indirect + github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e // indirect + github.com/xtls/reality v0.0.0-20230309125256-0d0713b108c8 // indirect + go.starlark.net v0.0.0-20230302034142-4b1e35fe2254 // indirect + go.uber.org/atomic v1.10.0 // indirect + golang.org/x/crypto v0.7.0 // indirect + golang.org/x/exp v0.0.0-20230307190834-24139beb5833 // indirect + golang.org/x/mod v0.9.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect + golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.7.0 // indirect + google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect + google.golang.org/grpc v1.53.0 // indirect + google.golang.org/protobuf v1.29.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gvisor.dev/gvisor v0.0.0-20220901235040-6ca97ef2ce1c // indirect + lukechampine.com/blake3 v1.1.7 // indirect ) diff --git a/golang/go.sum b/golang/go.sum index 34c70aaf..da1f89ae 100644 --- a/golang/go.sum +++ b/golang/go.sum @@ -1,14 +1,361 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo= +dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= +dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= +dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= +dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= +git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= +github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/go-metro v0.0.0-20200812162917-85c65e2d0165/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw= +github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 h1:y7y0Oa6UawqTFPCDw9JG6pdKt4F9pAhHv0B7FMGaGD0= +github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203 h1:XBBHcIb256gUJtLmY22n99HaZTz+r2Z51xUPi01m3wg= github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203/go.mod h1:E1jcSv8FaEny+OP/5k9UxZVw9YFWGj7eI4KR/iOBqCg= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= +github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344 h1:Arcl6UOIS/kgO2nW3A65HN+7CMjSDP/gofXL4CZt1V4= +github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I= +github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= +github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 h1:CqYfpuYIjnlNxM3msdyPRKabhXZWbKjf3Q8BWROFBso= +github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= +github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= +github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= +github.com/miekg/dns v1.1.51 h1:0+Xg7vObnhrz/4ZCZcZh7zPXlmU0aveS2HDBd0m0qSo= +github.com/miekg/dns v1.1.51/go.mod h1:2Z9d3CP1LQWihRZUf29mQ19yDThaI4DAYzte2CaQW5c= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= +github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= +github.com/onsi/ginkgo/v2 v2.9.0 h1:Tugw2BKlNHTMfG+CheOITkYvk4LAh6MFOvikhGVnhE8= +github.com/onsi/ginkgo/v2 v2.9.0/go.mod h1:4xkjoL/tZv4SMWeww56BU5kAt19mVB47gTWxmrTcxyk= +github.com/onsi/gomega v1.27.1 h1:rfztXRbg6nv/5f+Raen9RcGoSecHIFgBBLQK3Wdj754= +github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pires/go-proxyproto v0.6.2 h1:KAZ7UteSOt6urjme6ZldyFm4wDe/z0ZUP0Yv0Dos0d8= +github.com/pires/go-proxyproto v0.6.2/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/quic-go/qtls-go1-19 v0.2.1 h1:aJcKNMkH5ASEJB9FXNeZCyTEIHU1J7MmHyz1Q1TSG1A= +github.com/quic-go/qtls-go1-19 v0.2.1/go.mod h1:ySOI96ew8lnoKPtSqx2BlI5wCpUVPT05RMAlajtnyOI= +github.com/quic-go/qtls-go1-20 v0.1.1 h1:KbChDlg82d3IHqaj2bn6GfKRj84Per2VGf5XV3wSwQk= +github.com/quic-go/qtls-go1-20 v0.1.1/go.mod h1:JKtK6mjbAVcUTN/9jZpvLbGxvdWIKS8uT7EiStoU1SM= +github.com/quic-go/quic-go v0.33.0 h1:ItNoTDN/Fm/zBlq769lLJc8ECe9gYaW40veHCCco7y0= +github.com/quic-go/quic-go v0.33.0/go.mod h1:YMuhaAV9/jIu0XclDXwZPAsP/2Kgr5yMYhe9oxhhOFA= +github.com/refraction-networking/utls v1.2.3-0.20230308205431-4f1df6c200db h1:ULRv/GPW5KYDafE0FACN2no+HTCyQLUtfyOIeyp3GNc= +github.com/refraction-networking/utls v1.2.3-0.20230308205431-4f1df6c200db/go.mod h1:kHXvVB66a4BzVRYC4Em7e1HAfp7uwOCCw0+2CZ3sMY8= +github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg= +github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sagernet/sing v0.1.7 h1:g4vjr3q8SUlBZSx97Emz5OBfSMBxxW5Q8C2PfdoSo08= +github.com/sagernet/sing v0.1.7/go.mod h1:jt1w2u7lJQFFSGLiRrRIs5YWmx4kAPfWuOejuDW9qMk= +github.com/sagernet/sing-shadowsocks v0.1.1 h1:uFK2rlVeD/b1xhDwSMbUI2goWc6fOKxp+ZeKHZq6C9Q= +github.com/sagernet/sing-shadowsocks v0.1.1/go.mod h1:f3mHTy5shnVM9l8UocMlJgC/1G/zdj5FuEuVXhDinGU= +github.com/sagernet/wireguard-go v0.0.0-20221116151939-c99467f53f2c h1:vK2wyt9aWYHHvNLWniwijBu/n4pySypiKRhN32u/JGo= +github.com/sagernet/wireguard-go v0.0.0-20221116151939-c99467f53f2c/go.mod h1:euOmN6O5kk9dQmgSS8Df4psAl3TCjxOz0NW60EWkSaI= +github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb h1:XfLJSPIOUX+osiMraVgIrMR27uMXnRJWGm1+GL8/63U= +github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb/go.mod h1:bR6DqgcAl1zTcOX8/pE2Qkj9XO00eCNqmKb7lXP8EAg= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= +github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= +github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= +github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw= +github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI= +github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= +github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= +github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg= +github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw= +github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y= +github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= +github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ= +github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I= +github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0= +github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= +github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= +github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= +github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= +github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= +github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= +github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e h1:5QefA066A1tF8gHIiADmOVOV5LS43gt3ONnlEl3xkwI= +github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e/go.mod h1:5t19P9LBIrNamL6AcMQOncg/r10y3Pc01AbHeMhwlpU= +github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= +github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= +github.com/xtls/reality v0.0.0-20230309125256-0d0713b108c8 h1:LLtLxEe3S0Ko+ckqt4t29RLskpNdOZfgjZCC2/Byr50= +github.com/xtls/reality v0.0.0-20230309125256-0d0713b108c8/go.mod h1:rkuAY1S9F8eI8gDiPDYvACE8e2uwkyg8qoOTuwWov7Y= +github.com/xtls/xray-core v1.8.0 h1:/OD0sDv6YIBqvE+cVfnqlKrtbMs0Fm9IP5BR5d8Eu4k= +github.com/xtls/xray-core v1.8.0/go.mod h1:i9KWgbLyxg/NT+3+g4nE74Zp3DgTCP3X04YkSfsJeDI= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= +go.starlark.net v0.0.0-20230302034142-4b1e35fe2254 h1:Ss6D3hLXTM0KobyBYEAygXzFfGcjnmfEJOBgSbemCtg= +go.starlark.net v0.0.0-20230302034142-4b1e35fe2254/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= +golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= +golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s= +golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= +golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= +google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.29.0 h1:44S3JjaKmLEE4YIkjzexaP+NzZsudE3Zin5Njn/pYX0= +google.golang.org/protobuf v1.29.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= +gvisor.dev/gvisor v0.0.0-20220901235040-6ca97ef2ce1c h1:m5lcgWnL3OElQNVyp3qcncItJ2c0sQlSGjYK2+nJTA4= +gvisor.dev/gvisor v0.0.0-20220901235040-6ca97ef2ce1c/go.mod h1:TIvkJD0sxe8pIob3p6T8IzxXunlp6yfgktvTNp+DGNM= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= +lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= +sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/golang/main.go b/golang/main.go index 6f1a1d68..d4b64c99 100644 --- a/golang/main.go +++ b/golang/main.go @@ -9,7 +9,7 @@ import ( // Program Info var ( - version = "1.5" + version = "1.6" build = "Custom" codename = "CFScanner , CloudFlare Scanner." ) diff --git a/golang/run.go b/golang/run.go index eae9b49b..b54475bd 100644 --- a/golang/run.go +++ b/golang/run.go @@ -4,6 +4,7 @@ import ( configuration "CFScanner/configuration" "CFScanner/scanner" "CFScanner/utils" + "CFScanner/vpn" "bufio" "fmt" "github.com/spf13/cobra" @@ -22,10 +23,6 @@ func run() *cobra.Command { Run: func(cmd *cobra.Command, args []string) { fmt.Println(VersionStatement()) - if vpnPath != "" { - configuration.BIN = vpnPath - } - if Vpn { utils.CreateDir(configuration.DIR) } @@ -103,6 +100,9 @@ func run() *cobra.Command { config = config.CreateTestConfig(configPath) timer := time.Now() + if config.Worker.Vpn { + vpn.XRayVersion() + } fmt.Printf("Starting to scan %v%d%v IPS.\n\n", utils.Colors.OKGREEN, numberIPS, utils.Colors.ENDC) // Begin scanning process scanner.Start(config, config.Worker, bigIPList, threadsCount) diff --git a/golang/scanner/scanner.go b/golang/scanner/scanner.go index b875dfd0..fa792bc3 100644 --- a/golang/scanner/scanner.go +++ b/golang/scanner/scanner.go @@ -4,13 +4,12 @@ import ( config "CFScanner/configuration" "CFScanner/speedtest" "CFScanner/utils" - "CFScanner/v2raysvc" + "CFScanner/vpn" "fmt" "github.com/eiannone/keyboard" "log" "math" "os" - "os/exec" "runtime" "strconv" "strings" @@ -56,12 +55,26 @@ func scanner(ip string, C config.Configuration, Worker config.Worker) *Result { var Download = &Worker.Download var proxies map[string]string = nil - var process *exec.Cmd = nil + var process vpn.ScanWorker if Worker.Vpn { - v2rayConfigPath := v2raysvc.CreateV2rayConfig(ip, &C) + // create config for desired ip + xrayConfigPath := vpn.XRayConfig(ip, &C) + listen, port, _ := vpn.XRayReceiver(xrayConfigPath) + + // bind proxy + proxies = vpn.ProxyBind(listen, port) + + // wait for port + waitPort := utils.WaitForPort(listen, port, time.Duration(5)) + + if waitPort != nil { + fmt.Errorf(waitPort.Error()) + } + var err error - process, proxies, err = v2raysvc.StartV2RayService(v2rayConfigPath, time.Duration(Worker.StartProcessTimeout)) + process = vpn.XRayInstance(xrayConfigPath, time.Duration(Worker.StartProcessTimeout)) + if err != nil { log.Printf("%vERROR - %vCould not start vpn service%v\n", utils.Colors.FAIL, utils.Colors.WARNING, utils.Colors.ENDC) @@ -70,21 +83,13 @@ func scanner(ip string, C config.Configuration, Worker config.Worker) *Result { } defer func() { - if process != nil && process.Process != nil { - // terminate process - err = process.Process.Kill() - if err != nil { - log.Printf("%vERROR - %vFailed to kill process%v\n", - utils.Colors.FAIL, utils.Colors.WARNING, utils.Colors.ENDC) - } - - // using Wait for clean up zombie process after Kill func - _, err := process.Process.Wait() - if err != nil { - log.Printf("%vERROR - %vFailed to wait for process to exit%v\n", - utils.Colors.FAIL, utils.Colors.WARNING, utils.Colors.ENDC) - } + // terminate process + err = process.Instance.Close() + if err != nil { + log.Printf("%vERROR - %vFailed to stop xray instance%v\n", + utils.Colors.FAIL, utils.Colors.WARNING, utils.Colors.ENDC) } + }() } diff --git a/golang/speedtest/download.go b/golang/speedtest/download.go index b4870477..24673291 100644 --- a/golang/speedtest/download.go +++ b/golang/speedtest/download.go @@ -4,6 +4,7 @@ import ( "fmt" "io" "net/http" + "net/url" "strconv" "strings" "time" @@ -16,16 +17,19 @@ func DownloadSpeedTest(nBytes int, proxies map[string]string, timeout time.Durat // Create byte slice of nBytes data := make([]byte, nBytes) + // set proxy to request + var proxy *url.URL + // set proxies to req header + for _, v := range proxies { + proxy, _ = url.Parse(v) + } + // Create request req, err := http.NewRequest("GET", "https://speed.cloudflare.com/__down", nil) if err != nil { return 0, 0, fmt.Errorf("error creating request: %v", err) } - // set proxies to req header - for k, v := range proxies { - req.Header.Set(k, v) - } // Add bytes query parameter q := req.URL.Query() q.Add("bytes", strconv.Itoa(nBytes)) @@ -33,10 +37,8 @@ func DownloadSpeedTest(nBytes int, proxies map[string]string, timeout time.Durat // Set up client client := &http.Client{ - Timeout: timeout * time.Second, - Transport: &http.Transport{ - Proxy: http.ProxyFromEnvironment, - }, + Timeout: timeout * time.Second, + Transport: &http.Transport{Proxy: http.ProxyURL(proxy)}, } // Send request and write response to data slice diff --git a/golang/speedtest/fronting.go b/golang/speedtest/fronting.go index 68498e94..887f03a1 100644 --- a/golang/speedtest/fronting.go +++ b/golang/speedtest/fronting.go @@ -8,6 +8,7 @@ import ( "log" "net" "net/http" + "net/url" "strings" "time" ) @@ -17,6 +18,13 @@ func FrontingTest(ip string, proxies map[string]string, timeout time.Duration) b var success = false + // set proxy to request + var proxy *url.URL + // set proxies to req header + for _, v := range proxies { + proxy, _ = url.Parse(v) + } + compatibleIP := ip if strings.Contains(ip, ":") { compatibleIP = fmt.Sprintf("[%s]", ip) @@ -31,15 +39,9 @@ func FrontingTest(ip string, proxies map[string]string, timeout time.Duration) b } req.Host = "speed.cloudflare.com" - // set proxies to req header - for k, v := range proxies { - req.Header.Set(k, v) - } - client := &http.Client{ Timeout: timeout * time.Second, - Transport: &http.Transport{ - Proxy: http.ProxyFromEnvironment, + Transport: &http.Transport{Proxy: http.ProxyURL(proxy), TLSClientConfig: &tls.Config{ ServerName: "speed.cloudflare.com", InsecureSkipVerify: true, diff --git a/golang/speedtest/upload.go b/golang/speedtest/upload.go index 66039df7..67308b6d 100644 --- a/golang/speedtest/upload.go +++ b/golang/speedtest/upload.go @@ -4,6 +4,7 @@ import ( "fmt" "io" "net/http" + "net/url" "strconv" "strings" "time" @@ -17,12 +18,16 @@ func UploadSpeedTest(nBytes int, proxies map[string]string, timeout time.Duratio return 0, 0, err } - for k, v := range proxies { - req.Header.Set(k, v) + // set proxy to request + var proxy *url.URL + // set proxies to req header + for _, v := range proxies { + proxy, _ = url.Parse(v) } client := &http.Client{ - Timeout: timeout * time.Second} + Timeout: timeout * time.Second, + Transport: &http.Transport{Proxy: http.ProxyURL(proxy)}} resp, err := client.Do(req) if err != nil { diff --git a/golang/v2raysvc/v2raysvc.go b/golang/vpn/config.go similarity index 57% rename from golang/v2raysvc/v2raysvc.go rename to golang/vpn/config.go index 7d3b2918..5a873f20 100644 --- a/golang/v2raysvc/v2raysvc.go +++ b/golang/vpn/config.go @@ -1,20 +1,19 @@ -package v2raysvc +package vpn import ( configuration "CFScanner/configuration" - utils "CFScanner/utils" - "encoding/json" + "CFScanner/utils" "fmt" "log" "os" - "os/exec" - "path" "strconv" "strings" - "time" ) var v2rayTemplate = `{ + "log": { + "loglevel": "none" + }, "inbounds": [{ "port": PORTPORT, "listen": "127.0.0.1", @@ -58,8 +57,8 @@ var v2rayTemplate = `{ "other": {} }` -// CreateV2rayConfig create VPN configuration -func CreateV2rayConfig(IP string, testConfig *configuration.Configuration) string { +// XRayConfig create VPN configuration +func XRayConfig(IP string, testConfig *configuration.Configuration) string { localPortStr := strconv.Itoa(utils.GetFreePort()) config := strings.ReplaceAll(v2rayTemplate, "PORTPORT", localPortStr) config = strings.ReplaceAll(config, "IP.IP.IP.IP", IP) @@ -88,47 +87,3 @@ func CreateV2rayConfig(IP string, testConfig *configuration.Configuration) strin return configPath } - -// StartV2RayService start VPN service based on bin path -func StartV2RayService(v2rayConfPath string, timeout time.Duration) (*exec.Cmd, map[string]string, error) { - v2rayConfFile, err := os.Open(v2rayConfPath) - if err != nil { - return nil, nil, err - } - defer func(v2rayConfFile *os.File) { - err := v2rayConfFile.Close() - if err != nil { - - } - }(v2rayConfFile) - - var v2rayConf map[string]interface{} - err = json.NewDecoder(v2rayConfFile).Decode(&v2rayConf) - if err != nil { - return nil, nil, err - } - - v2rayListen := v2rayConf["inbounds"].([]interface{})[0].(map[string]interface{})["listen"].(string) - v2rayPort := int(v2rayConf["inbounds"].([]interface{})[0].(map[string]interface{})["port"].(float64)) - - v2rayCmd := exec.Command(path.Join(configuration.BIN), "-c", v2rayConfPath) - v2rayCmd.Stdout = nil - v2rayCmd.Stderr = nil - - err = v2rayCmd.Start() - if err != nil { - return nil, nil, err - } - - err = utils.WaitForPort(v2rayListen, v2rayPort, timeout) - if err != nil { - return nil, nil, err - } - - proxies := map[string]string{ - "http": fmt.Sprintf("socks5://%s:%d", v2rayListen, v2rayPort), - "https": fmt.Sprintf("socks5://%s:%d", v2rayListen, v2rayPort), - } - - return v2rayCmd, proxies, nil -} diff --git a/golang/vpn/load.go b/golang/vpn/load.go new file mode 100644 index 00000000..f982ba15 --- /dev/null +++ b/golang/vpn/load.go @@ -0,0 +1,21 @@ +package vpn + +import ( + "github.com/xtls/xray-core/core" + "log" + "os" +) + +func LoadConfig(filename string) (*core.Config, error) { + file, err := os.OpenFile(filename, os.O_RDONLY, 0) + if err != nil { + log.Fatal(err) + } + + config, err := core.LoadConfig("json", file) + if err != nil { + log.Fatal(err) + } + + return config, nil +} diff --git a/golang/vpn/types.go b/golang/vpn/types.go new file mode 100644 index 00000000..5f6020b0 --- /dev/null +++ b/golang/vpn/types.go @@ -0,0 +1,9 @@ +package vpn + +import ( + "github.com/xtls/xray-core/core" +) + +type ScanWorker struct { + Instance *core.Instance +} diff --git a/golang/vpn/xray.go b/golang/vpn/xray.go new file mode 100644 index 00000000..37af2ab1 --- /dev/null +++ b/golang/vpn/xray.go @@ -0,0 +1,152 @@ +package vpn + +import ( + "encoding/json" + "fmt" + "log" + "os" + "os/signal" + "time" + + // The following are necessary as they register handlers in their init functions. + + _ "github.com/xtls/xray-core/app/dispatcher" + _ "github.com/xtls/xray-core/app/proxyman/inbound" + _ "github.com/xtls/xray-core/app/proxyman/outbound" + "github.com/xtls/xray-core/core" + + // Default commander and all its services. This is an optional feature. + //_ "github.com/xtls/xray-core/app/commander"w + //_ "github.com/xtls/xray-core/app/log/command" + //_ "github.com/xtls/xray-core/app/proxyman/command" + //_ "github.com/xtls/xray-core/app/stats/command" + + // Developer preview services + //_ "github.com/xtls/xray-core/app/observatory/command" + + // Other optional features. + _ "github.com/xtls/xray-core/app/dns" + _ "github.com/xtls/xray-core/app/dns/fakedns" + //_ "github.com/xtls/xray-core/app/log" + _ "github.com/xtls/xray-core/app/metrics" + _ "github.com/xtls/xray-core/app/policy" + + //_ "github.com/xtls/xray-core/app/reverse" + _ "github.com/xtls/xray-core/app/router" + _ "github.com/xtls/xray-core/app/stats" + + // Fix dependency cycle caused by core import in internet package + _ "github.com/xtls/xray-core/transport/internet/tagged/taggedimpl" + + // Developer preview features + // _ "github.com/xtls/xray-core/app/observatory" + + // Inbound and outbound proxies. + _ "github.com/xtls/xray-core/proxy/blackhole" + _ "github.com/xtls/xray-core/proxy/dns" + _ "github.com/xtls/xray-core/proxy/dokodemo" + _ "github.com/xtls/xray-core/proxy/freedom" + _ "github.com/xtls/xray-core/proxy/http" + + _ "github.com/xtls/xray-core/proxy/loopback" + // _ "github.com/xtls/xray-core/proxy/mtproto" + + // _ "github.com/xtls/xray-core/proxy/shadowsocks" + _ "github.com/xtls/xray-core/proxy/socks" + // _ "github.com/xtls/xray-core/proxy/trojan" + + // _ "github.com/xtls/xray-core/proxy/vless/inbound" + // _ "github.com/xtls/xray-core/proxy/vless/outbound" + _ "github.com/xtls/xray-core/proxy/vmess/inbound" + _ "github.com/xtls/xray-core/proxy/vmess/outbound" + _ "github.com/xtls/xray-core/proxy/wireguard" + + // Transports + _ "github.com/xtls/xray-core/transport/internet/domainsocket" + _ "github.com/xtls/xray-core/transport/internet/grpc" + _ "github.com/xtls/xray-core/transport/internet/http" + + // _ "github.com/xtls/xray-core/transport/internet/kcp" + // _ "github.com/xtls/xray-core/transport/internet/quic" + _ "github.com/xtls/xray-core/transport/internet/tcp" + _ "github.com/xtls/xray-core/transport/internet/tls" + _ "github.com/xtls/xray-core/transport/internet/udp" + _ "github.com/xtls/xray-core/transport/internet/websocket" + + // Transport headers + _ "github.com/xtls/xray-core/transport/internet/headers/http" + // _ "github.com/xtls/xray-core/transport/internet/headers/noop" + // _ "github.com/xtls/xray-core/transport/internet/headers/srtp" + _ "github.com/xtls/xray-core/transport/internet/headers/tls" + + // _ "github.com/xtls/xray-core/transport/internet/headers/utp" + // _ "github.com/xtls/xray-core/transport/internet/headers/wechat" + // _ "github.com/xtls/xray-core/transport/internet/headers/wireguard" + + // JSON & TOML & YAML + _ "github.com/xtls/xray-core/main/json" + // _ "github.com/xtls/xray-core/main/toml" + // _ "github.com/xtls/xray-core/main/yaml" + + // Load config from file or http(s) + _ "github.com/xtls/xray-core/main/confloader/external" + // Commands + //_ "github.com/xtls/xray-core/main/commands/all" +) + +func XRayInstance(configPath string, timeout time.Duration) ScanWorker { + config, err := LoadConfig(configPath) + if err != nil { + log.Fatal(err) + } + + instance, err := core.New(config) + if err != nil { + log.Fatal(err) + } + + if err := instance.Start(); err != nil { + log.Println("Failed to start XRay instance:", err) + } + + go func() { + osSignals := make(chan os.Signal, 1) + signal.Notify(osSignals, os.Interrupt) + <-osSignals + }() + + return ScanWorker{Instance: instance} +} + +func ProxyBind(listen string, port int) map[string]string { + proxies := map[string]string{ + "http": fmt.Sprintf("socks5://%s:%d", listen, port), + "https": fmt.Sprintf("socks5://%s:%d", listen, port)} + + return proxies + +} + +func XRayVersion() { + fmt.Println(core.VersionStatement()) +} + +func XRayReceiver(configPath string) (string, int, error) { + xrayConfFile, err := os.Open(configPath) + if err != nil { + return "", 0, err + } + + defer xrayConfFile.Close() + + var xrayConf map[string]interface{} + err = json.NewDecoder(xrayConfFile).Decode(&xrayConf) + if err != nil { + return "", 0, err + } + + xrayListen := xrayConf["inbounds"].([]interface{})[0].(map[string]interface{})["listen"].(string) + xrayPort := int(xrayConf["inbounds"].([]interface{})[0].(map[string]interface{})["port"].(float64)) + + return xrayListen, xrayPort, nil +} From e5697a992c28e9eaff44e2f1a3ea85f9a4ef48c6 Mon Sep 17 00:00:00 2001 From: Sonya Date: Thu, 13 Apr 2023 15:18:10 +0330 Subject: [PATCH 2/4] added loglevel arg for xray-core added xray configuration type --- golang/cmd.go | 4 ++- golang/configuration/config.go | 4 ++- golang/configuration/types.go | 1 + golang/run.go | 1 + golang/vpn/config.go | 26 ++++++++++++++---- golang/vpn/types.go | 48 ++++++++++++++++++++++++++++++++++ 6 files changed, 77 insertions(+), 7 deletions(-) diff --git a/golang/cmd.go b/golang/cmd.go index 64c31b12..72864f9b 100644 --- a/golang/cmd.go +++ b/golang/cmd.go @@ -9,6 +9,7 @@ var configPath string var subnets string var Vpn bool +var Loglevel string var doUploadTest bool var fronting bool var shuffle bool @@ -30,7 +31,8 @@ var writerType string func RegisterCommands(rootCmd *cobra.Command) { rootCmd.PersistentFlags().IntVarP(&threads, "threads", "t", 1, "Number of threads to use for parallel scanning") rootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", "", "The path to the config file") - rootCmd.PersistentFlags().BoolVar(&Vpn, "vpn", false, "If passed, test with creating vpn connections") + rootCmd.PersistentFlags().BoolVar(&Vpn, "vpn", false, "If passed, test with creating xray-core connections") + rootCmd.PersistentFlags().StringVarP(&Loglevel, "loglevel", "l", "none", "The log level for xray-core") rootCmd.PersistentFlags().StringVarP(&subnets, "subnets", "s", "", "The file or subnet. each line should be in the form of ip.ip.ip.ip/subnet_mask or ip.ip.ip.ip.") rootCmd.PersistentFlags().BoolVar(&shuffle, "shuffle", false, "Shuffling given subnet file or input") rootCmd.PersistentFlags().BoolVar(&doUploadTest, "upload", false, "If passed, upload test will be conducted") diff --git a/golang/configuration/config.go b/golang/configuration/config.go index eb14112d..45946379 100644 --- a/golang/configuration/config.go +++ b/golang/configuration/config.go @@ -41,7 +41,8 @@ Fronting Timeout : %v%v%v Maximum Download Latency : %v%v%v Maximum Upload Latency : %v%v%v Number of Tries : %v%v%v -VPN Mode : %v%v%v +Xray-core : %v%v%v +Xray-loglevel : %v%v%v Shuffling : %v%v%v Writer : %v%v%v Total Threads : %v%v%v @@ -64,6 +65,7 @@ Total Threads : %v%v%v utils.Colors.OKBLUE, C.Worker.Upload.MaxUlLatency, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Config.NTries, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Worker.Vpn, utils.Colors.ENDC, + utils.Colors.OKBLUE, C.LogLevel, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Shuffling, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Config.Writer, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Worker.Threads, utils.Colors.ENDC, diff --git a/golang/configuration/types.go b/golang/configuration/types.go index 2587fada..13938bc0 100644 --- a/golang/configuration/types.go +++ b/golang/configuration/types.go @@ -4,6 +4,7 @@ type Configuration struct { Config ConfigStruct Worker Worker Shuffling bool + LogLevel string } type Worker struct { diff --git a/golang/run.go b/golang/run.go index b54475bd..5c16a360 100644 --- a/golang/run.go +++ b/golang/run.go @@ -94,6 +94,7 @@ func run() *cobra.Command { }, Shuffling: shuffle, + LogLevel: Loglevel, } // Create Configuration file & append vpn fields diff --git a/golang/vpn/config.go b/golang/vpn/config.go index 5a873f20..079ab1cd 100644 --- a/golang/vpn/config.go +++ b/golang/vpn/config.go @@ -10,9 +10,24 @@ import ( "strings" ) -var v2rayTemplate = `{ +var logger = []string{"debug", + "info", + "warning", + "error", + "none"} + +func loglevel(level string) string { + for _, log := range logger { + if strings.ToLower(level) == log { + return level + } + } + return logger[4] +} + +var XRayTemplate = `{ "log": { - "loglevel": "none" + "loglevel": "LOG" }, "inbounds": [{ "port": PORTPORT, @@ -35,7 +50,7 @@ var v2rayTemplate = `{ "settings": { "vnext": [{ "address": "IP.IP.IP.IP", - "port": CFPORTCFPORT, + "port": CFPORT, "users": [{"id": "IDID" }] }] }, @@ -60,9 +75,10 @@ var v2rayTemplate = `{ // XRayConfig create VPN configuration func XRayConfig(IP string, testConfig *configuration.Configuration) string { localPortStr := strconv.Itoa(utils.GetFreePort()) - config := strings.ReplaceAll(v2rayTemplate, "PORTPORT", localPortStr) + config := strings.ReplaceAll(XRayTemplate, "PORTPORT", localPortStr) + config = strings.ReplaceAll(config, "LOG", loglevel(testConfig.LogLevel)) config = strings.ReplaceAll(config, "IP.IP.IP.IP", IP) - config = strings.ReplaceAll(config, "CFPORTCFPORT", testConfig.Config.AddressPort) + config = strings.ReplaceAll(config, "CFPORT", testConfig.Config.AddressPort) config = strings.ReplaceAll(config, "IDID", testConfig.Config.UserId) config = strings.ReplaceAll(config, "HOSTHOST", testConfig.Config.WsHeaderHost) config = strings.ReplaceAll(config, "ENDPOINTENDPOINT", testConfig.Config.WsHeaderPath) diff --git a/golang/vpn/types.go b/golang/vpn/types.go index 5f6020b0..a2d35494 100644 --- a/golang/vpn/types.go +++ b/golang/vpn/types.go @@ -7,3 +7,51 @@ import ( type ScanWorker struct { Instance *core.Instance } + +type XRay struct { + Log struct { + Loglevel string `json:"loglevel"` + } `json:"log"` + Inbounds []struct { + Port string `json:"port"` + Listen string `json:"listen"` + Tag string `json:"tag"` + Protocol string `json:"protocol"` + Settings struct { + Auth string `json:"auth"` + UDP bool `json:"udp"` + IP string `json:"ip"` + } `json:"settings"` + Sniffing struct { + Enabled bool `json:"enabled"` + DestOverride []string `json:"destOverride"` + } `json:"sniffing"` + } `json:"inbounds"` + Outbounds []struct { + Protocol string `json:"protocol"` + Settings struct { + Vnext []struct { + Address string `json:"address"` + Port string `json:"port"` + Users []struct { + ID string `json:"id"` + } `json:"users"` + } `json:"vnext"` + } `json:"settings"` + StreamSettings struct { + Network string `json:"network"` + Security string `json:"security"` + WSSettings struct { + Headers struct { + Host string `json:"Host"` + } `json:"headers"` + Path string `json:"path"` + } `json:"wsSettings"` + TLSSettings struct { + ServerName string `json:"serverName"` + AllowInsecure bool `json:"allowInsecure"` + } `json:"tlsSettings"` + } `json:"streamSettings"` + } `json:"outbounds"` + Other struct{} `json:"other"` +} From d2ebb90951b3998fcc4e51df0efb90c6535bbdde Mon Sep 17 00:00:00 2001 From: Sonya Date: Thu, 13 Apr 2023 16:06:15 +0330 Subject: [PATCH 3/4] Updated README.md --- golang/README.md | 70 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/golang/README.md b/golang/README.md index 3aa762b4..e733d2ea 100644 --- a/golang/README.md +++ b/golang/README.md @@ -3,22 +3,39 @@ ![go] ![version] -### CFScanner is a tool written in Golang that scans Cloudflare's edge IPs and locates ones that are viable for use with V2Ray/Xray. It aims to identify edge IPs that are accessible and not blocked. +CFScanner is a powerful tool written in Golang specifically designed to scan Cloudflare's edge IPs and identify viable options for use with V2Ray/Xray. -### This program is similar to the bash version, utilizing v2ray+vmess+websocket+tls by default when the VPN flag is enabled. If you wish to use it behind your Cloudflare proxy, you will need to set up a vmess account. Otherwise, the program will use the default configuration. +Its main objective is to locate edge IPs that are accessible and not blocked. With its built-in xray-core, CFScanner leverages xray+vmess+websocket+tls by default when the VPN flag is enabled. +If you prefer to use it behind your Cloudflare proxy, you will need to set up a vmess account. However, if no specific configuration is provided, the program will automatically use the default settings. # Requirements -- Golang v1.18 or higher +- Golang v1.20 # Installation -To install CFScanner, clone the repository and build the binary using the following commands: +### Getting the latest version from release page +Latest release version of golang CFScanner are available in [releases](https://github.com/MortezaBashsiz/CFScanner/releases) +section + +### Build instructions + +If you prefer to build CFScanner from source, you can follow these instructions: + +Clone the repository by running the following command in your terminal: ```bash git clone https://github.com/MortezaBashsiz/CFScanner.git +``` +Navigate to the "golang" directory within the cloned repository: + +```bash cd CFScanner/golang -go build +``` + +Build the binary using the "go build" command with additional flags for trimming the path and setting linker flags for smaller binary size: +```bash +go build -o CFScanner -trimpath -ldflags "-s -w -buildid=" . ``` ## Get Configuration file @@ -57,7 +74,8 @@ CFScanner takes several arguments: |------------------------|--------------------------------------------------------------------------------------------------| | --threads -t | Number of threads to use for parallel scanning. Default is 1. | | --config -c | The path to the config file. (Required) | -| --vpn | If passed, test with creating VPN connections. | +| --vpn | If passed, test with creating xray-core connections. | +| -l --loglevel | The log level for xray-core (default "none") | | --subnets -s | The file or subnet. Each line should be in the form of ip.ip.ip.ip/subnet_mask or ip.ip.ip.ip. | | --shuffle | Shuffling given subnet file or input | | --upload | If passed, upload test will be conducted. | @@ -71,16 +89,36 @@ CFScanner takes several arguments: | --download-latency | Maximum allowed latency for download. Default is 2.0. | | --upload-latency | Maximum allowed latency for upload. Default is 2.0. | | --startprocess-timeout | Process timeout for v2ray. Default is 12. | -| --vpn-path | Custom V2Ray binary path for using v2ray binary in another directory. | -| --writer | Custom output writer for writing interim results. available writers : `csv`/`json` | -# KeyEvent Listeners +| --writer | Custom output writer for writing interim results. available writers : `csv`/`json` | + +# Features + +### KeyEvent Listeners CFScanner supports pause and resume progress - For Pausing current progress press `p` - For Resuming current progress press `r` + +### XRay Core +This Program has built-in Xray-core for testing connection with vpn + +xray-core has 5 log levels + +**Available log levels** +- debug +- info +- warning +- error +- none + +default loglevel is none. + +--- + # Examples + ### Load configuration file and load subnet file for scanning ```bash @@ -105,21 +143,27 @@ CFScanner supports pause and resume progress ./CFScanner --config config.real --subnets 172.20.0.0/24 --threads 4 --tries 3 ``` -### Load configurations file with subnet file and using vpn mode with another v2ray binary +### Load configurations file with subnet file and using vpn mode ```bash -./CFScanner --config config.real --subnets 172.20.0.0/24 --vpn --vpn-path ~/v2ray-macos-arm64-v8a/v2ray +./CFScanner --config config.real --subnets 172.20.0.0/24 --vpn ``` +--- + ## Output Two files are stored for each (complete) run of the program +#### Writer Results - Interim results file (e.g., `2023-03-10_20:49:30_result.csv` or `2023-03-10_20:49:30_result.json`) - - Includes the unsorted intermediate results in writer format. Useful in case the scanning process is not complete. + - Includes the unsorted intermediate results in specified writer format. Useful in case the scanning process is not complete. +#### Sorted Results - Final results file (e.g., `2023-03-10_20:49:30_final.txt`) - Includes the final sorted results. The results are sorted ascending ly based on the download latency time. +all results are stored in `result` folder + # License CFScanner is released under the [GPL-3](../LICENSE) license. @@ -129,4 +173,4 @@ CFScanner is released under the [GPL-3](../LICENSE) license. Contributions are welcome! Please read [CONTRIBUTING.md](../CONTRIBUTING.md) for more information. [go]: https://img.shields.io/badge/Go-cyan?logo=go -[version]: https://img.shields.io/badge/Version-1.4-blue +[version]: https://img.shields.io/badge/Version-1.6-blue From 88ed5419633a84b2108d9cfebadf39d7902a5be7 Mon Sep 17 00:00:00 2001 From: Sonya Date: Thu, 13 Apr 2023 16:15:50 +0330 Subject: [PATCH 4/4] Removed start process timeout arg updated README.md --- golang/README.md | 3 +-- golang/cmd.go | 2 -- golang/configuration/config.go | 2 -- golang/configuration/types.go | 9 ++++----- golang/run.go | 5 ++--- golang/scanner/scanner.go | 2 +- golang/vpn/xray.go | 4 +--- 7 files changed, 9 insertions(+), 18 deletions(-) diff --git a/golang/README.md b/golang/README.md index e733d2ea..5e201373 100644 --- a/golang/README.md +++ b/golang/README.md @@ -75,7 +75,7 @@ CFScanner takes several arguments: | --threads -t | Number of threads to use for parallel scanning. Default is 1. | | --config -c | The path to the config file. (Required) | | --vpn | If passed, test with creating xray-core connections. | -| -l --loglevel | The log level for xray-core (default "none") | +| --loglevel -l | The log level for xray-core (default "none") | | --subnets -s | The file or subnet. Each line should be in the form of ip.ip.ip.ip/subnet_mask or ip.ip.ip.ip. | | --shuffle | Shuffling given subnet file or input | | --upload | If passed, upload test will be conducted. | @@ -88,7 +88,6 @@ CFScanner takes several arguments: | --fronting-timeout | Maximum time to wait for fronting response. Default is 1.0. | | --download-latency | Maximum allowed latency for download. Default is 2.0. | | --upload-latency | Maximum allowed latency for upload. Default is 2.0. | -| --startprocess-timeout | Process timeout for v2ray. Default is 12. | | --writer | Custom output writer for writing interim results. available writers : `csv`/`json` | # Features diff --git a/golang/cmd.go b/golang/cmd.go index 72864f9b..7901988b 100644 --- a/golang/cmd.go +++ b/golang/cmd.go @@ -19,7 +19,6 @@ var minULSpeed float64 var maxDLTime float64 var maxULTime float64 -var startProcessTimeout float64 var frontingTimeout float64 var maxDLLatency float64 var maxULLatency float64 @@ -45,7 +44,6 @@ func RegisterCommands(rootCmd *cobra.Command) { rootCmd.PersistentFlags().Float64Var(&frontingTimeout, "fronting-timeout", 1.0, "Maximum time to wait for fronting response") rootCmd.PersistentFlags().Float64Var(&maxDLLatency, "download-latency", 3.0, "Maximum allowed latency for download") rootCmd.PersistentFlags().Float64Var(&maxULLatency, "upload-latency", 3.0, "Maximum allowed latency for upload") - rootCmd.PersistentFlags().Float64Var(&startProcessTimeout, "startprocess-timeout", 12, "Process timeout for v2ray") rootCmd.PersistentFlags().StringVar(&writerType, "writer", "csv", "Custom output writer for writing interim results. [csv/json]") } diff --git a/golang/configuration/config.go b/golang/configuration/config.go index 45946379..ce6ec80e 100644 --- a/golang/configuration/config.go +++ b/golang/configuration/config.go @@ -30,7 +30,6 @@ WS Header Host: %v%v%v WS Header Path : %v%v%v Address Port : %v%v%v SNI : %v%v%v -Start Proccess Timeout : %v%v%v Upload Test : %v%v%v Fronting Request Test : %v%v%v Minimum Download Speed : %v%v%v @@ -53,7 +52,6 @@ Total Threads : %v%v%v utils.Colors.OKBLUE, C.Config.WsHeaderPath, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Config.AddressPort, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Config.Sni, utils.Colors.ENDC, - utils.Colors.OKBLUE, C.Worker.StartProcessTimeout, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Config.DoUploadTest, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Config.DoFrontingTest, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Worker.Download.MinDlSpeed, utils.Colors.ENDC, diff --git a/golang/configuration/types.go b/golang/configuration/types.go index 13938bc0..86873420 100644 --- a/golang/configuration/types.go +++ b/golang/configuration/types.go @@ -8,11 +8,10 @@ type Configuration struct { } type Worker struct { - Download Download - Upload Upload - StartProcessTimeout float64 // seconds - Threads int - Vpn bool + Download Download + Upload Upload + Threads int + Vpn bool } type ConfigStruct struct { diff --git a/golang/run.go b/golang/run.go index 5c16a360..d26c84db 100644 --- a/golang/run.go +++ b/golang/run.go @@ -78,9 +78,8 @@ func run() *cobra.Command { }, Worker: configuration.Worker{ - Threads: threads, - Vpn: Vpn, - StartProcessTimeout: startProcessTimeout, + Threads: threads, + Vpn: Vpn, Download: struct { MinDlSpeed float64 MaxDlTime float64 diff --git a/golang/scanner/scanner.go b/golang/scanner/scanner.go index fa792bc3..343cf6db 100644 --- a/golang/scanner/scanner.go +++ b/golang/scanner/scanner.go @@ -73,7 +73,7 @@ func scanner(ip string, C config.Configuration, Worker config.Worker) *Result { } var err error - process = vpn.XRayInstance(xrayConfigPath, time.Duration(Worker.StartProcessTimeout)) + process = vpn.XRayInstance(xrayConfigPath) if err != nil { log.Printf("%vERROR - %vCould not start vpn service%v\n", diff --git a/golang/vpn/xray.go b/golang/vpn/xray.go index 37af2ab1..0167f319 100644 --- a/golang/vpn/xray.go +++ b/golang/vpn/xray.go @@ -6,8 +6,6 @@ import ( "log" "os" "os/signal" - "time" - // The following are necessary as they register handlers in their init functions. _ "github.com/xtls/xray-core/app/dispatcher" @@ -94,7 +92,7 @@ import ( //_ "github.com/xtls/xray-core/main/commands/all" ) -func XRayInstance(configPath string, timeout time.Duration) ScanWorker { +func XRayInstance(configPath string) ScanWorker { config, err := LoadConfig(configPath) if err != nil { log.Fatal(err)