Obviously, if the job were to be repated many times, it would be worth investing a socket to drive square nuts.
Buyt for a one off this might work!
Take a piece of suitably sized hexagon bar, for which you have a socket and mill i 8 mm wide slot across the end.
Drive the hexagon with a normal socket, and hopefully, you will succeed
Although if the 8 mm square is intended to fit into the slot of the mating piece, the fixing has to driven from the top
Howatd