The Koran never explicitly attributes a miracle to Muhammad. One possible candidate is surah 54. The Koranic reference is elliptical, but when supplemented by the Hadith, it attributes a miracle to Muhammad, to verify his prophetic credentials. Here's one discussion from a standard reference work:
The first two verses of al-Qamar ["The Moon"] are understood by the vast majority of commentators as a reference to a miracle performed by the Prophet. One evening, he was addressing a group of disbelievers and Muslims on the plain of Mina, just outside of Makkah. The disbelievers had been disputing with the Prophet for several days, demanding a miracle as proof of his prophethood, and they began to do so again. The Prophet then raised his hand and pointed to the moon, whereupon it appeared to separate into two halves, one on either side of the nearby Mt. Hira. He then said, "Bear witness!" (IK, T) and the line of separation disappeared. All were left speechless, but his opponents soon discredited it as an illusion produced by sorcery. According to one account, one of the disbelievers said, "Muhammad has merely bewitched us, but he cannot bewitch the entire world. Let us wait for travelers to come from faraway places and hear what reports they bring". Then, when some travelers arrived in Makkah a few days later, they confirmed that they too had witnessed the splitting of the moon (IK). "The Moon," Seyyed Hossein Nasir, ed., The Study Quran: A New Translation and Commentary (HarperOne, 2015), 1299.
1. One obvious problem with this report is that it relies entirely on Muslim sources.
2. But a deeper problem is the scale of the reported miracle. For the phenomenon would be visible to everyone on earth who happened to be facing the moon (assuming clear skies in their neck of the woods). And many of these involve literate civilizations. Add to that the fact that ancient people took a keen interest in celestial portents and prodigies, and you'd expect to have multiple surviving records of this event from geographically diverse localities. So a reported miracle that's cited to verify Muhammad's prophethood actually undercuts his prophethood, given how unlikely it is that a natural wonder of this magnitude would leave no trace in historical records outside the Muslim world.
3. Perhaps a Muslim apologist would counter that if this is a problem for Islam, then there's a parallel problem regarding Joshua's Long Day (Josh 10:12-14), the sundial of Ahaz (Isa 38:8; 2 Kgs 20:9-11; 2 Chron 32:31), and darkness during the crucifixion (Mt 27:45; Mk 15:33).
i) But even if (ex hypothesi) these were problematic for the historicity of Scripture, that doesn't let a Muslim off the hook. That doesn't resolve his own problem.
ii) The miracle attributed to Muhammad (7C AD) is far more recent than the NT example (1C), much less the two OT examples (8C BC & 2nd millennium BC). It's unsurprising that records wouldn't survive for much earlier events.
iii) The crucifixion darkness may simply be darkness over "the land" (i.e. Erez Israel). Indeed, that's practically an idiomatic synonym for Palestine. In that event, it's not on the same scale as the miracle attributed to Muhammad.
It might be caused by swarms of locusts covering the sun. That would be a suitable omen of divine judgment.
iv) Commentators often compare the crucifixion darkness to the Ninth Plague (Exod 10:21-23). That, however, was a local rather than global spectacle. Moreover, Goshen was exempted–which, again, stresses the local nature of the miracle. So it's not on the same scale as the miracle attributed to Muhammad. And if that's truly analogous to the crucifixion darkness, then that's another argument for the local nature of the phenomenon.
v) The sundial of Azaz was evidently a local miracle, confined to the land of Judah (2 Chron 32:31). Had it been a global phenomenon, Babylonian emissaries wouldn't travel to Judah to enquire about the sign. Rather, they were following up on a report–given Babylonian interest in astronomical portents and prodigies.
The accounts don't describe anything happening directly to the sun. Rather, they describe the counterclockwise effect of the shadow. Perhaps a preternatural or supernatural optical illusion.
vi) Regarding Joshua's Long Day, it's hard to pinpoint the nature of the phenomenon because we lack a direct description of the event. The passage is poetic, and filtered through a secondary source, which makes it hard to identify the "mechanics" behind the miracle. But in context, the miracle involves prolonging daylight to give the Israelites extra time to defeat the enemy, so, at a minimum, a preternatural or supernatural optical effect is in view.