Skip to content

A simpler and better way to log in the NITP LAN, with randomly chosen credentials to distribute unused data to those in need

License

Notifications You must be signed in to change notification settings

adi-g15/LetsShareLAN

Repository files navigation

Let's Share LAN

LetsShareLAN

Build Status

Command to automate logging in to captive portal. Version - 3.

Currently supports 3 modes:

  1. SQL: Get credentials from a sql table (can be using UNIX socket, or using URL)
  2. File: Read credentials from a passwords file at $HOME/lsl.pwd
  3. Manual: Ask user for login credentials

TIP:

I use this mostly by setting it to start automatically after boot.

Steps with systemd (linux):

  1. First install this using cargo install --root /usr --path . --no-track. Or use the PKGBUILD file, if on Arch Linux.
  2. Copy lets-share-lan.service to ~/.local/share/systemd/user/lets-share-lan.service. EDIT the service file with correct environment variables, and in After="", put either mysql.service or mariadb.service
  3. systemctl --user enable --now lets-share-lan

Done... FORGET ABOUT LOGGING IN AGAIN MANUALLY :)

PreRequisite

Install rust from here.

Then just clone this repo with git, and see usage section

cargo build

Usage

  1. Logging in:

By default it will fetch passwords from a MySQL database.

So first see the .env_sample file, and create corresponding .env file.

Ensure that your SQL server is running (mariadb, mysql, default port 3306). Create a database, and enter the name of database in the DB_NAME environment variable (or in .env), eg. DB_NAME=wifi.

Then create a passwords table like this:

create database wifi;
use wifi;

create table passwords (username varchar(10), pwd varchar(50));

% Now insert known credentials in this table, LetsShareLAN will then randomly chose among these each time
insert into
cargo run

1.2. Login by manually entering username,password

cargo run -- --manual

1.3. Login by using a passwords file in home directory (ie. $HOME/lsl.pwd)

cargo run -- --usefile

The file at $HOME/lsl.pwd should have content like this:

username = password
complex-username = complex-password@123
  1. Logout:
cargo run -- logout

Idea

There is a data limit I always exhausted, while many of my friends didn't, so I can use their IDs, this is my way to automate that :)

Note to self: Bhai kuchh aur bhi ideas the, jaise ye sb VPN/TOR ke through secure ho... pta nhi 1st yr me itna kyu aur kaise sochha, shabaas ! 😂

          To see old code, see initial 2 commits. Back then, used selenium, and MANY good inferences

About

A simpler and better way to log in the NITP LAN, with randomly chosen credentials to distribute unused data to those in need

Topics

Resources

License

Stars

Watchers

Forks