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 to kill 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: Umdat al-Ri'ayah 1: 195.