Crime is pervasive into modern societies, although with different levels of diffusion across regions. Its dynamics are dependent on various socio-economic factors that make the overall picture particularly complex. While several theories have been proposed to account for the establishment of criminal behaviour, from a modelling perspective organised crime and terrorist networks received much less attention. In particular, the dynamics of recruitment into such organisations deserve specific considerations, as recruitment is the mechanism that makes crime and terror proliferate. We propose a framework able to model such processes in both organised crime and terrorist networks from an evolutionary game theoretical perspective. By means of a stylised model, we are able to study a variety of different circumstances and factors influencing the growth or decline of criminal organisations and terrorist networks, and observe the convoluted interplay between agents that decide to get associated to illicit groups, criminals that prefer to act on their own, and the rest of the civil society.