Narrated Ibn ‘Umar reported God's messenger as saying, “Islam is based on five things:
the testimony that there is no god but God and that Muhammad is His servant and messenger, the observance of the prayer, the payment of zakat, the Pilgrimage, and the fast during Ramadan.”
Narrated Abu Huraira transmitted it with a difference containing the following:
When you see the barefooted, the naked, the deaf, the dumb as kings of the earth, as -well as five things which no one but God knows. Then he recited, ‘‘God has knowledge of the Hour, and He sends down the rain…”
Abu Huraira reported God’s messenger as saying, “Faith has over seventy branches, the most excellent of which is the declaration that there is no god but God, and the humblest of which is the removal of what is injurious from the road. And modesty is a branch of faith.”
One day when we were with God's messenger, a man with very white clothing and very black hair came up to us. No mark of travel was visible on him, and none of us recognised him. Sitting down beside the Prophet, leaning his knees against his, and placing his hands on his thighs, he said, “Tell me, Muhammad, about Islam." He replied, “Islam means that you should testify that there is no god but God and that Muhammad is God’s messenger, that you should observe the prayer, pay the zakat, fast during Ramadan, and make the pilgrimage to the House if you have the means to go." He said, “You have spoken the truth." We were surprised at his questioning him and then declaring that he spoke the truth. He said, “Now tell me about faith.” He replied, “It means that you should believe in God, His angels, His books, His apostles, and the last day, and that you should believe in the decreeing both of good and evil." Remarking that he had spoken the truth, he then said, “Now tell me about doing good." He replied, “It means that you should worship God as though you saw Him, for He sees you though you do not see Him." He said, “Now tell me about the Hour." He replied, “The one who is asked about it is no better informed than the one who is asking." He said, “Then tell me about its signs." He replied, “That a maid-servant should beget her mistress, and that you should see barefooted, naked, poor men and shepherds exalting themselves in buildings." said to me, “Do you know who the questioner was, ‘Umar?" I replied, “God and His messenger know best." He said, “He was Gabriel who came to you to teach you your religion."