كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
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 e

Asim reported:

I asked Anas whether Qunut was observed (by the Holy prophet) before ruku' or after ruku'. He replied: Before ruku'. I said: People conceive that the Messenger of Allah (ﷺ) observed Qunut after the ruku'. He said: The Messenger of Allah (ﷺ) observed Qunut (after the ruku' as the people conceive it) for a mouth invoking curse upon those persons who had killed men among his Companions who were called the reciter (of the Qur'an).
وَحَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَأَبُو كُرَيْبٍ قَالاَ حَدَّثَنَا أَبُو مُعَاوِيَةَ، عَنْ عَاصِمٍ، عَنْ أَنَسٍ، قَالَ سَأَلْتُهُ عَنِ الْقُنُوتِ، قَبْلَ الرُّكُوعِ أَوْ بَعْدَ الرُّكُوعِ فَقَالَ قَبْلَ الرُّكُوعِ ‏.‏ قَالَ قُلْتُ فَإِنَّ نَاسًا يَزْعُمُونَ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَنَتَ بَعْدَ الرُّكُوعِ ‏.‏ فَقَالَ إِنَّمَا قَنَتَ رَسُولُ اللَّهِ صلى الله عليه وسلم شَهْرًا يَدْعُو عَلَى أُنَاسٍ قَتَلُوا أُنَاسًا مِنْ أَصْحَابِهِ يُقَالُ لَهُمُ الْقُرَّاءُ ‏.‏
Reference : Sahih Muslim 677e
In-book reference : Book 5, Hadith 382
USC-MSA web (English) reference : Book 4, Hadith 1437
  (deprecated numbering scheme)