Abd al-Rahman bin Abdullah bin Mas'ud narrates from his father, Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him), that the Messenger of Allah (peace and blessings be upon him) said: "Whoever helps in wrongdoing is like a camel that has fallen into a well and is then pulled out by its tail."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / 21080