Shock-like magnetic field structures above weakly magnetized bodies such as the Moon have been reported for more than half a century and represent a key long-standing feature of their solar-wind interactions. Yet their physical origin has remained without a satisfactory explanation, particularly regarding their steepened profiles and high-altitude extension. Here we show that a long-overlooked nonlinear branch of the Kelvin–Helmholtz instability (KHI) naturally produces these localized external magnetic enhancements. Using magnetohydrodynamic simulations constrained by Lunar Prospector (LP) observations, we demonstrate that velocity shear at the solar-wind–crustal-anomaly interface can trigger a KHI whose nonlinear evolution generates outwardpropagating fast-mode shocks that are distinct from the familiar vortex-type KHI waves. These KHI-driven shocks reproduce the LP-observed amplitude and morphology of lunar magnetic enhancements extending hundreds of kilometers above the surface. Two distinct nonlinear KHI regimes, one shock-dominated and one vortex-dominated, together provide a unified framework that explains both the morphological diversity and the wide range of amplitudes of localized magnetic enhancements observed above the Moon and can be applied to other weakly magnetized bodies, revealing a previously unrecognized mechanism governing solar-wind interactions with crustal magnetic anomalies across the solar system.