Mobile peer-to-peer networking (MP2P) is a relatively new paradigm compared to other wireless network technologies. In the last 10–15 years, it has gained tremendous popularity because of its usefulness in applications such as file sharing over the Internet in a decentralized manner. Security of mobile P2P networks represents an open research topic and a main challenge regarding the vulnerability of these networks and their convenience to different security attacks such as black hole, Sybil, etc. In this work, we analyze the black hole attack in wireless P2P networks using the AODV as the routing protocol. In a black hole attack, a malicious node assumes the identity of a legitimate node, by creating forged answers with a higher sequence number, and thus forces the victim node to prioritize it as a relay node. We propose a solution based on a modification of the AODV routing protocol, taking into account the behavior of each node participating in the network. The performances of our proposal are evaluated by simulation.