Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:647Abū Ṭāhir al-Faqīh > Abū Bakr Muḥammad b. al-Ḥusayn al-Qaṭṭān > ʿAlī b. al-Ḥasan > ʿAbdullāh b. Yazīd al-Muqriʾ > Hammām > Muḥammad b. Jābir > Shaykh Lanā from Ahl al-Yamāmah Yuqāl Lah Qays b. Ṭalq from his father

[Machine] He asked the Prophet ﷺ or heard a man asking him. He said, "While I was praying, I scratched my thigh and my finger touched my private part." The Prophet ﷺ said, "It is only a part of you and what is apparent is the condition of the one who scratches his thigh, and his hand touched his private part that only the back of his hand would be affected. And Allah knows best."  

البيهقي:٦٤٧فَفِيمَا أَخْبَرَنَا أَبُو طَاهِرٍ الْفَقِيهُ أنا أَبُو بَكْرٍ مُحَمَّدُ بْنُ الْحُسَيْنِ الْقَطَّانُ ثنا عَلِيُّ بْنُ الْحَسَنٍ نا عَبْدُ اللهِ بْنُ يَزِيدَ الْمُقْرِئُ ثنا هَمَّامٌ ثنا مُحَمَّدُ بْنُ جَابِرٍ قَالَ حَدَّثَنِي شَيْخٌ لَنَا مِنْ أَهْلِ الْيَمَامَةِ يُقَالُ لَهُ قَيْسُ بْنُ طَلْقٍ عَنْ أَبِيهِ

أَنَّهُ سَأَلَ النَّبِيَّ ﷺ أَوْ سَمِعَ رَجُلًا يَسْأَلُهُ فَقَالَ بَيْنَمَا أَنَا أُصَلِّي فَذَهَبْتُ أَحُكُّ فَخِذِي فَأَصَابَتْ يَدِي ذَكَرِي فَقَالَ النَّبِيُّ ﷺ إِنَّمَا هُوَ مِنْكَ وَالظَّاهِرُ مِنْ حَالِ مَنْ يَحُكُّ فَخِذَهُ وَأَصَابَتْ يَدُهُ ذَكَرَهُ أَنَّهُ إِنَّمَا يُصِيبُهُ بِظَهْرِ كَفِّهِ وَاللهُ أَعْلَمُ