A shot in the dark
A hopeful attempt.
The term 'shot' has been slang for an attempt since the middle of the 19th century; for example, this piece from Joseph Hewlett's comic work Peter Priggins, the college scout, 1841:
"After waiting for a little while, Ninny... made a shot, and went so near the mark."
'A shot in the dark' is simply a hopeful attempt to hit an enemy that you can't see.
George Bernard Shaw seems to have been the first to use it metaphorically, in The Saturday Review, February 1895:
"1 Never did man make a worse shot in the dark."