The Password Reset That Didn’t Work — Inside the Dahua Camera Backdoor
An attacker used brute-forcing, two known authentication-bypass flaws and Dahua's P2P cloud relay to reach over 14,530 internet-exposed cameras, then planted a hidden administrative account on 1,923 of them. Because that account sits outside the normal credential store, a password change and most factory resets do not remove it, so the attacker keeps access.
Published on medium.com
Here’s a scenario every security analyst dreads: you detect unauthorized access on a device, reset the password, maybe even factory-reset it for good measure — and the attacker is still inside.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Dahua IP cameras are physical security devices that are frequently exposed to the internet, either directly or through Dahua's P2P cloud-relay feature, which lets a camera behind a home or office router be reached using only its serial number. The same backend is used by OEM-rebranded devices, so the population at risk is wider than the Dahua brand alone.
The campaign described here, named Operation CameraSwarm, targeted more than 14,530 internet-exposed Dahua IP cameras. The entry points were not new: credential brute-forcing on Dahua's Easy4IP management port, authentication bypass through CVE-2021-33044 and CVE-2021-33045, and abuse of the P2P cloud relay. The part that matters for defenders is what the attacker left behind: on 1,923 cameras, a tool called p2pwn planted a hidden administrative account stored separately from the device's normal credential store, so a password change does not remove it, and on most affected firmware neither does a factory reset.

Setup
The campaign ran over a 35-day window and used three parallel techniques against the same device population:
- Credential brute-forcing on Dahua's Easy4IP management port.
- Authentication bypass using CVE-2021-33044 and CVE-2021-33045.
- Abuse of Dahua's P2P cloud-relay feature to reach cameras behind home and office routers using only a serial number.
The preconditions are the ones that make this kind of campaign cheap: devices reachable from the internet, old firmware, default credentials, and physical security hardware that IT teams do not monitor with the same rigour as servers or endpoints. The report does not list specific firmware versions, tool versions or account roles used in the attack.
Finding it
The researcher's starting observation is a scenario most SOC teams would treat as closed: unauthorised access is detected on a device, the password is reset, perhaps the device is factory-reset as well, and the attacker is still inside. In this campaign that was not hypothetical. The persistence mechanism, rather than the initial access, is the finding.
A second observation is a detection trap. The toolkit mislabelled its own techniques with the wrong CVE identifiers. A defender who chases the wrong CVE number ends up patching the wrong thing entirely, so the labels produced by the tool cannot be trusted as an indicator of which vulnerability was actually used.
Exploitation
Step 1: Gain access
The attacker used three techniques in parallel against the same population: brute-forcing credentials on the Easy4IP management port, the authentication bypasses in CVE-2021-33044 and CVE-2021-33045, and the P2P cloud relay reached with a serial number. The report does not include the individual requests, payloads or responses for these steps.
Step 2: Plant the hidden account with p2pwn
On 1,923 of the compromised cameras, the attacker's tool p2pwn created a hidden administrative account. The account is stored completely separately from the device's normal credential store. That separation is the core of the technique: a password change never touches the hidden account, and on most affected firmware a full factory reset does not remove it either.
Step 3: Generate offline recovery codes
The campaign also generated offline recovery codes. These can remain valid after the unauthorised account is deleted, because they are derived server-side by the vendor rather than tied to the local device state. Deleting the account is therefore not sufficient to invalidate the attacker's recovery path.
Root cause
The design mistake is the separation of the hidden administrative account from the normal credential store. Because the account lives outside the store that password changes and factory resets operate on, the standard remediation steps do not reach it. The recovery codes compound this: they are derived server-side by the vendor, so their validity does not depend on local device state and survives deletion of the account.
The initial access relied on weaknesses that are all patchable: old firmware, default credentials and internet exposure. The report does not describe the specific code defect behind the authentication bypasses or the exact firmware behaviour that lets the hidden account survive a reset on most devices; it states only that this is the case on most affected firmware.
Impact
An attacker who reaches a camera through any of the three entry points can plant a hidden administrative account that survives the remediation most teams would apply. On the affected population that meant persistent administrative access to 1,923 cameras after password changes, and on most affected firmware after factory resets as well. The offline recovery codes extend that persistence past deletion of the account itself.
The campaign affected more than 14,530 internet-exposed Dahua IP cameras, and the same backend is used by OEM-rebranded devices, so organisations running those devices are exposed to the same techniques. The report does not state a severity rating, CVSS score or bounty.
Fix
It states that every underlying technique is patchable and that the campaign succeeded because thousands of devices ran old firmware with default credentials and were left unmonitored. The report states that every underlying technique is patchable and that the campaign succeeded because thousands of devices ran old firmware with default credentials and were left unmonitored. Because the hidden account and the recovery codes survive ordinary resets, a password change or factory reset alone should not be treated as containment.
Variants to test
- Hidden account survival. Plant an administrative account through a supported or undocumented path, then change the password and factory-reset the device.
- Recovery code validity. Generate an offline recovery code, delete the unauthorised account, and attempt recovery.
- P2P relay reachability. Attempt to reach a device behind a router using only its serial number through the vendor's cloud relay.
- Toolkit CVE mislabelling. When a tool reports which CVE it used, verify the claim against the actual request and response rather than trusting the label.
- OEM-rebranded devices. Apply the same checks to devices built on the same backend under other brands.
What happened, in plain words
Imagine you come home, find a stranger in your living room, throw them out, change the locks, and then discover the next morning that they are sitting in your kitchen again. That is the situation described here, but with security cameras instead of houses.
A security researcher has written up a campaign that they named Operation CameraSwarm. In it, an attacker got into more than 14,530 Dahua IP cameras that were reachable from the internet. Dahua is a manufacturer of physical security cameras. An IP camera is a camera that connects to a network (and usually the internet) rather than only recording to a local disk, so it can be watched remotely. Because these cameras are often put on a network and then forgotten, they are a popular target.
The important part is not how the attacker got in. The important part is what the attacker left behind. On 1,923 of those cameras, a tool the attacker called p2pwn created a hidden administrative account: a second login with full control over the device, kept in a place separate from the normal list of users. Because it is stored separately, changing the camera's password does not remove it, and on most of the affected firmware neither does a factory reset (wiping the device back to its out-of-the-box state).
The campaign also produced offline recovery codes. A recovery code is normally a fallback string you can use to get back into a device when you have lost the password. These particular codes can keep working even after the hidden account is deleted, because they are generated on the vendor's servers rather than being tied to the state of the camera in front of you.
There is one more detail worth knowing: the attacker's toolkit labelled its own techniques with the wrong CVE numbers. A CVE is a public catalogue number for a known vulnerability, like a reference number in a library. If a defender trusts the label and patches for the wrong CVE, they fix the wrong thing and stay exposed.
None of the underlying weaknesses are new. Every technique used here can be patched. What made the campaign work was scale and neglect: thousands of devices running old firmware, still using default credentials, and not monitored the way servers are.

