UPI: 8144255926@upi
{currently supported only for linux, windows support soon...} {undergoing testing} ---#V-2.0
This project provides a simple Linux watchdog script (toggle-portal.sh) and an installer (install.sh) to keep you logged in to the Cyberoam captive portal automatically.
Instead of manually logging in/out through the portal webpage, the script periodically pings Google (or another target). If connectivity is lost, it automatically posts your credentials to th’e captive portals login.xml endpoint using curl.
h2>
- Unzip the folder you downloaded(from the releases tab):
unzip portal-tools.zip -d ~/portal-tools cd ~/portal-toolspre>
- Run the installer:
chmod +x install.sh ./install.shpre>
During installation you will be prompted for:
- Cyberoam username
- Cyberoam password
- Install directory (default:
~/.local/bin)
Credentials are stored safely in:
~/.config/toggle-portal/credentials (mode 600).
- The installer will:
- Copy
toggle-portal.shinto the install directory - Create a wrapper (
toggle-portal-run.sh) that loads your credentials - Add an
@rebootcrontab entry to auto-start on boot - Log into
~/toggle-portal.log - Create a helper
tail-toggle-portal-log.shto view logs
h2>
Run manually
nohup toggle-portal-run.sh > ~/toggle-portal.log 2>&1 &pre>
View logs
~/tail-toggle-portal-log.shpre>
Auto-start
The installer adds a crontab entry so the script launches automatically at boot.
Check with:
crontab -lpre>
You should see something like:
@reboot nohup /home/user/.local/bin/toggle-portal-run.sh > /home/user/toggle-portal.log 2>&1 &pre>
h2>
- Pings
8.8.8.8once per second - If ping fails → assumes captive portal dropped your session
- Builds a POST like:
mode=191&username=<user>&password=<pass>&a=<timestamp>&producttype=0pre>
… and sends it to:
https://cyberoam.iiitnr.edu.in:8090/login.xml
4. Loops forever, logging you in whenever needed
h2>
Script didn’t log me in
- Check logs:
tail -f ~/toggle-portal.logpre>
- Look for success strings (
success,logged in,<message>OK)
Wrong credentials
- Edit your saved credentials:
nano ~/.config/toggle-portal/credentialspre>
- Restart the script:
pkill -f toggle-portal.sh nohup toggle-portal-run.sh > ~/toggle-portal.log 2>&1 &pre>
No Internet even after login
- Portal host may differ→ check browser DevTools when logging in manually
- Update
PORTAL_HOSTintoggle-portal.sh
Change ping target
- Edit
toggle-portal.sh, replace8.8.8.8with another IP or domain
h2>
- Credentials stored in
~/.config/toggle-portal/credentials(plain text, mode 600) - Works on Linux (tested on Ubuntu/Debian)
- Needs
bashandcurl - Customize retry intervals and targets by editing
toggle-portal.sh
h2>
V2.0 – Added installer, watchdog re-login logic, auto-start, log helper, structured README
h2>
- Reverse-engineered from captive portal JavaScript (
submitRequest()) - Packaged for IIIT-NR Cyberoam
Make sure you download this entire directory:
just gitclone this stuff (usme toh sab hi expert hain):
git clone https://github.com/sundeep-kp/Auto-login-framework.git
cyberoam-autologin/
├── install.sh # installer script (sets up everything)
├── uninstall.sh # removes files, disables timer/service)
├── cyberoam-login.js # main Node.js autologin script
├── cyberoam-login.service # systemd service unit
├── cyberoam-login.timer # systemd timer unit
The last three files will be automatically copied/moved to their required locations.
You don’t have to touch a damn thing (trust me :D).
Right click and run install.sh as a program or from your terminal.
### Note:-
*Bhai, aur kuchh suggestions hai to bata dena merko, bas 150 rupiya lega mai.* *You may provide me with suggestions for the project.*
---
Optional settings-
#if you don't want any pop ups , change this setting to true (search using ctrl+f inside the cyberoam-login.js file) :- headless: false
### If stuff doesn't work, try these out:
#Make `install.sh` executable:
Paste this in the terminal:-
chmod +x install.sh - Make sure your **`cyberoam-login.js`** is okay using the **system-installed Chrome/Chromium** *(usually `/usr/bin/chromium-browser` or `/usr/bin/google-chrome`)*.
#Edit the part that says:
js
const BROWSER_PATHS = [
'/usr/bin/chromium-browser',
'/usr/bin/chromium', '/usr/bin/google-chrome-stable',
'/usr/bin/google-chrome',
'/snap/bin/chromium'
];
If Puppeteer can’t find it, then you specify the path in executablePath when launching:
const browser = await puppeteer.launch({
headless: false
executablePath: '/usr/bin/chromium-browser' // adjust as needed
});
You may add your current browser (Brave, Vivaldi, Edge, etc.)
(they should work given the Chromium framework, but I dunno — I ChatGPT-ed the entire code, who am I to judge 😅)
