Recent breakthroughs in microelectromechanical systems, microsystem technologies, and wireless communications have made energy-efficient, inexpensive, off-the-shelf devices that unambiguously carry data without communication overhead practical. UWB radio technology employs minimal energy for short-range, high-bandwidth communications throughout a large section of the radio. Mobile computing organizations now explore mobile ad-hoc networks. Decentralized networks communicate. Peer nodes enable wireless device-to-device communication. Location-based and location-aided routing improve ad hoc routing. Physical or involuntary configuration places mobile nodes during deployment. Large networks need too much manual setup. GPS receivers for each sensor unit would significantly increase network installation costs. It inspired non-GPS and non-physical configuration localization. Most localization systems use beacon nodes. Beacon nodes are unique. Standard security approaches block secure beacon nodes, which might compromise localization. This research investigates beacon node localization issues and attacks. We constructed a statistical model to detect rogue beacon nodes in the ad hoc network and studied how various attacks affect localization. Bogus beacon nodes find mobile nodes. We enabled malicious beacon node communication. Trilateration and Received Signal Strength Indicator found unknown nodes. Trilateration detects compromised beacon nodes. The algorithm finds malicious beacon nodes. Our experiments removed 90% of compromised beacon nodes. Our flexible localization technique allows several algorithms and range methods without time complexity. Location identification affected fake beacon nodes.