In my opinion, Shazam (albeit momentarily) beat Spectre. Granted they were in Shazam's place of power, but he still beat Spectre for a brief moment, while in a significantly weakened state--which is more than anyone else can claim. That's a huge feat, imo. Having said that, if Shazam and Nabu were to battle in the RoE, Nabu would probably still win -he's still the most powerful Lord of Order-, but he'd be very hard-pressed to do so, and would likely burn out/die afterward (as he did following his battle with Spectre.)
I agree that it wasn't necessarily prep based on the fact Mordru just weakened him prior to the Spectre arriving. Shazam did have home court advantage though.
Shazam was weak and had to rely on his artifacts before Spectre destroyed him & ROE.
I want to contrast both Nabu & Shazams fights with Spectre in order to get some sort of power gauge but its too much context involved. Like the fact Nabu wanted Spectre to kill him, and Nabu sensing that Spectre had absorbed enough magic to easily stomp him. As well as what everybody else said concerning Shazam.
Shazam, while extremely weakened, did better against Spectre than a full powered Nabu. Yes, Shazam was in the RoE (his place of power) but he still had "barely enough strength left to stand" by the time Spectre arrived--yet he managed to fight him on fairly equal footing. In fact, you could say that Shazam/Spectre's battle had two rounds--and Shazam won round 1, imo.
If Shazam and Nabu battled within the RoE, I have my doubts that Nabu could win. Outside the Rock, Nabu stomps.