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

'Asim reported - I heard Anas saying:

Never did I ace the Messenger of Allah (ﷺ) so much grieved (at the loss of a) small army as I saw him grieved at those seventy men who were called" reciters" (and were killed) at Bi'r Ma'una; and he invoked curse for full one month upon their murderers.
حَدَّثَنَا ابْنُ أَبِي عُمَرَ، حَدَّثَنَا سُفْيَانُ، عَنْ عَاصِمٍ، قَالَ سَمِعْتُ أَنَسًا، يَقُولُ مَا رَأَيْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم وَجَدَ عَلَى سَرِيَّةٍ مَا وَجَدَ عَلَى السَّبْعِينَ الَّذِينَ أُصِيبُوا يَوْمَ بِئْرِ مَعُونَةَ كَانُوا يُدْعَوْنَ الْقُرَّاءَ فَمَكَثَ شَهْرًا يَدْعُو عَلَى قَتَلَتِهِمْ ‏.‏
Reference : Sahih Muslim 677f
In-book reference : Book 5, Hadith 383
USC-MSA web (English) reference : Book 4, Hadith 1438
  (deprecated numbering scheme)