masochist

noun

Someone who enjoys pain, or who derives pleasure from harming oneself or being harmed by others.

Someone who obtains pleasure from receiving punishment.