How can you "press" a button of a webpage from the command line to restart a cable modem?

1

1

I'm trying to reboot my cable modem programmatically. I used to be able to do this by using wget:

wget http://192.168.100.1/reset.htm?reset_modem=Restart+Cable+Modem

However I changed my cable modem to an Arris SB6190 and this no longer works.

The new model has a configuration page http://192.168.100.1/cgi-bin/configuration (whose exact source can be seen here https://bpaste.net/show/b19c875569ec) where you can reboot by clicking a button on a form:

<input type="submit" value="Reboot" align="middle"  onClick="resetReq();">

WhiskerBiscuit

Posted 2016-05-04T21:58:14.930

Reputation: 251

1It probably won't be that simple. It worked on your previous modem only because it had a vulnerability that allowed resetting without proper authorization. – gronostaj – 2016-05-04T22:03:19.157

I'm thinking PO would have omitted credentials from the wget. The difference is one router has a URL for reboot (like many D-Link), and the other uses a scripted function(). There is no simple solution. The mob mind seems to recommend Selenium with a dummy browser. – mckenzm – 2018-04-19T22:22:16.080

Answers

1

My suggestion is to do the following:

  1. Go to the page where the reset button is.
  2. Open your browser dev tools (I'd recommend Chrome for this)
  3. Go to the network tab. Make sure it's recording (dot towards the top left corner of the dev tools UI. Check the box for "persist log". Clear the log if you have a bunch of stuff there.
  4. Click the button. You'll see the network request logged to the console. Right click on that and Chrome gives you an option to copy the request as a CURL command (or perhaps it has wget... might be platform dependant).

You now need to analyze that command (you can also just click on the request in the console to look at the request headers). Does it use any authentication (eg. passing a value on the cookie or use HTTP authentication)? If so, my guess is that authentication has an expiration built into it. If it uses a cookie or token (rather that username/password), you'll need to capture the request to login to the administrative interface and see where in the response headers (or perhaps response data) of that request your authentication token is sent to your browser. You may have to update your script to first authenticate and snag that token and then make the second request to reboot using that token/authentication.

The details depend on the exact implementation of the authentication process for your router, but this general approach should work for most things.

timehat

Posted 2016-05-04T21:58:14.930

Reputation: 71