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

A hadith like this has been transmitted by Khufaf b. Ima' except this that he did not mention (these words):

" cursing of unbelievers got a sanctions.
حَدَّثَنَا يَحْيَى بْنُ أَيُّوبَ، حَدَّثَنَا إِسْمَاعِيلُ، قَالَ وَأَخْبَرَنِيهِ عَبْدُ الرَّحْمَنِ بْنُ حَرْمَلَةَ، عَنْ حَنْظَلَةَ بْنِ عَلِيِّ بْنِ الأَسْقَعِ، عَنْ خُفَافِ بْنِ إِيمَاءٍ، ‏.‏ بِمِثْلِهِ إِلاَّ أَنَّهُ لَمْ يَقُلْ فَجُعِلَتْ لَعْنَةُ الْكَفَرَةِ مِنْ أَجْلِ ذَلِكَ ‏.‏
Reference : Sahih Muslim 679c
In-book reference : Book 5, Hadith 392
USC-MSA web (English) reference : Book 4, Hadith 1447
  (deprecated numbering scheme)