GithubHelp home page GithubHelp logo

puxxustc / muon Goto Github PK

View Code? Open in Web Editor NEW
123.0 123.0 40.0 284 KB

A fast stateless VPN with simple obfuscation

License: GNU General Public License v3.0

Shell 5.41% C 89.18% Ruby 0.78% Makefile 1.47% M4 3.16%
vpn

muon's People

Contributors

puxxustc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

muon's Issues

Help needed sir

Hello sir i need a small help Muon server and Client Muon are connected fine ,I can ping Muon Client from Muon Server and login into Muon Client .But I cannot Ping Muon Client IP directly .How can I get internet on Muon Client

error when run "autoreconf -if"

I can install this software in ubuntu 14 but following error when run "autoreconf -if" in Debian 7. any package I need to install?

src/Makefile.am:5: compiling 3rd/minilzo.c' in subdir requiresAM_PROG_CC_C_O' in configure.ac' src/Makefile.am: installing./depcomp'
autoreconf: automake failed with exit status: 1

muon static file X86

Hello sir do you have binary for X86 please when i try to make i get error

/muon# make
make all-recursive
make[1]: Entering directory /root/muon' Making all in src make[2]: Entering directory /root/muon/src'
depbase=echo conf.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/root/muon/lz4/lib -I/root/muon/libmill -I/root/muon/libsodium/src/libsodium/include -O3 -pipe -W -Wall -fno-strict-aliasing -DAC_LITTLE_ENDIAN=1 -MT conf.o -MD -MP -MF $depbase.Tpo -c -o conf.o conf.c &&
mv -f $depbase.Tpo $depbase.Po
depbase=echo compress.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/root/muon/lz4/lib -I/root/muon/libmill -I/root/muon/libsodium/src/libsodium/include -O3 -pipe -W -Wall -fno-strict-aliasing -DAC_LITTLE_ENDIAN=1 -MT compress.o -MD -MP -MF $depbase.Tpo -c -o compress.o compress.c &&
mv -f $depbase.Tpo $depbase.Po
depbase=echo crypto.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/root/muon/lz4/lib -I/root/muon/libmill -I/root/muon/libsodium/src/libsodium/include -O3 -pipe -W -Wall -fno-strict-aliasing -DAC_LITTLE_ENDIAN=1 -MT crypto.o -MD -MP -MF $depbase.Tpo -c -o crypto.o crypto.c &&
mv -f $depbase.Tpo $depbase.Po
depbase=echo encapsulate.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/root/muon/lz4/lib -I/root/muon/libmill -I/root/muon/libsodium/src/libsodium/include -O3 -pipe -W -Wall -fno-strict-aliasing -DAC_LITTLE_ENDIAN=1 -MT encapsulate.o -MD -MP -MF $depbase.Tpo -c -o encapsulate.o encapsulate.c &&
mv -f $depbase.Tpo $depbase.Po
depbase=echo log.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/root/muon/lz4/lib -I/root/muon/libmill -I/root/muon/libsodium/src/libsodium/include -O3 -pipe -W -Wall -fno-strict-aliasing -DAC_LITTLE_ENDIAN=1 -MT log.o -MD -MP -MF $depbase.Tpo -c -o log.o log.c &&
mv -f $depbase.Tpo $depbase.Po
depbase=echo tunif.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/root/muon/lz4/lib -I/root/muon/libmill -I/root/muon/libsodium/src/libsodium/include -O3 -pipe -W -Wall -fno-strict-aliasing -DAC_LITTLE_ENDIAN=1 -MT tunif.o -MD -MP -MF $depbase.Tpo -c -o tunif.o tunif.c &&
mv -f $depbase.Tpo $depbase.Po
depbase=echo utils.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/root/muon/lz4/lib -I/root/muon/libmill -I/root/muon/libsodium/src/libsodium/include -O3 -pipe -W -Wall -fno-strict-aliasing -DAC_LITTLE_ENDIAN=1 -MT utils.o -MD -MP -MF $depbase.Tpo -c -o utils.o utils.c &&
mv -f $depbase.Tpo $depbase.Po
depbase=echo vpn.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/root/muon/lz4/lib -I/root/muon/libmill -I/root/muon/libsodium/src/libsodium/include -O3 -pipe -W -Wall -fno-strict-aliasing -DAC_LITTLE_ENDIAN=1 -MT vpn.o -MD -MP -MF $depbase.Tpo -c -o vpn.o vpn.c &&
mv -f $depbase.Tpo $depbase.Po
vpn.c: In function ‘client_hop’:
vpn.c:260:18: warning: variable ‘i’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
for (int i = 0; i < ctx.path_count; i++)
^
vpn.c: In function ‘vpn_run’:
vpn.c:157:18: warning: variable ‘i’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
for (int i = 0; i < ctx.path_count; i++)
^
vpn.c:159:22: warning: variable ‘j’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
for (int j = 0; j <= ctx.paths[i].port_range; j++)
^
depbase=echo totp.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/root/muon/lz4/lib -I/root/muon/libmill -I/root/muon/libsodium/src/libsodium/include -O3 -pipe -W -Wall -fno-strict-aliasing -DAC_LITTLE_ENDIAN=1 -MT totp.o -MD -MP -MF $depbase.Tpo -c -o totp.o totp.c &&
mv -f $depbase.Tpo $depbase.Po
depbase=echo main.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/root/muon/lz4/lib -I/root/muon/libmill -I/root/muon/libsodium/src/libsodium/include -O3 -pipe -W -Wall -fno-strict-aliasing -DAC_LITTLE_ENDIAN=1 -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o main.c &&
mv -f $depbase.Tpo $depbase.Po
gcc -std=gnu99 -O3 -pipe -W -Wall -fno-strict-aliasing -DAC_LITTLE_ENDIAN=1 -L/root/muon/lz4/lib -L/root/muon/libmill/.libs -L/root/muon/libsodium/src/libsodium/.libs -static -o muon conf.o compress.o crypto.o encapsulate.o log.o tunif.o utils.o vpn.o totp.o main.o -llz4 -lmill -lsodium
utils.o: In function runas': utils.c:(.text+0x10): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /root/muon/libsodium/src/libsodium/.libs/libsodium.a(libsodium_la-core.o): In function sodium_crit_enter':
/root/libsodium/src/libsodium/sodium/core.c:133: undefined reference to pthread_mutex_lock' /root/muon/libsodium/src/libsodium/.libs/libsodium.a(libsodium_la-core.o): In function sodium_crit_leave':
/root/libsodium/src/libsodium/sodium/core.c:153: undefined reference to pthread_mutex_unlock' /root/libsodium/src/libsodium/sodium/core.c:153: undefined reference to pthread_mutex_unlock'
/root/libsodium/src/libsodium/sodium/core.c:153: undefined reference to pthread_mutex_unlock' /root/libsodium/src/libsodium/sodium/core.c:153: undefined reference to pthread_mutex_unlock'
/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __register_frame_info_bases': (.text+0x173e): undefined reference to pthread_mutex_lock'
/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __register_frame_info_bases': (.text+0x1755): undefined reference to pthread_mutex_unlock'
/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __register_frame_info_table_bases': (.text+0x1855): undefined reference to pthread_mutex_lock'
/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __register_frame_info_table_bases': (.text+0x186c): undefined reference to pthread_mutex_unlock'
/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __deregister_frame_info_bases': (.text+0x193d): undefined reference to pthread_mutex_lock'
/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __deregister_frame_info_bases': (.text+0x19af): undefined reference to pthread_mutex_unlock'
/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a(unwind-dw2-fde-dip.o): In function _Unwind_Find_FDE': (.text+0x1a7a): undefined reference to pthread_mutex_lock'
/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a(unwind-dw2-fde-dip.o): In function _Unwind_Find_FDE': (.text+0x1ac9): undefined reference to pthread_mutex_unlock'
collect2: error: ld returned 1 exit status
make[2]: *** [muon] Error 1
make[2]: Leaving directory /root/muon/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /root/muon'
make: *** [all] Error 2

