Abstract In the current field of information security, illegal network scanning activities are prevalent, and such behaviors are usually aimed at detecting security vulnerabilities in network systems and preparing for future attack activities. This study proposes a secure access system based on anti-mapping technology, which aims to effectively block illegal scanning behaviors while ensuring that the normal access of legitimate users is not affected. The system integrates advanced behavioral analysis algorithms that utilize machine learning techniques for deep learning and pattern recognition of network traffic, and is able to accurately distinguish between normal user activities and malicious scanning attempts. At the core of the system is a set of dynamic adaptive identification mechanisms that update the detection algorithms in real time to adapt to emerging scanning techniques and attack strategies by continuously learning from changes in network traffic. In addition, the system employs role-based access control (RBAC) policies to enhance the protection of sensitive resources. The Secure Access Gateway is deployed at the boundary of the network to monitor and filter all ingress traffic, effectively intercepting unauthorized scanning activities by comprehensively evaluating the source, behavior and frequency of traffic. Experimental results show that the proposed two-layer network structure performs well in detecting common threats such as port scanning, DDoS attacks, and SQL injections, with an accuracy rate of over 95%. Especially for complex and covert APT (advanced persistent threat) attacks, the system can significantly reduce the false alarm rate and effectively improve the detection speed. However, when dealing with some highly customized malware, the system's recognition ability still needs to be improved, which indicates that future research needs to focus more on enhancing the ability to learn and adapt to unknown threats.