I don't use a lot of square nuts, but they are common in 10-24 & 12-24 (and larger hardware on older equipment). I recently used some 10-24 hanger bolts to install a water filter for my humidifier and used a hex nut jammed over a square nut to screw the hanger portion into the joist:
View attachment 427181
The square nut allows you to use some pressure with a 3/8" nut driver, then you break apart the nuts, back them both off and install whatever with just the hex nut.
Over the weekend, I decided to change the setup, so I needed to remove the hanger bolts – fortunately, a 3/8" 8-point sock slips over a 3/8" hex nut to engage in the square nut, so now I can back the hanger bolts out easily.