According to NASA's Apollo missions records, all astronauts who performed moonwalk (or EVA-extravehicular activity) stated that they smelled a hint of spent gunpowder smell off their boots, gloves, and instrument surface, which were covered by moondust, after returning to their lunar lander.
Gunpowder, unlike the modern-day explosives, is usually a combination of sulfur, charcoal, and potassium nitrate. Sometimes, nitroglycerin is also a part of the mixture, which adds to the explosive power. The chemical makeup of the moon is nowhere close to the gunpowder mix, but how did the astronauts catch the smell?
The ACS Reactions program interviewed a few experts about this mysterious odor. The most plausible explanation is that the dust is rich in either carbon-based molecules, free radicals, or certain ions. When reacting with the lander's air, the resulted product tricked the human sensory neurons and produced the gunpowder smell.
While there is no conclusive answer to the mystery, but astronomers and astronauts alike are excited NASA's plan of going back to the moon, which can help resolve this once for all.
Source: ACS Reactions via Youtube