Sahih Muslim , Book 41, Hadith 7017 (USC-MSA) ⓘ
Abu Sa'id al-Khudri reported that Allah's Messenger one day gave a detailed account of the Dajjal and in that it was also included: He would come but would not be allowed to enter the mountain passes to Medina. So he will alight at some of the barren tracts near Medina, and a person who would be the best of men or one from amongst the best of men would say to him: I bear testimony to the fact that you are Dajjal about whom Allah's Messenger had informed us. The Dajjal would say: What is your opinion if I kill this (person), then I bring him back to life; even then will you harbour doubt in this matter? They would say: No. He would then kill (the man) and then bring him back to life. When he would bring that person to life, he would say: By Allah, I had no better proof of the fact (that you are a Dajjal) than at the present time (that you are actually so). The Dajjal would then make an attempt to kill him (again) but he would not be able to do that. Abu Ishaq reported that it was said: That person would be Khadir (Allah be pleased with him).
حَدَّثَنِي عَمْرٌو النَّاقِدُ، وَالْحَسَنُ الْحُلْوَانِيُّ، وَعَبْدُ بْنُ حُمَيْدٍ، - وَأَلْفَاظُهُمْ مُتَقَارِبَةٌ وَالسِّيَاقُ لِعَبْدٍ - قَالَ حَدَّثَنِي وَقَالَ الآخَرَانِ، حَدَّثَنَا يَعْقُوبُ، - وَهُوَ ابْنُ إِبْرَاهِيمَ بْنِ سَعْدٍ - حَدَّثَنَا أَبِي، عَنْ صَالِحٍ، عَنِ ابْنِ شِهَابٍ، أَخْبَرَنِي عُبَيْدُ اللَّهِ بْنُ عَبْدِ اللَّهِ بْنِ عُتْبَةَ، أَنَّ أَبَا سَعِيدٍ الْخُدْرِيَّ، قَالَ حَدَّثَنَا رَسُولُ اللَّهِ صلى الله عليه وسلم يَوْمًا حَدِيثًا طَوِيلاً عَنِ الدَّجَّالِ فَكَانَ فِيمَا حَدَّثَنَا قَالَ " يَأْتِي وَهُوَ مُحَرَّمٌ عَلَيْهِ أَنْ يَدْخُلَ نِقَابَ الْمَدِينَةِ فَيَنْتَهِي إِلَى بَعْضِ السِّبَاخِ الَّتِي تَلِي الْمَدِينَةَ فَيَخْرُجُ إِلَيْهِ يَوْمَئِذٍ رَجُلٌ هُوَ خَيْرُ النَّاسِ - أَوْ مِنْ خَيْرِ النَّاسِ - فَيَقُولُ لَهُ أَشْهَدُ أَنَّكَ الدَّجَّالُ الَّذِي حَدَّثَنَا رَسُولُ اللَّهِ صلى الله عليه وسلم حَدِيثَهُ فَيَقُولُ الدَّجَّالُ أَرَأَيْتُمْ إِنْ قَتَلْتُ هَذَا ثُمَّ أَحْيَيْتُهُ أَتَشُكُّونَ فِي الأَمْرِ فَيَقُولُونَ لاَ . قَالَ فَيَقْتُلُهُ ثُمَّ يُحْيِيهِ فَيَقُولُ حِينَ يُحْيِيهِ وَاللَّهِ مَا كُنْتُ فِيكَ قَطُّ أَشَدَّ بَصِيرَةً مِنِّي الآنَ - قَالَ - فَيُرِيدُ الدَّجَّالُ أَنْ يَقْتُلَهُ فَلاَ يُسَلَّطُ عَلَيْهِ " . قَالَ أَبُو إِسْحَاقَ يُقَالُ إِنَّ هَذَا الرَّجُلَ هُوَ الْخَضِرُ عَلَيْهِ السَّلاَمُ .
also referenced under: Book 54, Hadith 138 (In-Book) & Hadith 2938 (Reference)