I don't know what variety of worm you have but if it's visible to the naked eye it's probably not parasitic, just a gunk eater. I'm sure there are tank medications that will exterminate the worms but with crabs the meds are likely to wipe them out too. Might be best to handle the problem like a snail infestation, starve them out, or introduce a species of fish that will eat them. Good luck.