Hadithcore
Al-Adab Al-Mufrad, 597
sahih· Al-Albani

Abu Mas'ud 'Uqba reported that the Prophet, (ﷺ), said, "Part of what people have learned from the words of prophethood is the statement:

'If you do not feel ashamed, do whatever you like."

حَدَّثَنَا أَحْمَدُ بْنُ يُونُسَ، قَالَ‏:‏ حَدَّثَنَا زُهَيْرٌ، قَالَ‏:‏ حَدَّثَنَا مَنْصُورٌ، عَنْ رِبْعِيِّ بْنِ حِرَاشٍ، قَالَ‏:‏ حَدَّثَنَا أَبُو مَسْعُودٍ عُقْبَةُ قَالَ‏:‏ قَالَ النَّبِيُّ صلى الله عليه وسلم‏:‏ إِنَّ مِمَّا أَدْرَكَ النَّاسَ مِنْ كَلاَمِ النُّبُوَّةِ‏:‏ إِذَا لَمْ تَسْتَحِ فَاصْنَعْ مَا شِئْتَ‏.‏

References2 variants
In-Book Reference
Book 30, Hadith 60
English Reference
Book 30, Hadith 597