Concerning the problem of target tracking in wireless sensor networks under cyber attacks, this paper proposes a trust-based distributed H diffusion filtering method, designed to maintain resilience against diverse types of cyber attacks. Firstly, the distributed H filtering equation for a linear discrete system is implemented for iterative updates of state estimation and error covariance. Secondly, to address the impact of cyber attacks, the K-means-based trust set extracting algorithm is employed to identify and remove attacked untrusted nodes. Subsequently, the data from trusted nodes is fused based on a diffusion strategy, leading to recalculations of state estimation and covariance, thus improving the overall target tracking performance. Experimental results demonstrate the effectiveness of our method in resisting denial of service attacks and deception attacks, such as random, replay, and false data injection attacks. The proposed approach offers robustness and adaptability, making it suitable for practical applications in distributed sensor networks under cyber attacks.INDEX TERMS Cyber attacks, distributed H diffusion filtering, wireless sensor network, target tracking.