Ali said, "The Messenger of Allah ﷺ taught me words to say in the witr prayer, 'O Allah, guide me among those You have guided, grant me well-being among those You have granted well-being, take me as an ally among those You have taken as allies, bless me in what You have given, and protect me from the evil of what You have decreed. Indeed, You decree and none can decree against You. The one You support is never humiliated, and the one You oppose is never honored. Blessed are You, our Lord, and Exalted.'"
علمني رسول الله ﷺ كلمات أقولهن في الوتر: اللهم اهدني فيمن هديت، وعافني فيمن عافيت، وتولني فيمن توليت، وبارك لي فيما أعطيت، وقني شر ما قضيت، إنك تقضي ولا يقضى عليك، وإنه لا يذل من واليت، ولا يعز من عاديت، تباركت ربنا وتعاليت.
Abu Dawud (1425), Tirmidhi (464), Nasai (1745), and Ibn Majah (1178) all narrated it through the route of Abu Ishaq, from Burayd bin Abu Maryam Saluli, from Abu Hawra, from Hasan bin Ali, who mentioned it.Imam Ahmad (1718) narrated it from Waki, from Yunus bin Abu Ishaq, from Burayd bin Abu Maryam Saluli, with the same wording, "The Messenger of Allah ﷺ taught me words to say in the qunut of Witr," then he mentioned the words in the same manner. Tabarani (2712) and Ibn Nasr in Kitab Witr (62) likewise narrated it through the route of Waki with the same wording. Ibn Khuzayma (1095) graded it sahih and narrated it through this same route.However, Shuba narrated it from Burayd bin Abu Maryam with the same wording, without mentioning qunut or Witr. Ibn Khuzayma (1096) and Ibn Hibban (945, 722) both narrated it through the route of Shuba, from Burayd bin Abu Maryam, from Abu Hawra, who said, "I asked Hasan bin Ali what he remembered from the Messenger of Allah ﷺ," and he said, "He used to teach us this supplication..." then he mentioned it in the same manner as the hadith of Waki.Ibn Khuzayma said, "Shuba has a more precise memory than several narrators such as Yunus bin Abu Ishaq, and it is not known whether Abu Ishaq heard this report from Burayd, or whether he concealed the true source of it (tadlis), unless it is as some of our scholars claim, that what Yunus narrated from those his father Abu Ishaq narrated from is what Yunus himself heard together with his father from those he narrated from. If the report from the Prophet ﷺ were established as authentic, that he commanded qunut in Witr, or performed qunut in Witr, it would not be permissible in my view to go against a report from the Prophet ﷺ, but I do not know it to be established. Zuhri narrated, from Saeed bin Musayab and Abu Salama bin Abdul-Rahman, from Abu Hurairah, that the Prophet ﷺ would not perform qunut except when supplicating for one people against another. So if he wanted to supplicate against a people, or for a people, he would perform qunut when he raised his head from the second rakat of the Fajr prayer." End of quote.Al-Hafiz in al-Talkhis (1/247) supported what Ibn Khuzayma and Ibn Hibban said, that the statement of Abu Ishaq and his son mentioning qunut and Witr was something they alone reported, and that Dulabi narrated it in his Dhurriya Tahira, and Tabarani in al-Kabir, through the route of Hasan bin Ubaydullah, from Burayd bin Abu Maryam, from Abu Hawra, with the same wording, in which it says, "and words he taught me," then he mentioned them. Burayd said, "So I went in to see Muhammad bin Ali in Shib and told him about it, and he said, 'Abu Hawra spoke the truth, they are words we were taught, that we say during qunut.'"Bayhaqi narrated it through several routes, and in one of them, Burayd bin Abu Maryam said, "So I mentioned that to Ibn Hanafiya, and he said, 'It is the supplication that my father used to make in the Fajr prayer.'" End of summary.It has been established from a number of companions that they would not perform qunut in Witr except in the latter half of Ramadan, among them Ali, Ubayy bin Kaab, Ibn Umar, and others. Indeed, Abu Shatha narrated, saying, "I asked Ibn Umar about qunut," and he said, "I have not seen anyone do it." And from Abu Muhazzim, "I accompanied Abu Hurairah for ten years, and I never saw him perform qunut in his Witr."Zafarani said, on the authority of Shafii, "It is more beloved to me that they perform qunut in Witr in the latter half, and that qunut not be performed during the rest of the year, nor in Ramadan except in the latter half." Others narrated, on the authority of Shafii, that the Prophet ﷺ used to perform qunut in the morning prayer.Abu Dawud said, "I said to Ahmad, 'Is qunut in Witr throughout the year?' He said, 'If one wishes.' I said, 'So what do you choose?' He said, 'As for me, I do not perform qunut except in the remaining half, unless I pray behind an imam who performs qunut, in which case I perform qunut along with him.'" See Kitab Witr by Muhammad bin Nasr (pp. 123–124).As for what Nasai (1746) narrated as an addition at the end of the supplication, "And Allah's blessing be upon the Prophet Muhammad," through the route of Ibn Wahb, from Yahya bin Abdullah bin Salim, from Musa bin Uqba, from Abdullah bin Ali, from Hasan bin Ali, who said, "The Messenger of Allah ﷺ taught me these words..." then he mentioned the supplication, adding at the end the blessing upon the Prophet ﷺ, this contains a disconnection, for Abdullah bin Ali, who is the son of Husayn bin Ali, never met Hasan bin Ali bin Abu Talib.As for the blessing upon the Prophet ﷺ at the end of qunut supplications in general, this has been established regarding the leadership of Ubayy bin Kaab, who used to lead the people in prayer during the time of Umar bin Khattab, for after supplicating against the disbelievers and cursing them, "he would then invoke blessings upon the Prophet ﷺ and supplicate for the Muslims with whatever good he could." Narrated by Ibn Khuzayma (1100).