Sunan Ibn Majah #4084
Tribulations 36:159
It was narrated from Thawban that the Messenger of Allah (ﷺ) said:
"Three will fight one another for your treasure, each one ofthem theson of a caliph, but none of them will gain it. Then theblack bannerswill come from the east, and they will kill you in anunprecedentedmanner." Then he mentioned something that I do notremember, then hesaid: "When you see them, then pledge yourallegiance to them even ifyou have to crawl over the snow, for thatis the caliph of Allah,Mahdi."