The attack mechanism involved repeatedly querying the facial recognition model and analyzing its confidence scores. By iteratively refining generated inputs based on these scores, attackers could reconstruct approximate facial images that resembled individuals in the training data.