Back in the old days when I joined college, we had free WiFi in the hostel and college campus. In hostels, the entire floor used to have a single WiFi router. So usually the quest for internet savvy people(like me), was to get a room closer to the WiFi router for better internet speed. The router(if working fine), used to give a download speed of approx 4-5 MBps. Hostel students enjoyed two years with superb internet speeds but later the authorities revoked the internet speed for student accounts when they noticed that the internet in hostels was not at all being for educational purposes 😛
The authorities took such a harsh step that the internet speeds for student accounts were dropped from 4-5 MBps to a max of 128 Kbps. The internet revolution in hostels came to a halt. Students started preferring mobile internet over using hostel WiFi.
It was one fine evening that I got to know that the internet accounts issued to teachers and professors had no speed limit. They had full access to the internet with speeds ranging up to 5MBps. In my mind, I started figuring out ways to get one of the teacher accounts to enjoy full internet speed. At first, I thought of asking one of my known professors. But that would have been a poor step… So I dropped that idea and hence, began my research on how to break the validation logic used in our WiFi internet portal.
My college used to work with Cyberoam firewall which validated the user role(student or teacher) and allowed the internet access accordingly. I started research on Cyberoam and ways to bypass it. At first, I discovered a VPN service – Psiphon, which gave us back the ultimate internet experience. It spread like a wild-fire. Even our hostel security guards were using it to connect it to the WiFi 😛 After a couple of months, that was banned too. Psiphon no longer gave good speeds. Now the only option left was a teacher account.
At this time I had extremely low knowledge of code and python was only a snake in my mind. While googling around for any possible solutions, I came across one blog, which had some code written to bypass Cyberoam. I was able to easily understand the logic implemented in that code, as it was simple English. Python is best known for its simplicity of code. Even having very little knowledge of coding and programming, I was able to understand what the code was intended to do. So, I took that piece of code and installed Python in my system as stated in that blog post. I was able to figure out how to execute that code. So, I made modifications to that code and understood that it was a simple brute-force script which uses a simple “for” loop to generate a four-digit passcode and submit it using Python requests on the Cyberoam URL.
Obviously, I know these terminologies as of today. However, at that time, I just saw that the code was doing something! Basically, our Cyberoam credentials were a username and a four-digit numeric password. Thinking deeply, the only problem that remained was to find out a teacher account username because it would ultimately have a password between 0000 and 9999, which could be found using the brute-force script I had created. Usernames were generated in a pattern. So I observed the pattern in teacher user accounts and realized that it is user’s “firstname_department”. For example, a teacher ABC from the ECE department was having a username abc_ece. To get usernames, I navigated to the website of my college’s department of ECE and generated a few usernames ass per the observed pattern. As I ran the script, I was surprised to see that it gave me the first password in 5 seconds.
It took 5 seconds for that piece of code to resolve the most irritating problem ever. And most importantly, my fear of coding was gone when I saw the code written so neatly in plain English. So finally, I got the teacher id/pass for full speed, which I kept to myself and did not share it with anyone since it was a violation. But thanks to that piece of code, which gave me enough confidence to start my career in Python.
So in-case you’re a newbie to code, try Python. It might change your perspective towards coding!