It is narrated from Sayyiduna Khuzaymah bin Thabit (may Allah be pleased with him) (Imam al-Shafi'i (may Allah have mercy on him) said: I am the one who was unsure about the name of the narrator from him) that a man asked the Prophet (peace and blessings be upon him) about approaching women in their backsides, or a man approaching his wife in her backside, and the Prophet (peace and blessings be upon him) said: "It is lawful." When the man turned away, he called him back, or ordered that he be called, and said: "What did you ask? In which of the two openings? If from her back into her front, then yes; but from her back into her backside, then no. Indeed Allah is not shy of the truth [Surah al-Ahzab: 53]. Do not approach women in their backsides."
Imam al-Shafi'i (may Allah have mercy on him) said: My uncle is thiqah (trustworthy) and Abdullah bin Ali is thiqah; Muhammad informed me that he spoke well of the Ansari who narrated it; and Khuzaymah is one whose reliability no scholar doubts. So I do not grant any allowance for it; rather, I forbid it.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النكاح / 14112