The micro-nano rough structure promotes the formation of superhydrophobic surfaces, while the formation of superoleophobic surfaces requires the support of re-entrant structures. Electrochemical etching and boiling water treatment methods were used to process the superoleophobic surface in the Al–Mg alloy substrate. The differences between the potential of the aluminum and the magnesium promoted the formation of the surface microstructure under the current stimulation, and the surface was formed into dense nanoscale needle-like coating after boiling water treatment. Scanning electron microscopy, energy dispersive spectroscopy, and contact angle measurement were performed to characterize the morphological features, chemical composition, and surface wettability, respectively. The so-prepared superoleophobic surfaces showed high contact angles and small sliding angles for water, ethylene glycol, and hexadecane. In addition, surface topography, reaction mechanism, and experimental parameters were also studied.