According to the Hanafi school of Islamic Law, all sea creatures are prohibited, except the fish, which is the only sea creature that is lawful for consumption. The prohibition of all sea creatures besides the fish is deduced from the Quran and various Ahaadith of the Prophet (blessings and peace of Allah be upon him).
Allah (swt) mentions in the Quran; and made permissible for you is the “prey of the sea”. The Hanafi Jurists restrict the generality of “prey of the sea” to specifically meaning the fish. The Prophet (pbuh) also said that the water is pure and its carrion is lawful. Thereafter, the Prophet (pbuh) explains what is meant by the “prey of the sea” and “the carrion of the sea” in the hadith which states that two dead (carrion) are made permissible (fish) and Jaraad (locust).
Therefore, with regards to shrimp/prawns, if it is a fish or classified as a species thereof, it will be lawful and Halaal for consumption according to the Hanafi Jurists. Due to the fact that shrimp is a type of fish in Islamic terms, it will be totally permissible and Halaal for consumption as the Hanafi Jurists have stated that all types of fish are Halaal.
The crab (sea, land, river, blue, mangrove, etc.) are not permissible as they are not fish according to the Hanafi School of law.
On the other hand and according to the majority of scholars of other schools of thought, the basic principle with regard to sea creatures is that they are permissible to eat, because Allah, may He be exalted, says (what might be translated as):
“Lawful to you is (the pursuit of) water game and its use for food – for the benefit of yourselves and those who travel” [al-Maa’idah 5:96].
The Messenger of Allah (blessings and peace of Allah be upon him) said concerning the sea: “Its water is a means of purification and its ‘dead meat’ is permissible.” at-Tirmidhi (69) – Abu Dawood (83)
Based on the above, eating shrimp and crab is permissible and there is no reason not to eat them, because of the general meaning of the evidence which indicates that everything caught from the sea is permissible.
Please note, if any seafood is proven to be toxic or harmful to the one who eats them, then it is prohibited to eat them, because of the harm that it may cause, not because it is prohibited in and of itself.