When the Messenger of Allah ﷺ wanted to invoke against someone or to supplicate for someone, he would recite the qunut after bowing. Sometimes, when he said, "Allah hears whoever praises Him," he would say, "Our Lord, to You belongs all praise. Allah, deliver Walid bin Walid, Salama bin Hisham, and Ayyash bin Abu Rabia. Allah, tighten Your grip on Mudar, and make it for them years like the years of Yusuf." He would say this aloud.In some of his prayers during the dawn prayer, he would say, "Allah, curse so-and-so and so-and-so," referring to certain Arab tribes, until Allah revealed "Not for you is the decision of the matter at all" [Al Imran 3:128].
أن رسول الله ﷺ كان إذا أراد أن يدعو على أحد، أو يدعو لأحد، قنت بعد الركوع، فربما قال إذا قال: سمع الله لمن حمده: اللهم ربنا لك الحمد، اللهم أنج الوليد بن الوليد، وسلمة بن هشام، وعياش بن أبي ربيعة، اللهم اشدد وطأتك على مضر، واجعلها سنين كسني يوسف يجهر بذلك، وكان يقول في بعض صلاته في صلاة الفجر: اللهم العن فلانا وفلانا لأحياء من العرب حتى أنزل الله: {ليس لك من الأمر شيء}.
Bukhari narrated it in the tafsir (4560) and Muslim in the mosques (675), both through Ibn Shihab Zuhri, who said, Saeed bin Musayab and Abu Salama bin Abdul-Rahman bin Awf told me that they both heard Abu Hurairah say what has already been mentioned, and the wording here is Bukhari's.