I got some base rock from my friend. it come alot of that thing and red worm. I believe the red worm would'nt harm my reef and fish. but that thing?....

I put it in a black bucket with power head and heater. If this is bad thing, can I cover the cover 'cook' it monthes and kill the bad thing?
thanks!!!!!