The image summarises the campaign: Operation CameraSwarm compromised more than 14,530 Dahua cameras and planted a backdoor that survives password changes and factory resets.
Context
Dahua IP cameras are physical security devices, and they are frequently exposed to the internet. Sometimes that exposure is direct: the camera has its own address that anyone on the internet can reach. Sometimes it is indirect, through Dahua's P2P cloud-relay feature. P2P stands for peer-to-peer. In this context it means the camera makes an outbound connection to the vendor's cloud service, and a user elsewhere asks that cloud service to connect them to the camera. The practical effect is that a camera sitting behind a home or office router, with no ports opened on that router, can still be reached from outside using only its serial number, the unique identifier printed on the device.
A useful comparison is a building with a receptionist. Instead of giving every visitor a key to the front door, the building calls the receptionist, who knows which flat you mean and puts the call through. Convenient, but it also means the receptionist can put through anyone who knows the flat number.
The same backend (the same underlying software and cloud service) is used by OEM-rebranded devices. OEM means original equipment manufacturer: one company builds the hardware and software, and other brands sell it under their own name. So the number of devices at risk is larger than the number carrying the Dahua logo.
The campaign described here, Operation CameraSwarm, targeted more than 14,530 internet-exposed Dahua IP cameras. The entry points were not new:
- Credential brute-forcing on Dahua's Easy4IP management port. Brute-forcing means trying many username and password combinations automatically until one works, like trying every key on a large keyring. Easy4IP is Dahua's remote-access service, and its management port is the network door through which those logins are attempted.
- Authentication bypass through CVE-2021-33044 and CVE-2021-33045. Authentication is the process of proving who you are, usually with a password. A bypass is a flaw that lets someone skip that proof entirely, like a faulty turnstile you can walk around.
- Abuse of the P2P cloud relay, as described above.
What matters for defenders is what the attacker left behind. On 1,923 cameras, a tool called p2pwn planted a hidden administrative account. That account is stored separately from the device's normal credential store, the place where the camera keeps its list of users and passwords. Because it lives outside that store, a password change does not remove it, and on most affected firmware neither does a factory reset.
Setup
The campaign ran over a 35-day window and used three parallel techniques against the same population of devices:
- Authentication bypass using CVE-2021-33044 and CVE-2021-33045.
- Abuse of Dahua's P2P cloud-relay feature to reach cameras behind home and office routers using only a serial number.
Running three techniques in parallel against the same set of devices is a numbers game. Each technique has a different chance of working on a given camera, so trying all three at once finds more victims in the same time than trying them one after another.
The preconditions are what make this kind of campaign cheap for an attacker:
- Devices reachable from the internet.
- Old firmware. Firmware is the software built into the device, and old firmware means known bugs that have already been fixed in newer releases.
- Default credentials. Many devices ship with a well-known username and password, and if nobody changes them, anyone who reads the manual can log in.
- Physical security hardware that IT teams do not monitor with the same rigour as servers or endpoints. A server is a computer that provides services to other computers; an endpoint is an individual user device such as a laptop. Cameras often fall outside the monitoring that covers those machines.
The report does not list specific firmware versions, tool versions or account roles used in the attack.
Finding it
The researcher's starting observation is a scenario most SOC teams would treat as closed. A SOC, or security operations centre, is the team that watches an organisation's systems for signs of attack. The scenario is this: unauthorised access is detected on a device, the password is reset, perhaps the device is factory-reset as well, and the attacker is still inside.
In this campaign that was not hypothetical. The finding is not the way in; it is the persistence mechanism, the method that keeps the attacker's access alive after the initial break-in has been dealt with.
A second observation is a detection trap. The toolkit mislabelled its own techniques with the wrong CVE identifiers. A defender who chases the wrong CVE number ends up patching the wrong thing entirely. So the labels produced by the tool cannot be trusted as an indicator of which vulnerability was actually used. If a tool tells you it used CVE-A, and the traffic actually shows the behaviour of CVE-B, believing the label leaves you exposed to CVE-B.
Exploitation
Step 1: Gain access
The attacker used three techniques in parallel against the same population:
- Brute-forcing credentials on the Easy4IP management port.
- The authentication bypasses in CVE-2021-33044 and CVE-2021-33045.
- The P2P cloud relay, reached with a serial number.
The report does not include the individual requests, payloads or responses for these steps. A request is a message one computer sends to another asking it to do something; a payload is the part of that message carrying the actual data; a response is the reply.
Step 2: Plant the hidden account with p2pwn
On 1,923 of the compromised cameras, the attacker's tool p2pwn created a hidden administrative account. The account is stored completely separately from the device's normal credential store.
That separation is the core of the technique. Think of a hotel that keeps a guest register at reception, and a separate master key list in a safe in the manager's office. If you tear up the guest register and reissue every guest key, the master key list is untouched, and whoever holds a master key still gets into every room. In the same way, a password change never touches the hidden account, and on most affected firmware a full factory reset does not remove it either.
Step 3: Generate offline recovery codes
The campaign also generated offline recovery codes. These can remain valid after the unauthorised account is deleted, because they are derived server-side by the vendor rather than tied to the local device state. Server-side means the calculation happens on the vendor's own computers, not on the camera. Local device state means the settings and data stored on the camera itself.
Deleting the account is therefore not sufficient to invalidate the attacker's recovery path. To return to the hotel comparison: even if you destroy the master key, the manager's office can still issue a new one, because the list of who may receive keys lives elsewhere.
Root cause
The design mistake is the separation of the hidden administrative account from the normal credential store. Because the account lives outside the store that password changes and factory resets operate on, the standard remediation steps do not reach it. Remediation means the actions taken to fix a problem and remove an attacker's access.
The recovery codes compound this. They are derived server-side by the vendor, so their validity does not depend on local device state and survives deletion of the account.
The initial access relied on weaknesses that are all patchable: old firmware, default credentials and internet exposure. The report does not describe the specific code defect behind the authentication bypasses, nor the exact firmware behaviour that lets the hidden account survive a reset on most devices. It states only that this is the case on most affected firmware.
Impact
An attacker who reaches a camera through any of the three entry points can plant a hidden administrative account that survives the remediation most teams would apply. On the affected population that meant persistent administrative access to 1,923 cameras after password changes, and on most affected firmware after factory resets as well. Persistent here means it does not go away on its own; it stays until something specifically removes it.
The offline recovery codes extend that persistence past deletion of the account itself.
The campaign affected more than 14,530 internet-exposed Dahua IP cameras, and the same backend is used by OEM-rebranded devices, so organisations running those devices are exposed to the same techniques. The report does not state a severity rating, CVSS score or bounty. A CVSS score is a standard number for expressing how serious a vulnerability is; a bounty is a payment some vendors make to researchers who report flaws.
Fix
It states that every underlying technique is patchable and that the campaign succeeded because thousands of devices ran old firmware with default credentials and were left unmonitored.
The report states that every underlying technique is patchable and that the campaign succeeded because thousands of devices ran old firmware with default credentials and were left unmonitored.
Because the hidden account and the recovery codes survive ordinary resets, a password change or factory reset alone should not be treated as containment. Containment means stopping an incident from spreading and cutting off the attacker's access.
Variants to test
These are checks a defender can run to see whether their own devices behave the same way. Each one describes what a positive result looks like, meaning the result that shows the problem is present.
- Hidden account survival. Plant an administrative account through a supported or undocumented path, then change the password and factory-reset the device. Authenticates means it still logs in successfully.
- Recovery code validity. Generate an offline recovery code, delete the unauthorised account, and attempt recovery.
- P2P relay reachability. Attempt to reach a device behind a router using only its serial number through the vendor's cloud relay. A port is a numbered network doorway on a machine; an inbound port being open means the outside world can connect to it directly.
- Toolkit CVE mislabelling. When a tool reports which CVE it used, verify the claim against the actual request and response rather than trusting the label.
- OEM-rebranded devices. Apply the same checks to devices built on the same backend under other brands.
Glossary
- Administrative account: a login that has full control over a device, including the ability to change its settings and create other users.
- Authentication: the process of proving who you are, usually with a username and password.
- Authentication bypass: a flaw that lets someone skip authentication entirely and act as if they had logged in.
- Bounty: a payment some vendors make to researchers who report security flaws.
- Brute-forcing: automatically trying many username and password combinations until one works.
- Containment: the actions taken to stop an incident from spreading and to cut off an attacker's access.
- Credential store: the place on a device where its list of users and passwords is kept.
- CVE: a public catalogue number for a known vulnerability, used so everyone refers to the same flaw.
- CVSS score: a standard number for expressing how serious a vulnerability is.
- Default credentials: the well-known username and password a device ships with, which should be changed before use.
- Easy4IP: Dahua's remote-access service, whose management port was one of the entry points in this campaign.
- Endpoint: an individual user device such as a laptop or desktop computer.
- Factory reset: wiping a device back to its out-of-the-box state.
- Firmware: the software built into a device.
- IP camera: a camera that connects to a network, and often the internet, rather than only recording locally.
- Local device state: the settings and data stored on the device itself.
- OEM-rebranded: hardware built by one company and sold under another brand's name.
- P2P cloud relay: a feature where a device connects outbound to the vendor's cloud service, which then connects remote users to it, so no inbound port needs to be open.
- Payload: the part of a network message that carries the actual data.
- Persistence mechanism: the method an attacker uses to keep access after the initial break-in has been dealt with.
- Port: a numbered network doorway on a machine through which a service is reached.
- Remediation: the actions taken to fix a problem and remove an attacker's access.
- Request: a message one computer sends to another asking it to do something.
- Response: the reply a computer sends back to a request.
- Recovery code: a fallback string used to regain access to a device when the password is lost.
- Serial number: the unique identifier printed on a device.
- Server: a computer that provides services to other computers.
- Server-side: a calculation or check that happens on the vendor's own computers rather than on the device in front of you.
- SOC: security operations centre, the team that watches an organisation's systems for signs of attack.