Mobile ad-hoc networks (MANETs) have no fixed infrastructure, so all network operations such as routing and packet forwarding are done by the nodes themselves. However, almost all common existing routing protocols basically focus on performance measures regardless of security issues. Since these protocols consider all nodes to be trustworthy, they are prone to serious security threats. Wormhole attack is a kind of such threats against routing processes which is particularly a challenging problem to detect and prevent in MANETs. In this paper, a two-phase detection scheme is proposed to detect and prevent wormhole attacks. First phase checks whether a wormhole tunnel exists on the selected path or not. If there is such a tunnel, the second phase is applied to confirm the existence of the wormhole attack, and locate a malicious node. The proposed detection scheme can appropriately detect all types of this kind of attacks such as in-band and out-of-band ones in different modes such as hidden or exposed, without any need of special hardware or time synchronization. In order to evaluate the performance of the proposed scheme, some various scenarios are simulated in the NS-2 simulator, and different measures are assessed. The results obtained from simulating the proposed scheme and other benchmarks indicate that in most criteria considered in this paper, the proposed scheme outperforms the proposed methods in prior works.
 R. Sheikh, M. Singh Chande, and D. Mishra, "Security issues in manet: A review," in Wireless And Optical Communications Networks (WOCN), 2010 Seventh International Conference On, pp. 1-4, 2010.
 P. Joshi, "Security issues in routing protocols in MANETs at network layer," Procedia Computer Science, vol. 3, pp. 954-960, 2011.
 S. Banerjee and K. Majumder, "A Comparative Study on Wormhole Attack Prevention Schemes in Mobile Ad-Hoc Network," In: Thampi, S.M., Zomaya, A.Y., Strufe, T., Alcaraz Calero, J.M., Thomas, T. (eds.) SNDS 2012. CCIS, Recent Trends in Computer Networks and Distributed Systems Security, Springer, vol. 335, pp. 372-384, 2012.
 M.-Y. Su, "WARP: A wormhole-avoidance routing protocol by anomaly detection in mobile ad hoc networks," Computers & Security, vol. 29, pp. 208-224, Mar. 2010.
 R. Stoleru, H. Wu, and H. Chenji, "Secure neighbor discovery and wormhole localization in mobile ad hoc networks," Ad Hoc Networks, vol. 10, pp. 1179-1190, Sept. 2012.
 C. Perkins and E. Royer, "Ad-hoc on-demand distance vector routing," in Mobile Computing Systems and Applications, 1999. Proceedings. WMCSA '99. Second IEEE Workshop on, pp. 90-100, 1999.
 R. Jhaveri, S. Patel, and D. Jinwala, "Dos attacks in mobile ad hoc networks: A survey," in Advanced Computing Communication Technologies (ACCT), 2012 Second International Conference on, pp. 535-541, 2012.
 Supriya and M. Khari, "Mobile Ad Hoc Networks Security Attacks and Secured Routing Protocols: A Survey," Advances in Computer Science and Information Technology. Networks and Communications, vol. 84, pp. 119-124, 2012.
 T. Giannetsos and T. Dimitriou, "LDAC : A localized and decentralized algorithm for efficiently countering wormholes in mobile wireless networks," Journal of Computer and System Sciences, vol. 80, no. 3, pp. 618-643, 2014.
 J. Liu, H. Chen, Z. Zhen, and S. Mingbo, "Intrusion Detection Algorithm for the Wormhole Attack in Ad Hoc Network," in Proceedings of International Conference on Computer Science and Information Technology, pp. 147-154, 2014.
 J. Zhou, J. Cao, J. Zhang, C. Zhang, and Y. Yu, "Analysis and Countermeasure for Wormhole Attacks in Wireless Mesh Networks on a Real Testbed," in 26th International Conference on Advanced Information Networking and Applications (AINA) IEEE, pp. 59-66, 2012.
 S. Hazra and S. Setua, "Trusted Routing in AODV Protocol Against Wormhole Attack," Future Information Technology, Application, and Service. Lecture Notes in Electrical Engineering, vol. 164, pp. 259-269, 2012.
 K. Fall and K. Varadhan, "The ns Manual," The VINT Project, 2011.
 Y.-C. Hu, A. Perrig, and D. Johnson, "Packet leashes: a defense against wormhole attacks in wireless networks," in INFOCOM 2003. Twenty Second Annual Joint Conference of the IEEE Computer and Communications. IEEE Societies, vol. 3, pp. 1976-1986, 2003.
 H. S. Chiu and K.-S. Lui, "Delphi: wormhole detection mechanism for ad hoc wireless networks," in Wireless Pervasive Computing, 2006 1st International Symposium on, pp. 6-12, 2006.
 K. Chanchal and D. Lobiyal, "NTTM: Novel Transmission Time Based Mechanism to Detect Wormhole Attack," Quality, Reliability, Security and Robustness in Heterogeneous Networks. Lecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering, vol. 115, pp. 485-495, 2013.
 F. Shi, W. Liu, D. Jin, and J. Song, "A countermeasure against wormhole attacks in manets using analytical hierarchy process methodology," Electronic Commerce Research. Springer US, vol. 13, no. 3, pp. 329-345, 2013.
 S. Choi, D.-Y. Kim, D. hyeon Lee, and J. il Jung, "Wap: Wormhole attack prevention algorithm in mobile ad hoc networks," in Sensor Networks, Ubiquitous and Trustworthy Computing,2008. SUTC '08. IEEE International Conference on, pp. 343-348, 2008.
 S. ul Haq and F. B. Hussain, "Out-of-band wormhole attack detection in MANETS," in the Proceedings of the 9th Australian Information Security Management Conference, (Perth Western Australia), 2011.
 M. Su, "A Study of Deploying Intrusion Detection Systems in Mobile Ad Hoc Networks," Proceedings of the World Congress on Engineering, vol. II, pp. 2-6, 2012.
 P. Sharma and A. Trivedi, "Prevention of Wormhole Attack in Ad-Hoc Network," International Journal of Computer Applications Special Issue on Electronics, Information and Communication Engineering -ICEICE, no. 5, pp. 13-17, 2011.
 A. Malhotra, D. Bhardwaj, and A. Garg, "Wormhole attack prevention using clustering and digital signatures in reactive routing," in Networking, Sensing and Control (ICNSC), 2012 9th IEEE International Conference on, pp. 122-126, 2012.
 S. Rhee, Injong and Shin, Minsu and Hong, Seongik and Lee, Kyunghan and Kim, Seong Joon and Chong, "On the Levy-walk Nature of Human Mobility," IEEE/ACM Trans. Netw., vol. 19, no. 3, pp. 630-643, 2011.