Can't connect to openvpn in docker container (kali linux)

217 Views Asked by At

Here is the whole message I'm getting:

2023-11-21 14:26:21 WARNING: Compression for receiving enabled. Compression has been used in the past to break encryption. Sent packets are not compressed unless "allow-compression yes" is also set.
2023-11-21 14:26:21 Note: --data-cipher-fallback with cipher 'AES-128-CBC' disables data channel offload.
2023-11-21 14:26:21 OpenVPN 2.6.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] [DCO]
2023-11-21 14:26:21 library versions: OpenSSL 3.0.11 19 Sep 2023, LZO 2.10
2023-11-21 14:26:21 DCO version: N/A
2023-11-21 14:26:26 TCP/UDP: Preserving recently used remote address: [AF_INET]142.234.200.48:1337
2023-11-21 14:26:26 Socket Buffers: R=[212992->212992] S=[212992->212992]
2023-11-21 14:26:26 UDPv4 link local: (not bound)
2023-11-21 14:26:26 UDPv4 link remote: [AF_INET]142.234.200.48:1337
2023-11-21 14:26:26 TLS: Initial packet from [AF_INET]142.234.200.48:1337, sid=622ca76c 52931832
2023-11-21 14:26:26 VERIFY OK: depth=1, C=UK, ST=City, L=London, O=HackTheBox, CN=HackTheBox CA, name=htb, [email protected]
2023-11-21 14:26:26 VERIFY KU OK
2023-11-21 14:26:26 Validating certificate extended key usage
2023-11-21 14:26:26 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
2023-11-21 14:26:26 VERIFY EKU OK
2023-11-21 14:26:26 VERIFY OK: depth=0, C=UK, ST=City, L=London, O=HackTheBox, CN=htb, name=htb, [email protected]
2023-11-21 14:26:27 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, peer certificate: 2048 bits RSA, signature: RSA-SHA1, peer temporary key: 253 bits X25519
2023-11-21 14:26:27 [htb] Peer Connection Initiated with [AF_INET]142.234.200.48:1337
2023-11-21 14:26:27 TLS: move_session: dest=TM_ACTIVE src=TM_INITIAL reinit_src=1
2023-11-21 14:26:27 TLS: tls_multi_process: initial untrusted session promoted to trusted
2023-11-21 14:26:27 PUSH: Received control message: 'PUSH_REPLY,route 10.10.10.0 255.255.254.0,route 10.129.0.0 255.255.0.0,route-ipv6 dead:beef::/64,tun-ipv6,route-gateway 10.10.14.1,topology subnet,ping 10,ping-restart 120,ifconfig-ipv6 dead:beef:2::109e/64 dead:beef:2::1,ifconfig 10.10.14.160 255.255.254.0,peer-id 0,cipher AES-256-CBC'
2023-11-21 14:26:27 OPTIONS IMPORT: --ifconfig/up options modified
2023-11-21 14:26:27 OPTIONS IMPORT: route options modified
2023-11-21 14:26:27 OPTIONS IMPORT: route-related options modified
2023-11-21 14:26:27 net_route_v4_best_gw query: dst 0.0.0.0
2023-11-21 14:26:27 net_route_v4_best_gw result: via 172.17.0.1 dev eth0
2023-11-21 14:26:27 ROUTE_GATEWAY 172.17.0.1/255.255.0.0 IFACE=eth0 HWADDR=02:42:ac:11:00:02
2023-11-21 14:26:27 GDG6: remote_host_ipv6=n/a
2023-11-21 14:26:27 net_route_v6_best_gw query: dst ::
2023-11-21 14:26:27 sitnl_send: rtnl: generic error (-101): Network is unreachable
2023-11-21 14:26:27 ROUTE6: default_gateway=UNDEF
2023-11-21 14:26:27 ERROR: Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)
2023-11-21 14:26:27 Exiting due to fatal error

It's not letting me create a tun interface in kali at all (docker container). Anyone have any experience with this?

I've tried using ifconfig tun0 create, haven't tried creating an adapter using the docker command outside of the container though.

1

There are 1 best solutions below

0
Zaid Taha On

Try running the container in privileged mode :

docker run -d --privileged myimage

Also, check out this answer for more details:

https://stackoverflow.com/a/30555962/18146099