The Messenger of Allah ﷺ said, "Whoever wakes during the night and says, 'There is no god but Allah alone, with no partner. To Him belongs the dominion and to Him belongs all praise, and He is capable of all things. Glory be to Allah, praise be to Allah, Allah is the greatest, and there is no power nor strength except through Allah,' then says, 'My Lord, forgive me,' or makes a supplication, it will be answered. And if he resolves to do so and performs ablution and then prays, his prayer will be accepted."
حدثنا الوليد بن مسلم حدثنا الأوزاعي حدثني عمير بن هانئ العنسي حدثني جنادة بن أبي أمية قال حدثني
عن رسول الله ﷺ قال من تعار من الليل فقال لا إله إلا الله وحده لا شريك له له الملك وله الحمد وهو على كل شيء قدير سبحان الله والحمد لله والله أكبر ولا حول ولا قوة إلا بالله ثم قال رب اغفر لي أو قال ثم دعاه استجيب له فإن عزم فتوضأ ثم صلى تقبلت صلاته
Its isnad is sahih. Umayr bin Hani Ansi Darani is trustworthy, and his hadith is found among the group of hadith compilers. As for Junada bin Abu Umaya, there is disagreement about whether he was a companion, and those who deny his companionship say he is among the trustworthy successors, and his hadith is likewise found among the group.The hadith was narrated by Bukhari, 2/68, in the chapters section on prayer, on the merit of one who wakes during the night and prays. Abu Dawud, 4/314, no. 5060, in the chapter on manners. Tirmidhi, 5/480, no. 3414, in the chapter on supplications, where he said it is hasan sahih gharib. And Ibn Majah, 2/1276, no. 3878, likewise.