With the continuous development of renewable energy technologies and intelligent control systems, DC microgrids have become a popular direction for the development of future energy systems with the advantages of high efficiency and flexibility. However, because DC microgrids are closely connected to the Internet, their complex network structures and communication protocols make them easy targets for cyber attacks. Therefore, this paper proposes an attack detection strategy based on the complete ensemble empirical mode decomposition with adaptive noise for detecting abnormal output data in DC microgrids. First, the voltage signal with a fast response rate is analyzed based on the effect of data injection on the output of DC microgrids. Secondly, sufficient feature extraction is performed on the output voltage using complete set empirical mode decomposition. Then, calculate the energy of the decomposed feature mode function, and set an anomaly threshold detection scheme based on the energy interval during normal operation of the DC microgrid to complete the detection of the abnormal output of the DC microgrid. Finally, the simulation verifies the reliability and effectiveness of the proposed detection strategy.