关于使用方法

想咨询下,多客户端的情况下是否打开nat,然后每个客户端配置不同的ip就可以了呢?

invalid packet from ...

Hi
When i run i get this on server side:

[18-03-20 22:47:23] starting muon server
[18-03-20 22:47:23] using tun device: tun0
[18-03-20 22:48:16] invalid packet from xx.xx.xx.xx:2421
[18-03-20 22:48:16] invalid packet from xx.xx.xx.xx:2733
[18-03-20 22:48:17] invalid packet from xx.xx.xx.xx:2100
[18-03-20 22:48:17] invalid packet from xx.xx.xx.xx:2684
[18-03-20 22:48:18] invalid packet from xx.xx.xx.xx:2533
[18-03-20 22:48:18] invalid packet from xx.xx.xx.xx:2317
[18-03-20 22:48:19] invalid packet from xx.xx.xx.xx:2525
[18-03-20 22:48:19] invalid packet from xx.xx.xx.xx:2746
[18-03-20 22:48:19] invalid packet from xx.xx.xx.xx:2746
[18-03-20 22:48:20] invalid packet from xx.xx.xx.xx:2056
[18-03-20 22:48:20] invalid packet from xx.xx.xx.xx:2631
[18-03-20 22:48:21] invalid packet from xx.xx.xx.xx:2122
[18-03-20 22:48:21] invalid packet from xx.xx.xx.xx:2076

