GithubHelp home page GithubHelp logo

qwj / python-vpn Goto Github PK

View Code? Open in Web Editor NEW
328.0 6.0 90.0 130 KB

VPN Server implemented in pure Python. (For Research Purposes Only)

License: MIT License

Python 100.00%
vpn ike ikev1 ikev2 psk python tunnel ipsec esp wireguard

python-vpn's Introduction

python-vpn

made-with-python PyPI-version Hit-Count Downloads Downloads-month Downloads-week

VPN Server implemented in pure Python. (For Research Purposes Only)

Introduction

All VPN softwares are stupid, clumsy and hard to configure. So comes python-vpn.

  • NO app install needed
  • NO server configuration file
  • NO network interface added
  • NO iptables or "/etc" modified

Press "RETURN" to start, "CTRL+C" to stop.

QuickStart

$ pip3 install pvpn
Successfully installed pvpn-0.2.1
$ pvpn -p yourpassword
Serving on UDP :500 :4500...
^C
$ pvpn -wg 9000
Serving on UDP :500 :4500...
Serving on UDP :9000 (WIREGUARD)...
^C

Open server's UDP port :500 :4500 to your device. In device's system setting, add an "IPSec" (iOS) or "IPSec IKE PSK" (Android) node, write down the server address and password "yourpassword". Connect.

If you prefer wireguard VPN, specify "-wg (port)" parameter and open server's (port) UDP port to your device. Paste the printed server public key to wireguard client settings, write down the server address:port. Connect.

You should modify the default password "test" with a good one. See "pvpn -h" for more options.

Features

  • Clean, lightweight
  • IKEv1, IKEv2, L2TP auto-detection
  • WireGuard
  • TCP stack
  • TCP/UDP tunnel
  • DNS cache

Protocols

Protocol Name Name in iOS Name in Android Name in MacOS Name in Windows
L2TP PSK ✔ L2TP "L2TP/IPSec PSK" L2TP/IPSec L2TP
IKEv1 PSK ✔ IPsec [1] "IPSec Xauth PSK" Cisco IPSec IPSec
IKEv2 PSK ✔ IKEv2 [2] "IPSec IKEv2 PSK" IKEv2 IKEv2
WireGuard ✔ WireGuard App ** [3]**
[1] Do not use certificates
[2] Turn off "user authentication"
[3] Turn off "preshared key"

Examples

  • TCP Tunnel

    If the remote host match in file "rules.country", tunnel through http proxy.
    
    $ pvpn -r http://remote_server:port?rules.country
  • UDP Tunnel

    Redirect all DNS requests to 8.8.8.8.
    
    $ pvpn -ur tunnel://8.8.8.8:53?{53}

Specifications

IPSec/ESP

  • RFC2406 IP Encapsulating Security Payload (ESP)
  • RFC3947 Negotiation of NAT-Traversal in the IKE
  • RFC3948 UDP Encapsulation of IPsec ESP Packets

IKE/ISAKMP

  • RFC2407 The Internet IP Security Domain of Interpretation for ISAKMP
  • RFC2408 Internet Security Association and Key Management Protocol (ISAKMP)
  • RFC2409 The Internet Key Exchange (IKE)
  • IANA_01 Internet Key Exchange (IKE) Attributes
  • IANA_02 "Magic Numbers" for ISAKMP Protocol
  • DRAFT_1 The ISAKMP Configuration Method
  • DRAFT_2 Extended Authentication within IKE (XAUTH)

IKEv2

  • RFC7296 Internet Key Exchange Protocol Version 2 (IKEv2)
  • IANA_03 Internet Key Exchange Version 2 (IKEv2) Parameters
  • RFC3748 Extensible Authentication Protocol (EAP)
  • RFC5106 The Extensible Authentication Protocol-Internet Key Exchange Protocol version 2 (EAP-IKEv2) Method

Diffie Hellman

  • RFC3526 More Modular Exponential (MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)
  • RFC5903 Elliptic Curve Groups modulo a Prime (ECP Groups) for IKE and IKEv2
  • RFC5114 Additional Diffie-Hellman Groups for Use with IETF Standards

