From e7296e6fae8e043b97a709f7e50d14c03ab9e229 Mon Sep 17 00:00:00 2001 From: Ryan Snyder Date: Mon, 12 Feb 2024 20:39:06 -0500 Subject: [PATCH] install: remove feature to change to overrideslot to avoid bricking Fixes #6 --- README.md | 14 +++++++------- fs_xgspon_mod.py | 31 ++++++++++++++++--------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 1e6d2b7..505f50c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ -# FS.com XGS-ONU-25-20NI AT&T Modification Utility -This utility makes the necessary changes to the FS.com XGS-PON ONU to allow it to operate on AT&T (USA), Orange (FR), and other XGS-PON fiber offerings. It attempts to do so as safely as possible, reverting automatically to a stock state if it is ever power cycled twice in quick succession. - -This particular FS.com device is actually a CIG XG-99S which is available under a variety of different brands. There is an entire family of devices running very similar firmwares that can likely also be modified in roughly the same way, though modifications to this utility would be required to support them. Of particular interest are the CIG XG-99M devices (best known as the FOX-222) which can be found for $30-$50 online as of writing and which I plan to look at in the near future. +# FS.com XGS-ONU-25-20NI / CIG XG-99S Modification Utility +This utility makes the necessary changes to CIG XG-99S devices to allow them to operate on AT&T (USA), Orange (FR), KPN (NL), Telus (CA), Frontier (USA) and other XGS-PON fiber offerings. It attempts to do so as safely as possible, reverting automatically to a stock state if it is ever power cycled twice in quick succession. While this modification attempts to be as safe _as possible_ it's much less safe than running an unmodified device. Although the device has two firmware slots they share the userdata partition that gets mounted to `/mnt/rwdir/`. During boot all CIG firmwares check for `/mnt/rwdir/setup.sh` and run it if it exists. This is done before the PON stack starts, so if anything goes wrong *it will never come online* and you will need UART access and micro-soldering skills to recover the device. For this reason, the modification disarms itself as the first action it takes during every boot -- that is the _only_ safety mechanism available. @@ -45,6 +43,8 @@ By convention the documentation below uses `GPON227000fe` to refer to the serial Ensure that you're sitting adjacent to the stick on the network and that you have an address in the `192.168.100.0/24` subnet. The stick is at `192.168.100.1`. Ensure that your machine is configured to accept conncections on port `8172` (you may need to add a firewall allow rule for this!). Activating the mod for a single boot only requires one command: +NOTE: Certain ISPs can skip full installation and use only the [`overrideslot`](#override-eth-uni-slot) command. + ``` # ATT ./fs_xgspon_mod.py install GPON227000fe att HUMA12ab34cd @@ -55,9 +55,7 @@ Ensure that you're sitting adjacent to the stick on the network and that you hav # Telus ./fs_xgspon_mod.py install GPON227000fe telus ARCB12ab34cd -# KPN, just changing the ethernet uni slot from 10 to 1 and keeping the rest as-is -# you can register the serial number of the module through the self-service tool of your provider -./fs_xgspon_mod.py install GPON227000fe kpn +# KPN should not use this command, but overrideslot instead # Any arbitrary ISP as long as you know the equipment id/hwver/swver and necessary ethernet uni slot ./fs_xgspon_mod.py install GPON227000fe manual ALCL12ab34cd --hwver SOMETHING --swver ELSE --eqvid EQUIPMENT --eth_slot 10 @@ -228,6 +226,8 @@ If you run `/s/m/show 506` from telnet and see 17 or fewer rules, you almost cer - [YuukiJapanTech](https://github.com/YuukiJapanTech) - Assembling the spectacular resources at https://github.com/YuukiJapanTech/CA8271x/ - SipWannabe - Testing - Mastah - Testing/Debugging Orange connectivity issues +- [Arpie](https://github.com/arpiecodes) - KPN support and `overrideslot` +- [up-n-atom](https://github.com/up-n-atom) - Telus support ## References - https://github.com/YuukiJapanTech/CA8271x diff --git a/fs_xgspon_mod.py b/fs_xgspon_mod.py index 4d4294e..7e72168 100755 --- a/fs_xgspon_mod.py +++ b/fs_xgspon_mod.py @@ -56,19 +56,6 @@ def __init__(self, args): self.settings = [] - if self.PREFER_SLOT_OVERRIDE is True: - print("[!] To make the ONU work on this ISP's network, just an ETH UNI slot override is needed") - print("[!] Performing a slot override does not require any dangerous payloads to be applied") - print("[!] However, you can also choose to go ahead and install the full modification") - print("[!] When in doubt, you should probably try the less invasive (o)verride option first") - - answer = input("Choose either (o)verride or (i)nstall: ") - - if "o" in answer: - return overrideslot(args) - elif not "i" in answer: - raise ValueError(f"invalid choice: expected either o or i") - if self.KEEP_SERIAL is True and args.isp_ont_serial is None: # we prefer use the original serial, as there's no need to change it self.serial = args.fs_onu_serial[4:].lower() @@ -570,6 +557,18 @@ def install(args): print(f"[-] {e}") return + if settings.PREFER_SLOT_OVERRIDE is True: + print("[!] To make the ONU work on this ISP's network, just an ETH UNI slot override is needed") + print("[!] Performing a slot override does not require any dangerous payloads to be applied") + print("[!] However, you can also choose to go ahead and install the full modification") + print("[!] When in doubt, you should probably try the less invasive overrideslot command") + + answer = input("Proceed with installation anyways? (y)es or (n)o").lower() + + if answer not in ("y", "yes"): + print("[-] Aborting") + return + print("[+] Generated payload configuration:") for line in settings.config.split("\n"): @@ -704,6 +703,8 @@ def rearm(args): print("[-] Telnet timeout reached... make sure it's reachable") def overrideslot(args): + assert isinstance(args.eth_slot, int) + try: with CigTelnet(args.onu_ip, args.fs_onu_serial) as tn: print("[+] Telnet connection established, login successful") @@ -817,7 +818,7 @@ def parse_vlan_filter(vf): parse_install.add_argument("--eqvid", type=parse_length(20)) parse_install.add_argument("--hwver", type=parse_length(14)) parse_install.add_argument("--swver", type=parse_length(14)) - parse_install.add_argument("--eth_slot", type=int, choices=(1, 10), metavar="[1,10]") + parse_install.add_argument("--eth_slot", type=int, choices=(1, 10)) parse_install.add_argument("--vlan_rules", type=parse_vlan_filter) parse_install.set_defaults(func=install) @@ -834,7 +835,7 @@ def parse_vlan_filter(vf): parse_overrideslot = s.add_parser("overrideslot") parse_overrideslot.add_argument("--onu_ip", default="192.168.100.1") parse_overrideslot.add_argument("fs_onu_serial", type=parse_serial) - parse_overrideslot.add_argument("eth_slot", type=int, choices=(1, 10), metavar="[1,10]") + parse_overrideslot.add_argument("eth_slot", type=int, choices=(1, 10)) parse_overrideslot.set_defaults(func=overrideslot) args = p.parse_args()