Answer
Yes, it is permissible, as long as killing it requires little effort; for Abu Huraira, may Allah be pleased with him, said: "The Messenger of Allah, peace be upon him, commanded the killing of the two black things in prayer: the snake and the scorpion," in Sunan al-Tirmidhi 2: 233, and he said: it is good and authentic, and in Sahih Ibn Hibban 6: 115, and Al-Mustadrak 1: 386. See: Umda al-Ri'aya 1: 195.