L2TP

  • RFC2661 Layer Two Tunneling Protocol "L2TP"
  • RFC3193 Securing L2TP using IPsec
  • RFC1549 PPP in HDLC Framing
  • RFC1661 The Point-to-Point Protocol (PPP)
  • RFC1332 The PPP Internet Protocol Control Protocol (IPCP)

WireGuard

python-vpn's People

Contributors

qwj 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

python-vpn's Issues

Windows Server 2016 - No outside internet

Hi there,

I've been playing around with this, hosting it on a Windows 2016 server and connecting from my Mac. The MacBook can cannot to the VPN fine and can connect via Remote Desktop to the server whilst on the VPN, but it appears to provide no pass-through connection to the outside world using the internet connection that the server has, any ideas?

Internal bugs in code (unsupported Android 12?)

Error log:

Serving on UDP :500 :4500...
IKE_SA_INIT(spi_i=2158a8c77dbd4a0f, spi_r=0000000000000000, version=2.0, flag=MsgFlag.Initiator, message_id=0, SA(IKE:1(spi=None, ENCR_AES_CTR(keylen=256), ENCR_AES_CBC(keylen=256), ENCR_AES_CTR(keylen=192), ENCR_AES_CBC(keylen=192), ENCR_AES_CTR(keylen=128), ENCR_AES_CBC(keylen=128), AUTH_HMAC_SHA2_512_256, AUTH_HMAC_SHA2_384_192, AUTH_HMAC_SHA2_256_128, AUTH_AES_XCBC_96, AUTH_AES_CMAC_96, DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC), IKE:2(spi=None, ENCR_CHACHA20_POLY1305, ENCR_AES_GCM_16(keylen=256), ENCR_AES_GCM_12(keylen=256), ENCR_AES_GCM_8(keylen=256), ENCR_AES_GCM_16(keylen=192), ENCR_AES_GCM_12(keylen=192), ENCR_AES_GCM_8(keylen=192), ENCR_AES_GCM_16(keylen=128), ENCR_AES_GCM_12(keylen=128), ENCR_AES_GCM_8(keylen=128), DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC)), KE(16, 797162594ca822f4f801fa370c9a1934bc8def08eba1d75d86f74f2d78de76d2af692d22f89e5ff19c9e57b0f4f59e9af37cf2c0a486cd68ff2007fff03243ceaaf8b568a55f1a322dcc8a27ec18891a7986f37c3924070eb044756e5390306b2ab08df773fa44ca63811bb7e47642c7e71298f091027fbe7868c15ba8953750fd22455fbaac9929af4ba75c088fab5a5dc8d3f0b44c7e81becbb32de935e3f8c2326759d007d06e38531d87698f20d4c75285d44b1fd288a567960dd32f9a0c087f20ae7cfa64ad6eeaa1b200f70ce6177484e3f8ba126b284dbf2419056f711a9a92fa03d8a95a56f980a34af9dcf16ed529c4be55576464a7f478b207b823fa27eebe0d317fb0ff69b476da0868736bc9f643203d0c3dce4a33535ea79ab50466fc210abd89f0cc56179474456c043b2be934d753c85e1b285465cd3442132ac4072cdf9c2c6a366b98ab582a3496eead4684c16e61bc9c1414a390a6842aca44322f0fdc8b5eb7c381b69a6b2a9f5324f8d98f0e672605b4dacbdfbac6547a6b1d07594c00d6621351512d73102f47fa48d1fdbef5a7cb942c97efdb5ba4db2d90f1ff39ecd210b4df46e40e2640f54d9a986a8f64569f190fe66b803555e9c0942b072adf27c11ef19a6e1d7418cb96ff1b36b4c1367a329dbab2b302eda029fdc62453612461f5c52fbd09e931aa4d89e2b1f36c99db388bd482dab4f6), NONCE(43be6e3e8038e4856c1d6c9a880e470af81c7617ec9438255accd2d3e9ecf706), NOTIFY(NAT_DETECTION_SOURCE_IP(data=fdf1696fb2bea54b07d0ecd321732b7908a4a2a8)), NOTIFY(NAT_DETECTION_DESTINATION_IP(data=c773baab886de0438d356628f66e2c2d344bbfcc)), NOTIFY(IKEV2_FRAGMENTATION_SUPPORTED()), NOTIFY(SIGNATURE_HASH_ALGORITHMS(data=0001000200030004)))
Exception in callback _SelectorDatagramTransport._read_ready()
handle: <Handle _SelectorDatagramTransport._read_ready()>
Traceback (most recent call last):
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/usr/lib/python3.10/asyncio/selector_events.py", line 1026, in _read_ready
self._protocol.datagram_received(data, addr)
File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 394, in datagram_received
session.process(request, stream, addr[:2], lambda response: self.transport.sendto(response_header+response, addr))
File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 273, in process
prefered_dh = chosen_proposal.get_transform(enums.Transform.DH).id
AttributeError: 'NoneType' object has no attribute 'get_transform'
IKE_SA_INIT(spi_i=2158a8c77dbd4a0f, spi_r=0000000000000000, version=2.0, flag=MsgFlag.Initiator, message_id=0, SA(IKE:1(spi=None, ENCR_AES_CTR(keylen=256), ENCR_AES_CBC(keylen=256), ENCR_AES_CTR(keylen=192), ENCR_AES_CBC(keylen=192), ENCR_AES_CTR(keylen=128), ENCR_AES_CBC(keylen=128), AUTH_HMAC_SHA2_512_256, AUTH_HMAC_SHA2_384_192, AUTH_HMAC_SHA2_256_128, AUTH_AES_XCBC_96, AUTH_AES_CMAC_96, DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC), IKE:2(spi=None, ENCR_CHACHA20_POLY1305, ENCR_AES_GCM_16(keylen=256), ENCR_AES_GCM_12(keylen=256), ENCR_AES_GCM_8(keylen=256), ENCR_AES_GCM_16(keylen=192), ENCR_AES_GCM_12(keylen=192), ENCR_AES_GCM_8(keylen=192), ENCR_AES_GCM_16(keylen=128), ENCR_AES_GCM_12(keylen=128), ENCR_AES_GCM_8(keylen=128), DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC)), KE(16, 797162594ca822f4f801fa370c9a1934bc8def08eba1d75d86f74f2d78de76d2af692d22f89e5ff19c9e57b0f4f59e9af37cf2c0a486cd68ff2007fff03243ceaaf8b568a55f1a322dcc8a27ec18891a7986f37c3924070eb044756e5390306b2ab08df773fa44ca63811bb7e47642c7e71298f091027fbe7868c15ba8953750fd22455fbaac9929af4ba75c088fab5a5dc8d3f0b44c7e81becbb32de935e3f8c2326759d007d06e38531d87698f20d4c75285d44b1fd288a567960dd32f9a0c087f20ae7cfa64ad6eeaa1b200f70ce6177484e3f8ba126b284dbf2419056f711a9a92fa03d8a95a56f980a34af9dcf16ed529c4be55576464a7f478b207b823fa27eebe0d317fb0ff69b476da0868736bc9f643203d0c3dce4a33535ea79ab50466fc210abd89f0cc56179474456c043b2be934d753c85e1b285465cd3442132ac4072cdf9c2c6a366b98ab582a3496eead4684c16e61bc9c1414a390a6842aca44322f0fdc8b5eb7c381b69a6b2a9f5324f8d98f0e672605b4dacbdfbac6547a6b1d07594c00d6621351512d73102f47fa48d1fdbef5a7cb942c97efdb5ba4db2d90f1ff39ecd210b4df46e40e2640f54d9a986a8f64569f190fe66b803555e9c0942b072adf27c11ef19a6e1d7418cb96ff1b36b4c1367a329dbab2b302eda029fdc62453612461f5c52fbd09e931aa4d89e2b1f36c99db388bd482dab4f6), NONCE(43be6e3e8038e4856c1d6c9a880e470af81c7617ec9438255accd2d3e9ecf706), NOTIFY(NAT_DETECTION_SOURCE_IP(data=fdf1696fb2bea54b07d0ecd321732b7908a4a2a8)), NOTIFY(NAT_DETECTION_DESTINATION_IP(data=c773baab886de0438d356628f66e2c2d344bbfcc)), NOTIFY(IKEV2_FRAGMENTATION_SUPPORTED()), NOTIFY(SIGNATURE_HASH_ALGORITHMS(data=0001000200030004)))
Exception in callback _SelectorDatagramTransport._read_ready()
handle: <Handle _SelectorDatagramTransport._read_ready()>
Traceback (most recent call last):
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/usr/lib/python3.10/asyncio/selector_events.py", line 1026, in _read_ready
self._protocol.datagram_received(data, addr)
File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 394, in datagram_received
session.process(request, stream, addr[:2], lambda response: self.transport.sendto(response_header+response, addr))
File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 273, in process
prefered_dh = chosen_proposal.get_transform(enums.Transform.DH).id
AttributeError: 'NoneType' object has no attribute 'get_transform'
IKE_SA_INIT(spi_i=2158a8c77dbd4a0f, spi_r=0000000000000000, version=2.0, flag=MsgFlag.Initiator, message_id=0, SA(IKE:1(spi=None, ENCR_AES_CTR(keylen=256), ENCR_AES_CBC(keylen=256), ENCR_AES_CTR(keylen=192), ENCR_AES_CBC(keylen=192), ENCR_AES_CTR(keylen=128), ENCR_AES_CBC(keylen=128), AUTH_HMAC_SHA2_512_256, AUTH_HMAC_SHA2_384_192, AUTH_HMAC_SHA2_256_128, AUTH_AES_XCBC_96, AUTH_AES_CMAC_96, DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC), IKE:2(spi=None, ENCR_CHACHA20_POLY1305, ENCR_AES_GCM_16(keylen=256), ENCR_AES_GCM_12(keylen=256), ENCR_AES_GCM_8(keylen=256), ENCR_AES_GCM_16(keylen=192), ENCR_AES_GCM_12(keylen=192), ENCR_AES_GCM_8(keylen=192), ENCR_AES_GCM_16(keylen=128), ENCR_AES_GCM_12(keylen=128), ENCR_AES_GCM_8(keylen=128), DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC)), KE(16, 797162594ca822f4f801fa370c9a1934bc8def08eba1d75d86f74f2d78de76d2af692d22f89e5ff19c9e57b0f4f59e9af37cf2c0a486cd68ff2007fff03243ceaaf8b568a55f1a322dcc8a27ec18891a7986f37c3924070eb044756e5390306b2ab08df773fa44ca63811bb7e47642c7e71298f091027fbe7868c15ba8953750fd22455fbaac9929af4ba75c088fab5a5dc8d3f0b44c7e81becbb32de935e3f8c2326759d007d06e38531d87698f20d4c75285d44b1fd288a567960dd32f9a0c087f20ae7cfa64ad6eeaa1b200f70ce6177484e3f8ba126b284dbf2419056f711a9a92fa03d8a95a56f980a34af9dcf16ed529c4be55576464a7f478b207b823fa27eebe0d317fb0ff69b476da0868736bc9f643203d0c3dce4a33535ea79ab50466fc210abd89f0cc56179474456c043b2be934d753c85e1b285465cd3442132ac4072cdf9c2c6a366b98ab582a3496eead4684c16e61bc9c1414a390a6842aca44322f0fdc8b5eb7c381b69a6b2a9f5324f8d98f0e672605b4dacbdfbac6547a6b1d07594c00d6621351512d73102f47fa48d1fdbef5a7cb942c97efdb5ba4db2d90f1ff39ecd210b4df46e40e2640f54d9a986a8f64569f190fe66b803555e9c0942b072adf27c11ef19a6e1d7418cb96ff1b36b4c1367a329dbab2b302eda029fdc62453612461f5c52fbd09e931aa4d89e2b1f36c99db388bd482dab4f6), NONCE(43be6e3e8038e4856c1d6c9a880e470af81c7617ec9438255accd2d3e9ecf706), NOTIFY(NAT_DETECTION_SOURCE_IP(data=fdf1696fb2bea54b07d0ecd321732b7908a4a2a8)), NOTIFY(NAT_DETECTION_DESTINATION_IP(data=c773baab886de0438d356628f66e2c2d344bbfcc)), NOTIFY(IKEV2_FRAGMENTATION_SUPPORTED()), NOTIFY(SIGNATURE_HASH_ALGORITHMS(data=0001000200030004)))
Exception in callback _SelectorDatagramTransport._read_ready()
handle: <Handle _SelectorDatagramTransport._read_ready()>
Traceback (most recent call last):
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/usr/lib/python3.10/asyncio/selector_events.py", line 1026, in _read_ready
self._protocol.datagram_received(data, addr)
File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 394, in datagram_received
session.process(request, stream, addr[:2], lambda response: self.transport.sendto(response_header+response, addr))
File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 273, in process
prefered_dh = chosen_proposal.get_transform(enums.Transform.DH).id
AttributeError: 'NoneType' object has no attribute 'get_transform'

