In cooperative P2P networks, there are two kinds of illegal users, namely free riders and Sybils. Free riders are those who try to receive services without any sort of cost. Sybil users are rational peers which have multiple fake identities. There are some techniques to detect free riders and Sybil users which have previously been proposed by a number of researchers such as the Tit-for-tat and Sybil guard techniques. Although such previously proposed techniques were quite successful in detecting free riders and Sybils individually, there is no technique capable of detecting both these riders simultaneously. Therefore, the main objective of this research is to propose a single mechanism to detect both kinds of these illegal users based on Game theory. Obtaining new centrality and bandwidth contribution formulas with an incentive mechanism approach is the basic idea of the present research’s proposed solution. The result of this paper shows that as the life of the network passes, free riders are identified, and through detecting Sybil nodes, the number of services offered to them will be decreased.