It is narrated from Hazrat Abu Hurairah (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) has commanded that even during prayer, "the two black things, i.e., the snake and the scorpion," can be killed.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 10116