Al-Adab Al-Mufrad, Book 30, Hadith 60 (In-Book)

Abu Mas'ud 'Uqba reported that the Prophet, may Allah bless him and grant him peace, 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."

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

sunnah.com