Due to the open nature of peer-to-peer (P2P) networks, distributed systems usually employ reputation systems (RSs) to help peers identify trustworthy resource providers and steer away from the malicious peers who may release harmful files or resources in their benefits. In this paper, we propose a new reputation mechanism based on referral's credibility for P2P networks called RBRC. More specifically, we incorporate the trust relationship between the service requestor and the referral to model the target user's reputation. Besides, our method takes into consideration many critical factors, including the rating time, transaction value, transaction times, incentive factors and the referral's credibility. In this way, it would be too expensive for the malicious users to launch a malicious attack in terms of both money and time cost. Experimental results show that our method can effectively strengthen the robustness of reputation systems in combating malicious attacks.