Definitely flatworms. Ive had them in the past, ive had luck with using a large tube needle on a syringe and sucking them off of rocks and coral but it takes time and dosen't completely solve your problem.
Flatworm exit works wonders, but so do wrasses if you are keeping fish. Hope this helps.