The Messenger of Allah ﷺ said, "Dajjal will come, but he will be forbidden from entering the mountain passes of Madinah, so he will camp at some of the salt flats adjacent to the city. On that day, a man will go out to him, the best of people, or among the best of people, and he will say, 'I bear witness that you are Dajjal, about whom the Messenger of Allah ﷺ told us.'Dajjal will say, 'What do you think? If I kill this man and then bring him back to life, will you have any doubt about the matter?'They will reply, 'No.'So Dajjal will kill him and then bring him back to life. The man will say, 'By Allah, I have never seen through you more clearly than I do today.'Dajjal will then want to kill him, but he will not be given power over him."
أن رسول الله ﷺ قال: يأتي الدجال وهو محرم عليه أن يدخل نقاب المدينة، فينزل بعض السباخ التي تلي المدينة، فيخرج إليه يومئذ رجل وهو خير الناس- أو من خيار الناس- فيقول: أشهد أنك الدجال الذي حدثنا رسول الله ﷺ حديثه، فيقول الدجال: أرأيت إن قتلت هذا ثم أحييته، هل تشكون في الأمر؟ فيقولون: لا؛ فيقتله ثم يحييه؛ فيقول: والله ماكنت فيك أشد بصيرة مني اليوم، فيريد الدجال أن يقتله فلا يسلط عليه.
Bukhari reported it in Sahih Bukhari, in the Book of Rulings (7132), and Muslim reported it in the Book of Tribulations (112:2938), both through the route of Abu Yaman, who said, Shuayb informed us, from Zuhri, who said, Ubaydullah bin Utbah bin Masud informed me, that Abu Saeed said, and then he mentioned it. The wording given is Bukhari's, and Muslim referred back to the hadith preceding it.