Look like guts.. i know if the foot gets pierced the frilly looking insides will come out. Might have been from the crab and the reason its moving around. Just keep an eye on it and it should heal up.
I recommend isolating it in a breeder basket or something so it can heal without irritation.