كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
5  
The Book of Mosques and Places of Prayer
(54)
Chapter: It is recommended to say qunut in all prayers if a calamity befalls the Muslims – and refuge is sought from Allah (regarding that). It is recommended to say qunut in Subh at all times. And the clarification that it is to be said after raising the head from bowing in the final rak`ah, and it is recommended to say it out loud
(54)
باب اسْتِحْبَابِ الْقُنُوتِ فِي جَمِيعِ الصَّلاَةِ إِذَا نزَلَتْ بِالْمُسْلِمِينَ نَازِلَةٌ ‏‏
Sahih Muslim 677 h

Anas b. Malik reported that the Messenger of Allah (ﷺ) observed Qunut for one month Invoking curse upon Ri'l, Dhakwan, 'Usayya. those who disobeyed Allah and His Messenger (ﷺ).

وَحَدَّثَنَا عَمْرٌو النَّاقِدُ، حَدَّثَنَا الأَسْوَدُ بْنُ عَامِرٍ، أَخْبَرَنَا شُعْبَةُ، عَنْ قَتَادَةَ، عَنْ أَنَسِ بْنِ مَالِكٍ، أَنَّ النَّبِيَّ صلى الله عليه وسلم قَنَتَ شَهْرًا يَلْعَنُ رِعْلاً وَذَكْوَانَ وَعُصَيَّةَ عَصَوُا اللَّهَ وَرَسُولَهُ ‏.‏
Reference : Sahih Muslim 677h
In-book reference : Book 5, Hadith 385
USC-MSA web (English) reference : Book 4, Hadith 1440
  (deprecated numbering scheme)