HMM, I'm just guessing without a pic, but... you say they are connected to the rock? Some nemertean worms are green, but the only thing I can think of that would be connected to the rock, and appear wormlike, is this:
http://joaofotos.planetaclix.pt/Julio/FJ28.jpg
Is that what it looks like?
Cheers,
Don