كتاب الجهاد والسير
32  
The Book of Jihad and Expeditions
(7)
Chapter: It is recommended to pray for victory when meeting the enemy
(7)
باب اسْتِحْبَابِ الدُّعَاءِ بِالنَّصْرِ عِنْدَ لِقَاءِ الْعَدُوِّ ‏‏
Sahih Muslim 1742 b

It is narrated on the authority of Ibn Abu Aufa that the Messenger of Allah (ﷺ) cursed the tribes (who had marched upon Medina with a combined force in 5 H) and said:

O Allah, Revealer of the Book, swift in (taking) account, put the tribes to rout. O Lord, defeat them and shake them.
حَدَّثَنَا سَعِيدُ بْنُ مَنْصُورٍ، حَدَّثَنَا خَالِدُ بْنُ عَبْدِ اللَّهِ، عَنْ إِسْمَاعِيلَ بْنِ أَبِي خَالِدٍ، عَنْ عَبْدِ اللَّهِ بْنِ أَبِي أَوْفَى، قَالَ دَعَا رَسُولُ اللَّهِ صلى الله عليه وسلم عَلَى الأَحْزَابِ فَقَالَ ‏ "‏ اللَّهُمَّ مُنْزِلَ الْكِتَابِ سَرِيعَ الْحِسَابِ اهْزِمِ الأَحْزَابَ اللَّهُمَّ اهْزِمْهُمْ وَزَلْزِلْهُمْ ‏"‏ ‏.‏
Reference : Sahih Muslim 1742b
In-book reference : Book 32, Hadith 24
USC-MSA web (English) reference : Book 19, Hadith 4315
  (deprecated numbering scheme)