Skip to content

Commit 21125ea

Browse files
committed
update README.md
1 parent 16300aa commit 21125ea

File tree

3 files changed

+52
-6
lines changed

3 files changed

+52
-6
lines changed

README.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,51 @@
11
# zte_factroymode.py
22

3-
open telnet:
4-
`python3 zte_factroymode.py --user CUAdmin --pw CUAdmin -- telnet open`
3+
open telnet(use embed user/pass to 192.168.1.1 80):
4+
5+
`python3 zte_factroymode.py telnet`
6+
7+
or custom args
8+
9+
`python3 zte_factroymode.py --user CUAdmin --pw CUAdmin -- 192.168.1.1 80 telnet open`
10+
11+
```shell
12+
$ python3 zte_factroymode.py -h
13+
usage: https://github.com/douniwan5788/zte_modem_tools
14+
15+
positional arguments:
16+
ip route ip (default: 192.168.1.1)
17+
port router http port (default: 80)
18+
19+
options:
20+
-h, --help show this help message and exit
21+
--user USER [USER ...], -u USER [USER ...]
22+
factorymode auth username (default: ['factorymode', 'CMCCAdmin', 'CUAdmin', 'telecomadmin', 'cqadmin', 'user',
23+
'admin', 'cuadmin', 'lnadmin', 'useradmin'])
24+
--pass PW [PW ...], -p PW [PW ...]
25+
factorymode auth password (default: ['nE%jA@5b', 'aDm8H%MdA', 'CUAdmin', 'nE7jA%5m', 'cqunicom', '1620@CTCC',
26+
'1620@CUcc', 'admintelecom', 'cuadmin', 'lnadmin'])
27+
28+
subcommands:
29+
valid subcommands
30+
31+
{telnet,serial} supported commands
32+
telnet control telnet services on/off
33+
serial control /proc/serial on/off
34+
```
35+
36+
# zte_hardcode_dump.py
37+
38+
decrypt /etc/hardcodefile
39+
`./zte_hardcode_dump.py test/hardcode test/hardcodefile/*`
40+
41+
```shell
42+
$ ./zte_hardcode_dump.py -h
43+
usage: https://github.com/douniwan5788/zte_modem_tools
44+
45+
positional arguments:
46+
hardcode the /etc/hardcode file which contains root key
47+
hardcodefile config files under /etc/hardcodefile
48+
49+
options:
50+
-h, --help show this help message and exit
51+
```

zte_factroymode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ def parseArgs():
278278
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
279279
parser.add_argument('ip', nargs="?", help='route ip', default="192.168.1.1")
280280
parser.add_argument('port', nargs="?", help='router http port', default=80)
281-
parser.add_argument('--user', nargs='+', help='factorymode auth username', default=[
281+
parser.add_argument('--user', '-u', nargs='+', help='factorymode auth username', default=[
282282
'factorymode', "CMCCAdmin", "CUAdmin", "telecomadmin", "cqadmin",
283283
"user", "admin", "cuadmin", "lnadmin", "useradmin"])
284-
parser.add_argument('--pw', nargs='+', help='factorymode auth password', default=[
284+
parser.add_argument('--pass', '-p', metavar='PASS', dest='pw', nargs='+', help='factorymode auth password', default=[
285285
'nE%jA@5b', "aDm8H%MdA", "CUAdmin", "nE7jA%5m", "cqunicom",
286286
"1620@CTCC", "1620@CUcc", "admintelecom", "cuadmin", "lnadmin",])
287287
subparsers = parser.add_subparsers(dest='cmd', title='subcommands',

zte_hardcode_dump.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from struct import pack, unpack
88
from Crypto.Cipher import AES
99
from Crypto.Hash import SHA256
10-
from Crypto.Util.Padding import pad, unpad
1110

1211

1312
# for (i=0
@@ -67,7 +66,7 @@ def dump(hardcoded, hardcodefiles: List[BinaryIO]):
6766
def parseArgs():
6867
parser = argparse.ArgumentParser(prog='zte_hardcode_dump', usage='https://github.com/douniwan5788/zte_modem_tools',
6968
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
70-
parser.add_argument('hardcode', help='the /etc/hardcodefile file which contains root key',
69+
parser.add_argument('hardcode', help='the /etc/hardcode file which contains root key',
7170
type=argparse.FileType('rb'))
7271
parser.add_argument('hardcodefile', nargs="+", help='config files under /etc/hardcodefile',
7372
type=argparse.FileType('rb'))

0 commit comments

Comments
 (0)