The paper investigates mobile ad hoc networks (MANETs) and the security challenges posed by black-hole and worm-hole attacks. It presents a combined detection and prevention algorithm aimed at enhancing communication security, utilizing routing techniques and analyzing various detection strategies. The authors suggest future work focused on simulation and practical results to further develop these security measures.