ziozzang / socks5-proxy Goto Github PK
View Code? Open in Web Editor NEWSocks5 Proxy with Go Lang. support USER_ID/PASSWORD. able to bypass HTTPS(SNI) censorship
License: MIT License
Socks5 Proxy with Go Lang. support USER_ID/PASSWORD. able to bypass HTTPS(SNI) censorship
License: MIT License
Hi there! I've been trying to set up proxy server using your code. I removed srv.AuthNoAuthenticationRequiredCallback
(comment out) so proxy works only with provided login and password. I tested it with APT and it successfully updated packages:
Prompt from main.go after calling apt update
:
...
2023/08/06 15:20:49 user10 connecting to ru.archive.ubuntu.com:80
2023/08/06 15:20:49 Alowed host: ru.archive.ubuntu.com:80
2023/08/06 15:20:50 User Connected: 'user10'
2023/08/06 15:20:50 user10 connecting to esm.ubuntu.com:443
2023/08/06 15:20:50 Alowed host: esm.ubuntu.com:443
2023/08/06 15:20:54 Goodbye user10!
...
And i see terminal output, which means that proxy authentication worked perfectly, i got update:
# apt update
Hit:1 http://ru.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://ru.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
...
79 packages can be upgraded. Run 'apt list --upgradable' to see them.
But there is an issue with configuring proxy for Firefox, it does not prompt to enter login and password
2023/08/06 15:33:53 socks5: Conn.serve: Handshake failed: authentication failed
2023/08/06 15:33:54 socks5: Conn.serve: Handshake failed: authentication failed
Do you have any suggestions what is wrong and how to fix it?
The current SNI censorship bypass for non-TSL HTTP relies on checking if the first byte received is an alphabet ASCII character(server.go#L266), however this breaks the connection handling if the message is in simple ASCII and it isn't HTTP.
How to replicate:
Simply send a packet containing a simple ASCII string through the SOCKS proxy.
Example:
nc -klvp 8080
And in another terminal:
echo "Test" | proxychains nc -v 127.0.0.1 8080
This results in an slice bounds out of range error
2021/09/23 11:23:20 IP OK: '127.0.0.1'
2021/09/23 11:23:20 Alowed host: 127.0.0.1:8080
2021/09/23 11:23:20 Write: 1
2021/09/23 11:23:20 Plain HTTP
2021/09/23 11:23:20 > READ 3
2021/09/23 11:23:20 socks5: panic serving 127.0.0.1:19100: runtime error: slice bounds out of range [:-1]
goroutine 21174 [running]:
_/home/Iorpim/SOCKS5/socks5.(*Conn).serve.func1(0xc0005b6780)
/home/Iorpim/SOCKS5/socks5/server.go:335 +0xcf
panic(0x57a6a0, 0xc0000165a0)
/usr/lib/go-1.15/src/runtime/panic.go:969 +0x175
_/home/Iorpim/SOCKS5/socks5.(*Conn).commandConnect(0xc0005b6780, 0xc000694000, 0x0, 0x0)
/home/Iorpim/SOCKS5/socks5/server.go:278 +0x16b2
_/home/Iorpim/SOCKS5/socks5.(*Conn).command(0xc0005b6780, 0x0, 0x0)
/home/Iorpim/SOCKS5/socks5/server.go:324 +0x192
_/home/Iorpim/SOCKS5/socks5.(*Conn).serve(0xc0005b6780)
/home/Iorpim/SOCKS5/socks5/server.go:346 +0xf0
created by _/home/Iorpim/SOCKS5/socks5.(*Server).ListenAndServe
/home/Iorpim/SOCKS5/socks5/server.go:86 +0x2f8
Improving protocol detection, or simply assuming it isn't HTTP if an error is received during the detection segment, should fix it.
Hi ๐
This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.
Once you have closed this issue, I'll create separate pull requests for every update as soon as I find one.
That's it for now!
Happy merging! ๐ค
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.