Code Monkey home page Code Monkey logo

tg3442_firewall's Introduction

tg3442_firewall README

tg3442_firewall is a small Python program that enables and disables the firewall on the Arris TG3442 DOCSIS router, by logging in through the web frontend.

tg3442_firewall is released under the terms of the 1-clause BSD license. See tg3442_firewall.py for details.

tg3442_firewall can be found on GitHub here.

Why?

For "security reasons", the Arris TG3442 DOCSIS router automatically re-enables its firewall after 24 hours. The firewall then needs to be manually disabled again and every 24 hours afterwards. This is of course tedious.

Enter this script. Since it can disable the router's firewall without human intervention, it can be used to keep the firewall permanently disabled by, for example, having cron or a similar service call it regularly.

Dependencies

BeautifulSoup binascii hashlib json os PyCryptodome (see "PyCrypto vs PyCryptodome(x)" below) re requests sys

PyCrypto vs PyCryptodome(x)

tg3442_firewall requires the AES CCM crypto mode, which is not available in the last released version of the stock PyCrypto module. Moreover, PyCrypto has been abandoned. The drop-in replacement is PyCryptodome, which contains that required AES mode.

PyCryptodome comes in two flavours: one that installs into the Crypto namespace (thus providing a drop-in replacement) and one that install into the Cryptodome namespace. The latter flavour is commonly referred to as PyCryptodomex.

Depending on your Python distribution and whether you need the orginal PyCrypto module, you may need to install either pycryptodome or pycryptodomex, via pip or an external package manager.

tg3442_firewall's People

Contributors

drmccoy avatar wklaebe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

wklaebe andys8

tg3442_firewall's Issues

Trouble with MODE_CCM

Issue

Traceback (most recent call last):
  File "tg3442_firewall.py", line 184, in <module>
    main()
  File "tg3442_firewall.py", line 151, in main
    login(session, url, username, password)
  File "tg3442_firewall.py", line 66, in login
    cipher = AES.new(key, AES.MODE_CCM, binascii.unhexlify(iv))
AttributeError: module 'Crypto.Cipher.AES' has no attribute 'MODE_CCM'

Solution

Worked for me

pip uninstall pycrypto
pip install pycryptodomex

Maybe add a line in the readme or have a descriptive error message like this one.

r4sas/PBinCLI@19f130f

Script otherwise seems to be working. Thanks.

Looking for new maintainer

TL;DR: Somebody please take over this script, also seeking for input in proper vetting of candidates.

I wrote this little scripts when I got the Arris TG3442 from my ISP after moving to a new flat and upgrading my internet connection to 1 Gbit/s DOCSIS 3.1, from 32 Mbit/s on an older DOCSIS standard available in my previous flat.

The other option for a router was the Fritz!Box 6591, but that wasn't yet available at the time of my move (and, in fact, got delayed a few months even after the projected release). It was finally made available to me earlier this year and I jumped at the chance, because I found the Arris TG3442 pretty miserable. And yes, I'm far happier with the Fritz!Box 6591 now.

This, unfortunately, means I don't have Arris TG3442 anymore, since I had to send it back to my ISP. So I can't develop any new features or even fixes to this script.

I'm happy to answer questions (as far as I can) and merge pull requests, but those will be untested on my end. It would probably be best if somebody else with access to an Arris TG3442 could take over maintenance of this tg3442_firewall script.

Now, I'm a bit wary of just giving this over to anybody sight-unseen, what with the recent cases of new maintainer doing shady stuff. But I'm also unsure what a proper vetting procedure would be. I guess I'm at least looking for somebody with own public code on their GitHub page, somebody I can link to public persona, somebody with established relationships to other trusted individuals. Sure, this script is nothing high-profile, but still, I want to do my due dilligence.

So, if anybody has any ideas, please step up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.