• Changing modem settings from the command line

    From Spiros Bousbouras@21:1/5 to All on Sun Jul 18 16:43:47 2021
    XPost: uk.comp.os.linux

    I have a modem which requires a Javascript browser to change modem settings. This has been an irritation for a while. I have finally managed to write a little utility which allows me to turn on and off the 2.4 GHz wireless signal from the command line and I'm making it available to the world with the hope that others may also find it useful. Also another utility which captures all the exchanges between a browser and a modem and stores them in a file ; this latter utility allowed me to figure out how to write the former. Both are written in C99 and tested on Linux. License is public domain. You can get
    them at http://vlaho.ninja/prog/#modem-settings . The online README file
    (also part of the download) has instructions and a lot more details.

    --
    There are always people who think that horror movies are just kind of one half-step away from porno to begin with.
    Stuart Gordon

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Unruh@21:1/5 to Spiros Bousbouras on Sun Jul 18 17:19:56 2021
    XPost: uk.comp.os.linux

    On 2021-07-18, Spiros Bousbouras <spibou@gmail.com> wrote:
    I have a modem which requires a Javascript browser to change modem settings.

    A modem? What modem? Modems differ. Commands to modems differ.

    This has been an irritation for a while. I have finally managed to write a little utility which allows me to turn on and off the 2.4 GHz wireless signal

    Modem? Wireless signal?

    from the command line and I'm making it available to the world with the hope that others may also find it useful. Also another utility which captures all the exchanges between a browser and a modem and stores them in a file ; this latter utility allowed me to figure out how to write the former. Both are written in C99 and tested on Linux. License is public domain. You can get them at http://vlaho.ninja/prog/#modem-settings . The online README file (also part of the download) has instructions and a lot more details.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Spiros Bousbouras@21:1/5 to William Unruh on Sun Jul 18 17:30:55 2021
    XPost: uk.comp.os.linux

    On Sun, 18 Jul 2021 17:19:56 -0000 (UTC)
    William Unruh <unruh@invalid.ca> wrote:
    On 2021-07-18, Spiros Bousbouras <spibou@gmail.com> wrote:
    I have a modem which requires a Javascript browser to change modem settings.

    A modem? What modem?

    Netgear , Super Hub 2ac VMDG490 .

    Modems differ. Commands to modems differ.

    Indeed. If you read the README file , your questions may be answered.

    This has been an irritation for a while. I have finally managed to write a little utility which allows me to turn on and off the 2.4 GHz wireless signal

    Modem? Wireless signal?

    I don't understand the questions.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Spiros Bousbouras@21:1/5 to William Unruh on Sun Jul 18 19:05:05 2021
    XPost: uk.comp.os.linux

    On Sun, 18 Jul 2021 18:30:37 -0000 (UTC)
    William Unruh <unruh@invalid.ca> wrote:
    On 2021-07-18, Spiros Bousbouras <spibou@gmail.com> wrote:
    Indeed. If you read the README file , your questions may be answered.

    And I should click on click-bait?

    My idea of clickbait is something which is intentionally provocative so
    that people will get the irresistible compulsion to go to the link. I
    don't believe this applies to what I posted. In any case , would you
    consider it preferable if I posted the whole README here ? IMO it would
    be poor form to post something kind of long. So my opening post gave
    the general idea and if someone is interested , they can read the README
    to get the details.

    --
    Is anyone besides me ready for a good pandemic!?
    www.imdb.com/review/rw2735248

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Unruh@21:1/5 to Spiros Bousbouras on Sun Jul 18 18:30:37 2021
    XPost: uk.comp.os.linux

    On 2021-07-18, Spiros Bousbouras <spibou@gmail.com> wrote:
    On Sun, 18 Jul 2021 17:19:56 -0000 (UTC)
    William Unruh <unruh@invalid.ca> wrote:
    On 2021-07-18, Spiros Bousbouras <spibou@gmail.com> wrote:
    I have a modem which requires a Javascript browser to change modem settings.

    A modem? What modem?

    Netgear , Super Hub 2ac VMDG490 .

    Modems differ. Commands to modems differ.

    Indeed. If you read the README file , your questions may be answered.

    And I should click on click-bait?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Unruh@21:1/5 to Spiros Bousbouras on Sun Jul 18 20:17:48 2021
    XPost: uk.comp.os.linux

    On 2021-07-18, Spiros Bousbouras <spibou@gmail.com> wrote:
    On Sun, 18 Jul 2021 18:30:37 -0000 (UTC)
    William Unruh <unruh@invalid.ca> wrote:
    On 2021-07-18, Spiros Bousbouras <spibou@gmail.com> wrote:
    Indeed. If you read the README file , your questions may be answered.

    And I should click on click-bait?

    My idea of clickbait is something which is intentionally provocative so
    that people will get the irresistible compulsion to go to the link. I
    don't believe this applies to what I posted. In any case , would you
    consider it preferable if I posted the whole README here ? IMO it would
    be poor form to post something kind of long. So my opening post gave
    the general idea and if someone is interested , they can read the README
    to get the details.

    Unfortunately you went to the other extreme-- made it so short and
    unspecific that the reader had no idea what it was that you were talking
    about. Wireless is a hub or router, not a modem, as your subsequent
    response indicated. Modems (modulator-demodulator) are now 50 years old.
    So while I admire your restraint at not posting all of the details, I
    was complaining that you posted so so few that I certainly could not
    figure out what you could be talking about. And it was so generic (while
    what you refering to was very specific to your particular
    hub/router/modem).
    There are many aspects of clickbait, and one is to post something so
    vague to a help group, that someone, wanting to help, or possibly use,
    will click on your site. There are many kinds of bait.
    Some might respond to a naked Woman's picture, others, on net help groups
    might repond to a tool to help them connect to internet.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Spiros Bousbouras@21:1/5 to William Unruh on Sun Jul 18 21:49:12 2021
    XPost: uk.comp.os.linux

    On Sun, 18 Jul 2021 20:17:48 -0000 (UTC)
    William Unruh <unruh@invalid.ca> wrote:
    On 2021-07-18, Spiros Bousbouras <spibou@gmail.com> wrote:
    My idea of clickbait is something which is intentionally provocative so that people will get the irresistible compulsion to go to the link. I
    don't believe this applies to what I posted. In any case , would you consider it preferable if I posted the whole README here ? IMO it would
    be poor form to post something kind of long. So my opening post gave
    the general idea and if someone is interested , they can read the README
    to get the details.

    Unfortunately you went to the other extreme-- made it so short and
    unspecific that the reader had no idea what it was that you were talking about. Wireless is a hub or router, not a modem, as your subsequent
    response indicated. Modems (modulator-demodulator) are now 50 years old.

    Ok , I admit I hadn't given much thought to the distinctions between a router and a modem. I was thinking of a modem as something which connects the
    computer to the internet and in that sense a router qualifies. Now I know better.

    So while I admire your restraint at not posting all of the details, I
    was complaining that you posted so so few that I certainly could not
    figure out what you could be talking about. And it was so generic (while
    what you refering to was very specific to your particular
    hub/router/modem).

    My opening post mentioned 2 utilities. One is specific to my router. The
    other will store in a file the HTTP requests and responses between any router and the browser and hopefully by studying those the user will learn how to reproduce programmatically the requests which modify the settings as they want them. Even the utility specific to my router is not that specialised because the router was provided by Virginmedia which is one of the most popular U.K. ISPs and I posted to uk* groups.

    There are many aspects of clickbait, and one is to post something so
    vague to a help group, that someone, wanting to help, or possibly use,
    will click on your site.

    It was clear that I wasn't asking for help. And if someone wants to use my
    code , they would have to go to my website anyway. On the other hand , someone who has no use for my code , would not find the README interesting either.
    But anyway , hopefully I've cleared things now.

    There are many kinds of bait.

    --
    - Do you read Sutter Cane ?
    - Wh... what ?
    - Do they speak English in "what" ?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Spiros Bousbouras@21:1/5 to Spiros Bousbouras on Sun Jul 18 22:10:13 2021
    XPost: uk.comp.os.linux

    On Sun, 18 Jul 2021 16:43:47 -0000 (UTC)
    Spiros Bousbouras <spibou@gmail.com> wrote:
    You can get
    them at http://vlaho.ninja/prog/#modem-settings . The online README file (also part of the download) has instructions and a lot more details.

    Based on the comments I have changed the link to vlaho.ninja/prog/#router-settings .

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Gregorie@21:1/5 to Spiros Bousbouras on Sun Jul 18 22:36:47 2021
    XPost: uk.comp.os.linux

    On Sun, 18 Jul 2021 21:49:12 +0000, Spiros Bousbouras wrote:

    My opening post mentioned 2 utilities. One is specific to my router.

    Understood.

    The other will store in a file the HTTP requests and responses between
    any router and the browser and hopefully by studying those the user will learn how to reproduce programmatically the requests which modify the settings as they want them. Even the utility specific to my router is
    not that specialised because the router was provided by Virginmedia
    which is one of the most popular U.K. ISPs and I posted to uk* groups.

    What does this offer that Wireshark doesn't do? Apart, that is, from only looking at HTTP and HTTPS traffic?

    Wireshark is my current go-to tool whenever I need to understand network,
    i.e. TCP/IP, traffic in any detail.


    --
    Martin | martin at
    Gregorie | gregorie dot org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Spiros Bousbouras@21:1/5 to Martin Gregorie on Mon Jul 19 09:17:10 2021
    XPost: uk.comp.os.linux

    On Sun, 18 Jul 2021 22:36:47 -0000
    Martin Gregorie <martin@mydomain.invalid> wrote:
    On Sun, 18 Jul 2021 21:49:12 +0000, Spiros Bousbouras wrote:
    The other will store in a file the HTTP requests and responses between
    any router and the browser and hopefully by studying those the user will learn how to reproduce programmatically the requests which modify the settings as they want them. Even the utility specific to my router is
    not that specialised because the router was provided by Virginmedia
    which is one of the most popular U.K. ISPs and I posted to uk* groups.

    What does this offer that Wireshark doesn't do? Apart, that is, from only looking at HTTP and HTTPS traffic?

    Possibly nothing. I don't remember if I had heard of wireshark before your post. Before I wrote my code I was guessing that probably tools existed which would provide the functionality I wanted but that they would be general
    purpose and complicated. So , since I had never used such a tool , I figured
    it would be simpler to build something small myself and add further functionality as needed rather than start with something preexisting but big and try to figure out how to make it do what I wanted.

    In any case , how complicated would it be to do with wireshark the
    following :

    * Make it listen for connections on port 8080.

    * Drop non local connections so that only the browser running on the same
    computer can connect.

    * Forward everything it gets to the router , then forward any replies from
    the router back to the browser and continue like this back and forth until
    terminated. With each side it must reproduce exactly what happened with the
    other. So for example , if a router sends a response and then terminates the
    connection then wireshark must forward the response to the browser and also
    terminate the connection ; but if the router sent a response and did not
    terminate the connection then wireshark must forward the response to the
    browser and not close the connection. It must also store all the exchanges
    in a file.

    There were a couple of other things I thought that I might have needed to do but in the end weren't necessary. Using my utility as an intermediary between the browser and the router , the browser was adding the following 2 lines in the header :

    Host: localhost:8080
    Referer: http://localhost:8080/

    I was concerned that the router may modify its behaviour based on the
    existence of those lines. If this had happened , my utility would have needed to eliminate the Referer: line , change the Host: line so that it had
    the address of the router and otherwise preserve the header and body as it received them from the browser. Can wireshark do this ?

    Wireshark is my current go-to tool whenever I need to understand network, i.e. TCP/IP, traffic in any detail.

    --
    Am I *no one* ? Are you *no one* ? Because that's all we can ever have of each other: an imitation, a Copy. All we can ever know about are the portraits of each other inside our own skulls.
    "A kidnapping" by Greg Egan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Gregorie@21:1/5 to Spiros Bousbouras on Mon Jul 19 12:27:52 2021
    XPost: uk.comp.os.linux

    On Mon, 19 Jul 2021 09:17:10 +0000, Spiros Bousbouras wrote:

    In any case , how complicated would it be to do with wireshark the following :

    Wireshark is simple enough to use. Basically you just point it at an
    ethernet port and it logs what goes in and out, showing packet header
    details and content as both text and hex. That's about all you need if
    you're handling TCP/IP message streams using ASCII or Unicode character encoding.

    It automatically recognises a wide variety of packet types and uses this
    info to make its logs more readable. It has filters to omit irrelevant
    packets and also filter logged content as its displayed. It can display
    EBCDIC, Ascii and Unicode text, i.e. if you're having to deal with X.25
    or SNA data streams there's a good chance it can make these readable too.

    https://www.wireshark.org

    or just install it and see what it does. I think you'll find its a
    standard package for most Linux distros, including Raspbian.


    --
    Martin | martin at
    Gregorie | gregorie dot org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)