But i think i was running muon with current config successfully before.

undefined reference to `clock_gettime'

sorry to bother you again.
still try to compile in my debian 7 box, got following error when "make" in muon folder:
libmill/timer.c:52: undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
Makefile:278: recipe for target 'muon' failed
make[2]: *** [muon] Error 1

how can i fix it?

[suggestion] Fork()

Hello Friend. Because you do not use mfork () from the library libmill ?.

Sorry for my bad english.

linux 64 and macos

I downloaded the pre-build for Linux_x86_64 and used it on Centos 7 as server and on Ubuntu 16.04 as client, also installed it on mac via homebrew as client as well.
but finally I did not make it work on linux or mac. Please take a look at below log and advise.

==========server.conf=======================================

user=nobody

mode=server

server=0.0.0.0

port=2000

key=XXXXXXXXXXXXXXXXXXXXXXX

tunif=tun1

mtu=1400

address=10.0.0.0/31

nat=no

delay=5

duplicate=0

==========client.conf=======================================

user=root

mode=client

server=xxxxxxxx

port=2000

key=XXXXXXXXXXXXXXXXXXXXXXX

tunif=tun1

mtu=1400

address=10.0.0.1/31

peer=10.0.0.0

route=yes

delay=5

duplicate=0

==============================================================================

Ping server on ubuntu
PING 10.0.0.0 (10.0.0.0) 56(84) bytes of data.
64 bytes from 10.0.0.0: icmp_seq=2 ttl=64 time=282 ms
64 bytes from 10.0.0.0: icmp_seq=3 ttl=64 time=275 ms
64 bytes from 10.0.0.0: icmp_seq=4 ttl=64 time=268 ms
64 bytes from 10.0.0.0: icmp_seq=7 ttl=64 time=282 ms
64 bytes from 10.0.0.0: icmp_seq=9 ttl=64 time=302 ms
64 bytes from 10.0.0.0: icmp_seq=10 ttl=64 time=287 ms
64 bytes from 10.0.0.0: icmp_seq=13 ttl=64 time=301 ms
64 bytes from 10.0.0.0: icmp_seq=15 ttl=64 time=297 ms
64 bytes from 10.0.0.0: icmp_seq=17 ttl=64 time=303 ms
64 bytes from 10.0.0.0: icmp_seq=19 ttl=64 time=312 ms
64 bytes from 10.0.0.0: icmp_seq=22 ttl=64 time=297 ms
^C
--- 10.0.0.0 ping statistics ---
25 packets transmitted, 11 received, 56% packet loss, time 24257ms
rtt min/avg/max/mdev = 268.422/291.950/312.578/12.903 ms

==============================================================================

Ping server on mac
PING 10.0.0.0: 56 data bytes
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4

==============================================================================

routing in client

what will the program do if set "route=yes" in client.conf?

I tested and guess it will try to add default to the tun "vpn0". Since my client system already has a default gateway which point to the my internal router ip. As result, program showed error. when I set "route=no", program can run well. The question turned to be -- how can I route traffic via the tun "vpn0"?

like "shadowvpn", run a shell script once the "vpn0" up maybe an idea, but any simpler way there? :-)

Can you give us more detail on usage?

For i finish every step in your tutorial , with no error , but also no connect
Also both server and client run correctly
Server log:

[16-12-31 14:02:44] starting muon server
[16-12-31 14:02:44] using tun device: tun

Client log:

[16-12-31 14:03:32] starting muon client
[16-12-31 14:03:32] using tun device: tun

Server config:

user=root
mode=server
server=*****
port=1205
key=*********
tunif=tun
mtu=1400
address=10.10.10.0/24
peer=10.10.10.2
nat=yes

Client conf:

user=root
mode=client
server=*****
port=1205
key=*********
tunif=tun
mtu=1400
address=10.10.10.0/24
peer=10.10.10.2
route=yes

编译muon时,make遇错

hi。
git clone https://github.com/puxxustc/muon
cd muon
autoreconf -if
export CPPFLAGS="-I$(pwd)/lz4/lib -I$(pwd)/libmill -I$(pwd)/libsodium/src/libsodium/include"
export LDFLAGS="-L$(pwd)/lz4/lib -L$(pwd)/libmill/.libs -L$(pwd)/libsodium/src/libsodium/.libs"
./configure --prefix=/usr --sysconfdir=/etc --enable-static
make

make遇错,显示:
utils.o: In function runas': utils.c:(.text+0x7): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking //usr/local/lib/libsodium.a(libsodium_la-core.o): In function sodium_crit_enter':
/root/libsodium/src/libsodium/sodium/core.c:118: undefined reference to pthread_mutex_lock' //usr/local/lib/libsodium.a(libsodium_la-core.o): In function sodium_crit_leave':
/root/libsodium/src/libsodium/sodium/core.c:136: undefined reference to pthread_mutex_unlock' /root/libsodium/src/libsodium/sodium/core.c:136: undefined reference to pthread_mutex_unlock'
/root/libsodium/src/libsodium/sodium/core.c:136: undefined reference to pthread_mutex_unlock' /root/libsodium/src/libsodium/sodium/core.c:136: undefined reference to pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __register_frame_info_bases': (.text+0x1787): undefined reference to pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __register_frame_info_table_bases': (.text+0x183b): undefined reference to pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __deregister_frame_info_bases': (.text+0x18de): undefined reference to pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __deregister_frame_info_bases': (.text+0x1966): undefined reference to pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function _Unwind_Find_FDE': (.text+0x1a36): undefined reference to pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function _Unwind_Find_FDE': (.text+0x1a86): undefined reference to pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __register_frame_info_bases': (.text+0x17a6): undefined reference to pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __register_frame_info_table_bases': (.text+0x185a): undefined reference to pthread_mutex_unlock'
collect2: error: ld returned 1 exit status
make[2]: *** [muon] Error 1
make[2]: Leaving directory /root/muon/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /root/muon'
make: *** [all] Error 2
[root@host muon]#

怎么解决错误?

incompatible with i386 ?

/usr/bin/ld: i386:x86-64 architecture of input file `tutorial/step8.o' is incompatible with i386 output
/usr/bin/ld: tutorial/step8.o: file class ELFCLASS64 incompatible with ELFCLASS32
/usr/bin/ld: final link failed: File in wrong format
collect2: error: ld returned 1 exit status
make: *** [tutorial/step8] Error 1

muon for X86

hello sir u don't have recompiled version for linux X86 please

failed to bind udp address

Unsure what's wrong. Maybe I set up my tun device wrong, I just added it as normal.

18-08-04 04:50:58] starting muon server
[18-08-04 04:50:58] using tun device: tun0
[18-08-04 04:50:58] failed to bind udp address

# muon server config

# user to set privilege to
user=evan

# server or client
mode=server

# server
server=0.0.0.0
port=14333-14666


# secret key for crypto
#   run `dd if=/dev/random bs=1 count=9 | md5sum' to create one
key= . . .


# TUN device name, tunX for linux, utunX for darwin
tunif=tun0

# MTU of TUN device
#   Ethernet: 1500 - 20(IPv4, or 40 for IPv6) - 8(UDP) - 20(muon)
#   PPPoE: 1492 - 20(IPv4, or 40 for IPv6) - 8(UDP) - 20(muon)
mtu=1400

# IPv4 address of TUN device, CIDR notation
address=10.10.10.0/31

# IPv6 address of TUN device, CIDR notation
#address6=

# enable NAT or not
nat=no

Hoping someone can share some insight in to how I should start solving this.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.