Crowdsourcing is a promising paradigm to accomplish a complex task via eliciting services from a large group of contributors. However, recent observations indicate that the success of crowdsourcing is being threatened by the malicious behaviors of the contributors. In this paper, we analyze the malicious attack problem using an iterated prisoner’s dilemma (IPD) game and propose a zero-determinant (ZD) strategy based scheme by rewarding a worker’s cooperation or penalizing the defection for enticing his final cooperation. Both theoretical analysis and simulation study indicate that the proposed algorithm has two attractive characteristics: 1) the requestor can incentivize the worker to keep on cooperating by only increasing the short-term payment; and 2) the proposed algorithm is fair, so the requestor cannot arbitrarily penalize an innocent worker to increase her payoff even though she can dominate the game. To the best of our knowledge, we are the first to use the ZD strategy to stimulate both players to cooperate in an IPD game. Moreover, our proposed algorithm is not restricted to solve the problem of the malicious crowdsourcing - it can be employed to tackle any problem that can be formulated by an IPD game.