It is narrated from Hazrat Abu Huraira (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," may be killed.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 10154