2,244. "Negiah"

Hilchos Issurei Biah 20:20

Pursuant to the previous halacha, let’s say that there were ten kohanim, one of whom went and was anonymously intimate with a woman. In such a case, the son of their union is definitely a kohein but, since he doesn’t know who his father is and can’t trace himself back to him, he’s not treated as a kohein at all. He may not perform the Temple service, eat from the offerings or receive a share of them. However, if he renders himself unclean through corpse impurity or if he marries a divorcee, he is subject to lashes because there’s no doubt to justify acting leniently.

Hilchos Issurei Biah 21:1

If someone is physically intimate with one of the prohibited relations without having intercourse, or if he hugs and kisses them in the manner of sexual desire in order to derive pleasure from it, he is subject to lashes under Biblical law. This is based on Leviticus 18:30 – “not to do any of these abominable practices” – and 18:6 – “do not draw near to uncover nakedness,” meaning that we may not draw near via acts that lead to uncovering nakedness.