currently, many proxy use http proxy or socks5 proxy protocol, all of them need the program support proxy protocol
actually this is a big limit, when you use some programs don't support specify the proxy, or it's very hard to enable the proxy, you will want to smash you computer :(
lycoris can solve this problem, at least solve the 95%
there are 3 parts about lycoris
- lycoris-bpf
- lycoris-client
- lycoris-server
- lycoris-protocol
lycoris-bpf
will hook all socket connect, and check if the dst ip should be proxies or not, if it is a need proxy ip,
lycoris-bpf will change the socket dst ip to lycoris-client
, and save the real dst ip and port in bpf socket
sk_storage
, then hook lycoris-client
TcpListener
getsockname
to allow lycoris-client
get the real dst ip and
port, so lycoris-client
can get it and send the dst ip and port to lycoris-server
to connect the
target
also lycoris-bpf>4.0
now will also hook getpeername
for the connecting socket so it will get the real dst ip and
port too
lycoris-client
will listen a tcp socket, when a new tcp accepted, it will get the real dst ip and port through hooked
getsockname
, and send to lycoris-server
lycoris-server
is a simple proxy server, like camouflage, trojan or
something else
lycoris-protocol
provide a way to use lycoris transport protocol, it can base on any reliable transmission
it just a simple txt like
127.0.0.1/8
10.100.0.0/16
- TCP4 proxy
- UDP4 proxy(needs good idea)
- TCP6 proxy
- UDP6 proxy(needs good idea)
- ip list filter
- container proxy
- need set
container_bridge_listen_addr
andcontainer_bridge_listen_addr_v6
- podman with slirp4netns doesn't need set, it connects tcp outside the container
- docker need set, if use bridge+veth mode
- need set
- process comm filter
lycoris require nightly rust toolchain when build lycoris-bpf
- rust toolchain
- bpf-linker(can installed by
cargo install
)
just run cargo build --release
- you can't build in the lycoris root dir, you should build inside
bpf
,client
,server
dir, becauselycoris-bpf
target isbpfel-unknown-none
- when build the
lycoris-bpf
, you must use release build mode, otherwise rustc and llvm will generate some instruction which will make bpf verifier unhappy