The ruling regarding masturbation
What is the ruling regarding masturbation? What about when one masturbates not with his hand, but with some other object?
Answer:
Masturbation whether it is with the hand or with some other object that is shaped as the private part is shaped is unlawful. Every Muslim should beware of this habit, because practicing it goes contrary to the following verse: And those who guard their chastity (i.e. private parts, from illegal sexual acts). Except from their wives or (the slaves) that their right hand possess, - for then, they are free from blame; But whoever seeks beyond that, then those are the transgressors. Moreover, masturbation is damaging to ones health. And with Allaah is the facilitation to do what is right.
Source :
Shaykh `Abdul-`Azeez Bin Baz
Fatawa Islamiyah Vol. 8 Page 300