OpenVPN configuration files downloaded from the portal supports TCP/UDP at the same time. TCP is selected by default to avoid issues, but in some cases it could be better to switch the connection to UDP to perform aggressive scans or tasks. This can be done editing the OpenVPN configuration file and removing or commenting the following line.
<snip>
client
# remote <IP> <PORT> tcp <- Comment this line
remote <IP> <PORT> udp
<snip>
VPN connections can drop for several reasons. When this happens, we will be prompted for credentials for reconnecting. If we want to connect back automatically without providing credentials, we can use the --auth-user-pass feature from OpenVPN.
- Create a text file with just two lines containing username and password.
- Connect via
sudo openvpn --config <OVPN_FILE> --auth-user-pass <CREDS_FILE>
DNS Servers must be configured in some labs, this can be done in Linux by adding the following line as the first entry in /etc/resolv.conf.
nameserver <LAB_DNS_IP>
This configuration file can be reverted back to its original state if we experience a connection drop. To avoid changing the file while we are working on the lab, we can set an immutable flag to the file via:
sudo chattr +i /etc/resolv.conf # Add flag
sudo chattr -i /etc/resolv.conf # Remove flag
In some cases it will be necessary to flush the DNS Cache from the browser via:
- Firefox: Type “about:networking#dns” → Clear DNS Cache
- Chrome: Type “chrome://net-internals/#dns” → Clear host cache.
Although it’s not the fastest method, remember that files/folders can be shared via RDP too, double check your client’s documentation (Microsoft Remote Desktop Client or xfreerdp recommended for the labs)