0
I am trying to enter into my router's settings from the command line in my Ubuntu machine. It's not one of those expensive router models that has a specialised console port, but rather a "normal" for families and such, an ASUS. I don't think the model is relevant. What I want to do is basically the equivalent of opening your browser and typing the default gateway address, and input the username and password. Is there a way to emulate such a process with.. say python or curl?
What have I tried
- I tried going in chrome in the developer tools and in the network tab to see what request does my browser make and what kind of response do I get from my router, and it doesn't really make sense. I have never seen something like it and it only confused me more.
- I tried sending get and post requests with my username and password with curl, the requests library from python and with XMLHttpRequest in JavaScript. No luck, only got back a message with 401, unauthorized or something about a malformed request.
What am I trying to achieve
In short, I hoped I could somehow automate the process and make certain automatisations. I would run a script on my Ubuntu machine, and it would send the username and password, get back the contents of whatever the router sends back (which I guess is html and CSS and JavaScript for managing the interface) and do something with it. What would be even better is to actually get to the command line of the router and change the settings from there (I know that probably this is hard to achieve, but a man can try).
You should look at the Selenium IDE add-on. I have used it with Firefox on Ubuntu, but it may well be available on other browsers and platforms. The other way that I've used to automate router functions is to use
telnet
with a script. Both methods have worked for me on my TP-Link router. – AFH – 2018-09-16T22:22:23.4001
Put openwrt or ddwrt on it, then you can easily access your router via ssh. It would be a much better solution.
– Ipor Sircer – 2018-09-16T22:36:44.440@Ipor Sircer changing the router's OS is not an option – Flu – 2018-09-16T23:13:17.097