In recent years, there has been an increase in distributed reflective denial of service (DRDoS) attacks, particularly those that target open lightweight directory access protocol (LDAP) servers. These attacks involve transmitting a small request to a large number of available LDAP servers, seeking information from all users. Consequently, the servers respond with significantly more data than the original request, amplifying the traffic and overwhelming the target with massive amounts of data. Therefore, this paper proposes a novel model for detecting LDAP-based DRDoS attacks by utilizing an enhanced particle swarm optimization (PSO) algorithm based on an adaptive weighted threshold (AWTPSO) model. The proposed AWTPSO model incorporates network traffic features and LDAP protocol characteristics to identify attack patterns. It further employs an adaptive weighted threshold model to dynamically adjust the threshold value for each feature. The enhanced PSO algorithm optimizes the threshold values, thereby improving the detection accuracy of the proposed model. The proposed AWTPSO detection model has been validated using the recent CICDDoS2019 dataset (LDAP sub-dataset). The experimental results demonstrate that the AWTPSO model effectively detects LDAP-based DRDoS attacks with exceptional accuracy of 99.99% and minimal false positives of 0.01%, surpassing other state-of-the-art techniques. Consequently, the proposed model presents a highly promising and robust solution for detecting the threat of LDAP-based DRDoS attacks on enterprise networks.