Skip to content

Bypassing Campus Network Authentication with UDP Port Forwarding

March 11, 2021

FBI Warning ! ! !

This tutorial is for educational and experimental purposes only. Do not use for any commercial or illegal activities.

Principle

When connecting to a network that requires authentication, the device is assigned an internal IP address. If you attempt to visit an HTTP website without authentication, you will be forcibly redirected to the login page. Accessing HTTPS results in a timeout.

However, some UDP ports remain open. If another device/server on the public internet forwards your requests, you can access the internet without authentication.

C:\Users\Infan>tracert baidu.com

Tracing route to baidu.com [220.181.38.148]
over a maximum of 30 hops:

  1     1 ms     1 ms     1 ms  10.17.255.254
  2    10 ms     2 ms     3 ms

At this point we have an IP address but cannot access the internet. The reason is that requests sent through this IP first pass through the campus network server, which checks whether you are logged in. If not, it redirects you to the login page; if logged in, it forwards your request. So if we let another device/server receive and forward our requests, we can bypass authentication.

Preparation

  1. A cloud server

This tutorial uses Tencent Cloud Windows Server 2019. You need to open UDP 53 67 68 69 ports in the security group.

  1. SoftEther VPN Server https://github.com/SoftEtherVPN/SoftEtherVPN_Stable

  2. OpenVPN GUI

Server Side

Use Remote Desktop to connect to the server, download and install SoftEther VPN Server. Select SoftEther VPN Server during installation.

VPN.png

After installation, open the management interface and select Connect.

VPN3.png

Create a localhost administrator password, then check Remote Access VPN Server.

VPN4.png

Once installation completes, close the other tabs. The server side is set up.

Client Side

Install the same software as the server, selecting SoftEther VPN Server Manager.

VPN1.png

After installation, click New Setting.

VPN5.png

Set the name, hostname, and fill in the server password.

VPN6.png

After setting up, click Connect and select Manage Virtual HUB.

VPN7.png

Then select Manage Users → New → set username and password → OK.

VPN8.png

User created. Go back to the HUB interface and click Virtual NAT and Virtual DHCP Server.

VPN9.png

Click Enable SecureNAT and confirm in the popup.

Go back to the management interface and click OpenVPN/MS-SSTP Settings.

VPN10.png

Fill in the corresponding port, then click Generate Configuration File.

VPN11.png

Save the generated configuration file. Then install OpenVPN.

VPN12.png

Copy the files in the red box to the config directory under the OpenVPN installation folder.

Connect OpenVPN directly and enter your username and password.

When the notification tray shows the following message, or the OpenVPN icon turns green, you can browse the internet.

Network speed is determined by the server bandwidth!

Previous
Scraping Bilibili Live Chat with Python
Next
PTGui Pro 12 Installation Guide