Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: 1 [2]

Author Topic: Controlling modems remotely  (Read 7898 times)

burakkucat

  • Respected
  • Senior Kitizen
  • *
  • Posts: 38300
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: Controlling modems remotely
« Reply #15 on: May 07, 2018, 06:16:25 PM »

God what a fool I am. :-[

I wouldn't say that. I think we have all been in a similar situation, in finding that details of what we have required has been posted in the past. It's just a case of finding the relevant link.
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Controlling modems remotely
« Reply #16 on: May 07, 2018, 10:04:44 PM »

The problem with the wretched drugs is that whole things get erased completely. I didn't even know there was anything worth doing a search for amongst the old kitz posts that are relevant.

Don't do drugs kids, opiates are bad. Never thought I would ever get to learn such a thing during my life, never even having tried cannabis. :-) God what a state to get into. I do beg the kitizen community’s forbearance anyway.
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Controlling modems remotely
« Reply #17 on: May 09, 2018, 07:33:24 AM »

The monitoring program on iPad (written in Workflow) is proceeding slowly. Have done relevant maths on all the stats that are exposed in the web ui.

I don't have access to telnet protocol though annoyingly, not using the Workflow language. I would have to learn some Python perhaps, because there is a Python system for iPad and in fact Workflow can talk to Python. I would hope that someone has written the relevant code in Python as a library already.

It's a shame that that Worfklow does not just handle urls with telnet: scheme in them. I know they would have to write the code to handle a new protocol and the code to parse the results and post process them would ne different.

For normal web stuff Workflow can fetch and display a web page in a mini browser, or get rich text and show you that, or it can strip everything out and give you the gist of a page as plain text only but then the resulting text it is not ascii-formatted prettily like Lynx, mind you that is not necessarily what you want, not at all, so that would need to be an option, because no pretty formatting can make it easier for machines to understand and parse. Also there is no option to fetch the html text from a webpage nor to give you the raw http response as a whole, which is amazingly bad.

I have already obtained some useful results, I noticed that another one of my lines had developed a really high HEC error rate, 0.6% per cell downstream. Far far higher error rate than the other two lines, which were about ten times and a hundred times better respectively.

I have written some alarm code that rings a bell if certain values are outside various thresholds. I really need to think about having another version though that takes multiple timesnaps and differences error counts for example as that would be much more usable and relevant.

I'm thinking about linking the performance alarm code to a routine that will force a resynch of a line that is misbehaving.
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Controlling modems remotely
« Reply #18 on: May 09, 2018, 09:15:35 AM »

Hooray, thanks to the http sniffer ‘Charles Proxy’ tool recommended to me earlier ?I have worked out what is going on a bit more.

I can now force a modem to resynch remotely !
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Controlling modems remotely
« Reply #19 on: May 09, 2018, 10:23:22 AM »

Btw, anyone who has one of these modems could help me here

When you log in, the html for the login form page has a hard coded fixed text string value which is passed to the server as part of the login request along with a hash of the username and a hash of the password, let us call this text string ‘the fixed secret’.

My modem specifies the value
Code: [Select]
        Ha2S+eOKqmzA6nrlmTeh7w== for the fixed secret.

Is your modem exactly the same?

G.Dmt’s modem is the same as mine. He was a good boy though and in his code he got the fixed secret by extracting it from the html text sent by the modem. I was lazy and just hard-coded it. I have no idea why they are doing this. It’s hardly a security feature.

Can anyone spot anything meaningful in it? If you decode it by algorithm x does it then become something significant?
Logged

DaveC

  • Reg Member
  • ***
  • Posts: 197
Re: Controlling modems remotely
« Reply #20 on: May 09, 2018, 10:54:25 AM »

Can't help much, but that string looks to be base-64 encoded.  But decoding it doesn't really give anything meaningful - it's the following 16 byte (128-bit) binary sequence:

Code: [Select]
1d ad 92 f9 e3 8a aa 6c c0 ea 7a e5 99 37 a1 ef

It's perhaps some kind of CSRF protection (in which case this is what is known as the "CSRF token").   However, this should be random, and not fixed.  Here is some info on CSRF if you're not familiar:

https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Controlling modems remotely
« Reply #21 on: May 09, 2018, 12:00:21 PM »

Agreed. I don't see how that would protect anything. Anyone can get hold of the fixed secret, G.DMT did. As you say they would have to vary it and make it valid only for particular requesters at least.

It's interesting that if you just google that string value you get a load of hits. I'm wondering if this html or javascript code was doing the rounds and was a copy-paste job by someone or other because one google hit result mentions “TP-Link” in some code.

(A grrr too. I don't like sites that refuse to work with javascript turned off. When I did a small amount of web stuff I always ensured that I did the right thing.)
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Controlling modems remotely
« Reply #22 on: May 13, 2018, 07:08:10 AM »

I've now got routines finished that show status info and give status reports with derived stats and display configurable performance related alarms if certain number go out of permitted ranges. What I haven't yet written is something to run continuously, nor something to time-difference the numbers and report and alarm on changes or deltas.

I have also written something to force a resynch remotely. I had written a second improved, much faster and more responsive version of that, but I accidentally deleted it, clicked on the wrong file, so I need to write that code again now. Grrr. It turns out that logging in and authenticating is annoyingly slow so it's best to avoid doing that unless you really have to. And having three modems is all the worse as I don't have access to an asynchronous routine to initiate that so I can kickstart three operations in parallel. So I had made a mod to first attempt to command it to resynch in hope and if it works fine, if not login and then do it again. That was very successful and that was the code I lost. I also wrote some ui code to allow you to pick n modems out of the three and choose which ones you wanted to reset, I lost that too, so yet another thing to reinvent. I wish the Workflow app on the iPad had a bin so you could recover / undelete routines.
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Controlling modems remotely
« Reply #23 on: May 13, 2018, 07:11:36 AM »

If anyone would find these useful, then do let me know. Need an iPhone or iPad and a DLink DSL-320B-Z1 modems, plus need to download a copy of the WorkFlow app (author is now owned by Apple) from the Apple App Store.
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Controlling modems remotely
« Reply #24 on: November 30, 2022, 11:36:24 AM »

I keep making improvements all the time. I have an analysis and health/wellness program that gives me an extremely concise report on my four modems ranging from all good vs not good with details and the implications of any errors found to a full report of all the basics. The first one also detects certain diseases that don’t show up in the basic stats. In fact I’m fixing some algorithmic bugs today.

The previous post was a long time ago, and "Workflow", is now called "Shortcuts". It was bought by Apple and is preinstalled.
« Last Edit: November 30, 2022, 11:39:24 AM by Weaver »
Logged
Pages: 1 [2]
 

anything