Praise be to Allah.
According to the scholars, the vermin of the earth such as snakes, scorpions, dung beetles, cockroaches, rats etc., are haraam. This is the view of Abu Haneefah, Ahmad and Dawood.
Al-Shaafa’i and his companions quote as evidence for that the aayah,
“and prohibits them as unlawful Al-Khabaa’ith (i.e. all evil and unlawful as regards things, deeds, beliefs, persons and foods),”
[al-A’raaf 7:157 – interpretation of the meaning]
These are things which the Arabs find repulsive. And they quote as evidence the words of the Prophet (peace and blessings of Allaah be upon him): “(There are) five animals, all of which are evil and should be killed in the Haram (sanctuary of Makkah): crows, kites [a kind of bird], scorpions, rats and vicious dogs.” (Narrated by al-Bukhaari and Muslim from the report of ‘Aa’ishah, Hafsah and Ibn ‘Umar). It was narrated from Umm Shurayk that the Prophet (peace and blessings of Allaah be upon him) commanded the killing of lizards. (Narrated by al-Bukhaari and Muslim). With regard to the aayah (interpretation of the meaning):
“Say (O Muhammad): ‘I find not in that which has been revealed to me anything forbidden to be eaten by one who wishes to eat it, unless it be Maytah (a dead animal) or blood poured forth (by slaughtering or the like), or the flesh of swine (pork); for that surely, is impure or impious (unlawful) meat (of an animal) which is slaughtered as a sacrifice for others than Allaah (or has been slaughtered for idols, or on which Allaah’s Name has not been mentioned while slaughtering).” [al-An’aam 6:145]
al-Shaafa’i and other scholars said: what this refers to is things which you used to eat and regard as good. Al-Shaafa’i said: this is the most likely meaning of the aayah, based on the Sunnah. And Allaah knows best.