The question was, the Rambam says that miracles can be done through unholy means, and so the Jews did not follow Moshe because of the miracles that he did. They only followed him because they witnessed Kabbalas HaTorah with their own eyes. But the question is, maybe Kabbalas HaTorah was an illusion created using unholy means?
The answer, in short, is that the Satan only makes miracles to bring people down, but if the miracle is going to contradict the Satan's own interests, he would not allow such miracles. If the miracle does not support the Satan, and especially if it opposes his interests, the miracle does not come from him. Kabbalas HaTorah that commanded exclusive belief in Hashem, prohibiting idol worship, Kishef, and the like, is certainly not something the Satan would allow. So it could not have been done by him. See the .pdf for details.
Many people do not realize that the Satan only makes miracles when it serves his interests. This integral rule is often omitted when people teach the idea of miracles from the Sitra Achra. Because of that, they make mistakes. For example:
Rabbi Dr. Chaim Zimmerman put forth what he claimed was an "irrefutable proof" ("ראיה ברורה שאין עליה תשובה") that there is no such thing as miracles from the Satan. But it is easily refutable when one knows of this principle. You can see it in "Torah L'Yisrael," p. 32 in the Hebrew section, and p.58 in the English section.
The Yerushalmi says that the generation of Dovid HaMelech, though righteous, was not granted miracles due to the internal bickering and jealousy among the Jews. Because of those aveiros, when they went into battle, they were defeated. However, the generation of Achav would be victorious in battle, even though they were idol worshipers, because there was no Machlokes between them. Rav Meir Simcha explains, that when the Tzibur violates the Mitzvos (as in the case of bickering and jealousy) even if the individuals are righteous on their own, then Hashem's protection of the Tzibur was removed, and they fell in battle.
Asks Rabbi Dr. Zimmerman: How did the Yerushalmi prove that in the days of Achav they witnessed miracles because there was no internal strife, perhaps the miracles were done through the Satan? "Thus," he says, "We see clearly that the Yerushalmi did not subscribe to such ideas."
The answer, however, is, that the Yerushalmi knew that the Jews' victories in battle were not miracles of the Satan, because the Satan only does miracles that result in the furtherance of his interests. In the case of Achav's generation, that did not happen. It says nowhere that the Jews used their victories to "prove" the power of their idols. Of course, different Jewish sects worshiped different idols so it would have been difficult to attribute the collective victories to any individual idol's power. But in any case, we do not find that the Jews reacted in that way. On the contrary - if the Jews attributed their victories to their fulfilling the Mitzvos of Bais Adam LeChaveiro, as the Yerushalmi did, the Satan would never allow them to win if he could help it.
But in any case, we have no reason to believe the Jews attributed the victories to their idols. And so the Satan was not the source of the victories.