12
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

TryHackMeのVPN接続でエラーが発生した場合の対応方法

Last updated at Posted at 2023-06-14

はじめに

本記事では、TryHackMeのVPN接続でエラーが発生した場合の対応方法について記載しています。

普段、TryHackMeを利用する場合は、自前のKali Linuxを使用しています。
先日、Kali Linuxを最新のバージョンにアップグレードしたところ、TryHackMeのVPN接続でエラーが発生し、VPN接続できない事象が発生しました。

エラー内容を基に調査を行なっていたところ、TryHackMeが公開しているVPNに関するトラブルシューティングのツールの存在を知りました。

以下、ツールの利用方法について紹介します。

事象内容

いつものようにVPN接続を試みたところ、以下のエラーが出力されて、VPN接続ができませんでした。

2023-06-11 21:22:26 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-06-11 21:22:26 DEPRECATED OPTION: --cipher set to 'AES-256-CBC' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305). OpenVPN ignores --cipher for cipher negotiations. 
2023-06-11 21:22:26 Note: '--allow-compression' is not set to 'no', disabling data channel offload.
2023-06-11 21:22:26 OpenVPN 2.6.3 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] [DCO]
2023-06-11 21:22:26 library versions: OpenSSL 3.0.9 30 May 2023, LZO 2.10
2023-06-11 21:22:26 DCO version: N/A
2023-06-11 21:22:26 TCP/UDP: Preserving recently used remote address: [AF_INET]54.193.240.194:1194
2023-06-11 21:22:26 Socket Buffers: R=[212992->212992] S=[212992->212992]
2023-06-11 21:22:26 UDPv4 link local: (not bound)
2023-06-11 21:22:26 UDPv4 link remote: [AF_INET]54.193.240.194:1194
2023-06-11 21:22:26 TLS: Initial packet from [AF_INET]54.193.240.194:1194, sid=dbef5693 a0c1e16c
2023-06-11 21:22:27 VERIFY OK: depth=1, CN=ChangeMe
2023-06-11 21:22:27 VERIFY KU OK
2023-06-11 21:22:27 Validating certificate extended key usage
2023-06-11 21:22:27 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
2023-06-11 21:22:27 VERIFY EKU OK
2023-06-11 21:22:27 VERIFY OK: depth=0, CN=server
2023-06-11 21:22:27 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, peer certificate: 2048 bit RSA, signature: RSA-SHA256
2023-06-11 21:22:27 [server] Peer Connection Initiated with [AF_INET]54.193.240.194:1194
2023-06-11 21:22:27 TLS: move_session: dest=TM_ACTIVE src=TM_INITIAL reinit_src=1
2023-06-11 21:22:27 TLS: tls_multi_process: initial untrusted session promoted to trusted
2023-06-11 21:22:28 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
2023-06-11 21:22:28 PUSH: Received control message: 'PUSH_REPLY,route 10.10.0.0 255.255.0.0,route-metric 1000,route-gateway 10.2.0.1,topology subnet,ping 5,ping-restart 120,ifconfig 10.2.0.132 255.255.128.0,peer-id 18'
2023-06-11 21:22:28 OPTIONS IMPORT: --ifconfig/up options modified
2023-06-11 21:22:28 OPTIONS IMPORT: route options modified
2023-06-11 21:22:28 OPTIONS IMPORT: route-related options modified
2023-06-11 21:22:28 OPTIONS ERROR: failed to negotiate cipher with server.  Add the server's cipher ('AES-256-CBC') to --data-ciphers (currently 'AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305') if you want to connect to this server.
2023-06-11 21:22:28 ERROR: Failed to apply push options
2023-06-11 21:22:28 Failed to open tun/tap interface
2023-06-11 21:22:28 SIGUSR1[soft,process-push-msg-failed] received, process restarting
2023-06-11 21:22:28 Restart pause, 1 second(s)

OpenVPNのバージョンは、2.6.3です。

2023-06-11 21:22:26 DEPRECATED OPTION: --cipher set to 'AES-256-CBC' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305). OpenVPN ignores --cipher for cipher negotiations.の出力からOpenVPNの設定に問題があることが推定できます。

対応方法

エラーメッセージを基に調査を行なっていると、openvpn-troubleshootingを発見しました。

このツールは、Linux上のOpenVPN を使用して、TryHackMeネットワークへの接続をトラブルシューティングするためのスクリプトです。

ツールを利用するための手順は以下の通りです。

ツールをダウンロード後、ファイルに実行権限を付与した上で実行します。
<Your .ovpn file>の箇所は、TryHackMeからダウンロードした、任意の.ovpnファイルを指定します。

$ chmod +x thm-troubleshoot
$ ./thm-troubleshoot

	 _____           _   _            _    __  __		
	|_   _| __ _   _| | | | __ _  ___| | _|  \/  | ___
	  | || '__| | | | |_| |/ _` |/ __| |/ / |\/| |/ _ \
	  | || |  | |_| |  _  | (_| | (__|   <| |  | |  __/
	  |_||_|   \__, |_| |_|\__,_|\___|_|\_\_|  |_|\___|
	           |___/

Looks like you're running Kali 						@MuirlandOracle


[-] Script is being run as a low-privileged user
Would you like to run this script with higher privileges automatically (Y/n)? Y
[+] Re-running with root permissions
[-] Config not found in current directory
Please enter the path to your config: <Your .ovpn file>
[+] Config Located successfully
[+] Stable internet connection
[+] OpenVPN is installed
[-] tun0 interface does not exist
Would you like the script to attempt a connection automatically (Y/n)?  Y
[+] Connecting....
[-] Using outdated switch for ciper negotiations. Attempting to update...
[+] Successfully updated cipher switch! Please connect to the vpn using the following command: 
sudo openvpn <Your .ovpn file>

上記、ツールを実行後、TryHackMeのVPN接続を試すと、正常に接続することができました。

また、TryHackMeからダウンロードしている.ovpnファイルを確認すると、暗号化のオプションについてdata-ciphersに変更されていることが確認できました。

client
dev tun
proto udp
sndbuf 0
rcvbuf 0
remote 54.193.240.194 1194
resolv-retry infinite
nobind
explicit-exit-notify 3
persist-key
persist-tun
remote-cert-tls server
auth SHA512
data-ciphers AES-256-CBC
comp-lzo
key-direction 1
verb 3
reneg-sec 0
<ca>

フォーラムでも、同様の事象が確認できました。

おわりに

公式からこのようなツールが公開されていることに感謝します。

余談ですが、私はKali Linuxをベアメタルで構築しています。
Kali Linuxの構築に興味がありましたら、以下の記事をどうぞ。

12
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?