IKE_SA_INIT(spi_i=2158a8c77dbd4a0f, spi_r=0000000000000000, version=2.0, flag=MsgFlag.Initiator, message_id=0, SA(IKE:1(spi=None, ENCR_AES_CTR(keylen=256), ENCR_AES_CBC(keylen=256), ENCR_AES_CTR(keylen=192), ENCR_AES_CBC(keylen=192), ENCR_AES_CTR(keylen=128), ENCR_AES_CBC(keylen=128), AUTH_HMAC_SHA2_512_256, AUTH_HMAC_SHA2_384_192, AUTH_HMAC_SHA2_256_128, AUTH_AES_XCBC_96, AUTH_AES_CMAC_96, DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC), IKE:2(spi=None, ENCR_CHACHA20_POLY1305, ENCR_AES_GCM_16(keylen=256), ENCR_AES_GCM_12(keylen=256), ENCR_AES_GCM_8(keylen=256), ENCR_AES_GCM_16(keylen=192), ENCR_AES_GCM_12(keylen=192), ENCR_AES_GCM_8(keylen=192), ENCR_AES_GCM_16(keylen=128), ENCR_AES_GCM_12(keylen=128), ENCR_AES_GCM_8(keylen=128), DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC)), KE(16, 797162594ca822f4f801fa370c9a1934bc8def08eba1d75d86f74f2d78de76d2af692d22f89e5ff19c9e57b0f4f59e9af37cf2c0a486cd68ff2007fff03243ceaaf8b568a55f1a322dcc8a27ec18891a7986f37c3924070eb044756e5390306b2ab08df773fa44ca63811bb7e47642c7e71298f091027fbe7868c15ba8953750fd22455fbaac9929af4ba75c088fab5a5dc8d3f0b44c7e81becbb32de935e3f8c2326759d007d06e38531d87698f20d4c75285d44b1fd288a567960dd32f9a0c087f20ae7cfa64ad6eeaa1b200f70ce6177484e3f8ba126b284dbf2419056f711a9a92fa03d8a95a56f980a34af9dcf16ed529c4be55576464a7f478b207b823fa27eebe0d317fb0ff69b476da0868736bc9f643203d0c3dce4a33535ea79ab50466fc210abd89f0cc56179474456c043b2be934d753c85e1b285465cd3442132ac4072cdf9c2c6a366b98ab582a3496eead4684c16e61bc9c1414a390a6842aca44322f0fdc8b5eb7c381b69a6b2a9f5324f8d98f0e672605b4dacbdfbac6547a6b1d07594c00d6621351512d73102f47fa48d1fdbef5a7cb942c97efdb5ba4db2d90f1ff39ecd210b4df46e40e2640f54d9a986a8f64569f190fe66b803555e9c0942b072adf27c11ef19a6e1d7418cb96ff1b36b4c1367a329dbab2b302eda029fdc62453612461f5c52fbd09e931aa4d89e2b1f36c99db388bd482dab4f6), NONCE(43be6e3e8038e4856c1d6c9a880e470af81c7617ec9438255accd2d3e9ecf706), NOTIFY(NAT_DETECTION_SOURCE_IP(data=fdf1696fb2bea54b07d0ecd321732b7908a4a2a8)), NOTIFY(NAT_DETECTION_DESTINATION_IP(data=c773baab886de0438d356628f66e2c2d344bbfcc)), NOTIFY(IKEV2_FRAGMENTATION_SUPPORTED()), NOTIFY(SIGNATURE_HASH_ALGORITHMS(data=0001000200030004)))
Exception in callback _SelectorDatagramTransport._read_ready()
handle: <Handle _SelectorDatagramTransport._read_ready()>
Traceback (most recent call last):
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/usr/lib/python3.10/asyncio/selector_events.py", line 1026, in _read_ready
self._protocol.datagram_received(data, addr)
File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 394, in datagram_received
session.process(request, stream, addr[:2], lambda response: self.transport.sendto(response_header+response, addr))
File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 273, in process
prefered_dh = chosen_proposal.get_transform(enums.Transform.DH).id
AttributeError: 'NoneType' object has no attribute 'get_transform'
IKE_SA_INIT(spi_i=2158a8c77dbd4a0f, spi_r=0000000000000000, version=2.0, flag=MsgFlag.Initiator, message_id=0, SA(IKE:1(spi=None, ENCR_AES_CTR(keylen=256), ENCR_AES_CBC(keylen=256), ENCR_AES_CTR(keylen=192), ENCR_AES_CBC(keylen=192), ENCR_AES_CTR(keylen=128), ENCR_AES_CBC(keylen=128), AUTH_HMAC_SHA2_512_256, AUTH_HMAC_SHA2_384_192, AUTH_HMAC_SHA2_256_128, AUTH_AES_XCBC_96, AUTH_AES_CMAC_96, DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC), IKE:2(spi=None, ENCR_CHACHA20_POLY1305, ENCR_AES_GCM_16(keylen=256), ENCR_AES_GCM_12(keylen=256), ENCR_AES_GCM_8(keylen=256), ENCR_AES_GCM_16(keylen=192), ENCR_AES_GCM_12(keylen=192), ENCR_AES_GCM_8(keylen=192), ENCR_AES_GCM_16(keylen=128), ENCR_AES_GCM_12(keylen=128), ENCR_AES_GCM_8(keylen=128), DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC)), KE(16, 797162594ca822f4f801fa370c9a1934bc8def08eba1d75d86f74f2d78de76d2af692d22f89e5ff19c9e57b0f4f59e9af37cf2c0a486cd68ff2007fff03243ceaaf8b568a55f1a322dcc8a27ec18891a7986f37c3924070eb044756e5390306b2ab08df773fa44ca63811bb7e47642c7e71298f091027fbe7868c15ba8953750fd22455fbaac9929af4ba75c088fab5a5dc8d3f0b44c7e81becbb32de935e3f8c2326759d007d06e38531d87698f20d4c75285d44b1fd288a567960dd32f9a0c087f20ae7cfa64ad6eeaa1b200f70ce6177484e3f8ba126b284dbf2419056f711a9a92fa03d8a95a56f980a34af9dcf16ed529c4be55576464a7f478b207b823fa27eebe0d317fb0ff69b476da0868736bc9f643203d0c3dce4a33535ea79ab50466fc210abd89f0cc56179474456c043b2be934d753c85e1b285465cd3442132ac4072cdf9c2c6a366b98ab582a3496eead4684c16e61bc9c1414a390a6842aca44322f0fdc8b5eb7c381b69a6b2a9f5324f8d98f0e672605b4dacbdfbac6547a6b1d07594c00d6621351512d73102f47fa48d1fdbef5a7cb942c97efdb5ba4db2d90f1ff39ecd210b4df46e40e2640f54d9a986a8f64569f190fe66b803555e9c0942b072adf27c11ef19a6e1d7418cb96ff1b36b4c1367a329dbab2b302eda029fdc62453612461f5c52fbd09e931aa4d89e2b1f36c99db388bd482dab4f6), NONCE(43be6e3e8038e4856c1d6c9a880e470af81c7617ec9438255accd2d3e9ecf706), NOTIFY(NAT_DETECTION_SOURCE_IP(data=fdf1696fb2bea54b07d0ecd321732b7908a4a2a8)), NOTIFY(NAT_DETECTION_DESTINATION_IP(data=c773baab886de0438d356628f66e2c2d344bbfcc)), NOTIFY(IKEV2_FRAGMENTATION_SUPPORTED()), NOTIFY(SIGNATURE_HASH_ALGORITHMS(data=0001000200030004)))
Exception in callback _SelectorDatagramTransport._read_ready()
handle: <Handle _SelectorDatagramTransport._read_ready()>
Traceback (most recent call last):
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/usr/lib/python3.10/asyncio/selector_events.py", line 1026, in _read_ready
self._protocol.datagram_received(data, addr)
File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 394, in datagram_received
session.process(request, stream, addr[:2], lambda response: self.transport.sendto(response_header+response, addr))
File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 273, in process
prefered_dh = chosen_proposal.get_transform(enums.Transform.DH).id
AttributeError: 'NoneType' object has no attribute 'get_transform'

