Created
February 26, 2022 23:05
-
-
Save gboddin/9b809c0649a1d17d26ed6e71ae75899c to your computer and use it in GitHub Desktop.
mini socks proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./proxy 5858 | |
-> open proxy on port 5858 | |
$ curl -x socks5h://<target>:5858 http://192.168.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/armon/go-socks5" | |
"os" | |
) | |
func main() { | |
// Create a SOCKS5 server | |
conf := &socks5.Config{} | |
server, err := socks5.New(conf) | |
if err != nil { | |
panic(err) | |
} | |
// Create SOCKS5 proxy on localhost port 8000 | |
if err := server.ListenAndServe("tcp", "0.0.0.0:" + os.Args[1]); err != nil { | |
panic(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment