A small Python utility for fetching a GlobalProtect prelogin cookie from
Northeastern University's VPN using a GTK4 + WebKit webview.
Install the script to your local bin directory:
install -m 755 nugp ~/.local/bin/Make sure ~/.local/bin is in your PATH.
nugpThis will open a small login window. Once you complete the SSO flow, the script will print the prelogin cookie to stdout.
You can then pass it to openconnect or other tools:
nugp | sudo openconnect --protocol=gp --usergroup=portal:prelogin-cookie \
-u=YOUR_USERNAME vpn.northeastern.edu- Python 3.x
- GTK 4
- WebKitGTK 6.0
- GObject Introspection bindings for Python (
python-gobject)
The script performs the following steps:
- Makes a prelogin request to Northeastern University's GlobalProtect VPN endpoint
- Extracts the SAML authentication URL from the response
- Opens a GTK4 webview window for SSO authentication
- Captures the authentication callback containing the prelogin cookie
- Outputs the cookie to stdout for use with OpenConnect
The script can also autofill your email and password.
To specify your email you can provide it as follows nugp -u squarepants.s@northeastern.edu
The password can be provided the same way nugp -p supersecretpassword
But to avoid just typing it in you can provide it over stdin from a password manager or something.
Here is an example for what that might look like for Patrick Star if he uses the pass password store
sudo -v && pass show northeastern | nugp -u star.p@northeastern.edu | sudo openconnect --protocol=gp --usergroup=portal:prelogin-cookie --passwd-on-stdin vpn.northeastern.edu -u "star.p" --interface nutunIf you do not provide the flag -p but pipe things into nugp then it assumes the input is a password and autofills it anyway
Otherwise if you do not provide flags then you will have to log in manually
MIT License - see LICENSE for details.