`

UDP requests through PVPN

Hi,
I do not see UDP requests being sent to the wireguard server.
The logs show only TCP requests.
Could you please look into it.

Thank you

Not working on Ubuntu

I am trying to setup IKE server and Client on Ubuntu matchine in LAN.
But unable to see any packets on wireshark.

VPN not relaying any traffic

Running pvpn as a wireguard server:

$ .venv/bin/python -m pvpn -wg 51820 -v
Serving on UDP :500 :4500...
======== WIREGUARD SETTING ========
PublicKey: -----
===================================
Serving on UDP :51820 (WIREGUARD)...

I have a rule to forward all traffic to 1.2.3.4 through the wireguard interface (just for testing):
ip route add "1.2.3.4/32" dev wg0 proto static

but when I try to get a webpage hosted on that server:
$ wget 1.2.3.4

pvpn doesn't send any traffic back, it only spams verbose logs about a TCP connection from an ever increasing port:

login ('127.0.0.1', 35044) 225959148
TCP 127.0.0.1:53316 -> 162.247.224.52:80
TCP 127.0.0.1:53318 -> 162.247.224.52:80
TCP 127.0.0.1:53320 -> 162.247.224.52:80
TCP 127.0.0.1:53322 -> 162.247.224.52:80
TCP 127.0.0.1:53324 -> 162.247.224.52:80
TCP 127.0.0.1:53326 -> 162.247.224.52:80
TCP 127.0.0.1:53328 -> 162.247.224.52:80
TCP 127.0.0.1:53330 -> 162.247.224.52:80
<forever>

This is all running locally on one machine, I would expect that pvpn would simply act as a relay for the traffic. Am I misunderstanding something? Do I have a wrong configuration? I'm not really sure how the -r and -ur parameters are supposed to be used. 😞

member system ? keep track of data traffic usage?

dear sir, first of all, i want to say that it is a genius tech and you rock !

I am building a program that has a membership system. is it possible for you to develop a member system so that a administrator or a manager can monitor and keep track of the data usage of each user in a membership program ? or maybe a user tag ? if it can return the network data traffic usage of each user, it would really be wonderful.

thank you again for contributing this great product.

User and Pass on android?

"IPSec IKE PSK" doesn't exist on android, just google it and you'll see no results.
What's the username and password that needs to be used on android?
It's funny how you call other programs "stupid", but yours is the one I'd more trouble setting up.

request

can you add phase 1 and phase 2 algorithm with certificates ?

Remote ID

Hi there,

When configuring an IKEv2 connection on macOS, you are required to provide a remote ID alongside the PSK when connecting. Is there any way to define this in the software to add an additional layer of security beyond just a PSK?

How to connect Windows client correctly?

Below, there are entries for the server address, password and username. What should I put for the username? And how do I note the specific port (500/4500)? Thanks in advance.

image

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.