1.7 KiB
Alternate way to get root access in JF ONT for newer firmwares with router specific encryption keys
Disclaimer: - This is Only for educational purposes, No one is responsible for any type of damage. Any wrong step might brick your router. So be aware.
-
First of all, follow this guide to get the file at
/flash/secure/key.txt
which is the encryption key of your backup config. -
Go to your router admin page and download a backup of your router settings configuration from Administrator > Maintenance.
-
Decrypt the config (
.enc
file) using the commandopenssl aes-128-cbc -d -pass file:key.txt -in input.enc -out output.txt
(Changeinput.enc
andoutput.txt
respectively to your requirements). -
Open the decrypted config file.
-
Change the first line of the decrypted config file like this:
config.userdb = {} os.execute("/usr/sbin/telnetd"); os.execute("/pfrm2.0/bin/iptables -I fwInBypass -p tcp --dport 23 -m ifgroup --ifgroup-in 0x1/0x1 -j ACCEPT"); os.execute("echo -e \"password\npassword\" | passwd root");
-
Ensure there is no line break in the line you just pasted. The whole content should be in a single line and the line should start with
config
otherwise this isn't gonna work. -
Encrypt the config using the command
openssl aes-128-cbc -pass file:key.txt -in input.txt -out output.enc
(Changeinput.txt
andoutput.enc
respectively). -
The output file should have the same name as your actual backed up config file in step 2.
-
Restore the new backup file in Router Admin page at Administrator > Maintenance.
-
Done! Now Telnet into the Router and use username as
root
and password aspassword
.