This is not really a question, it just looks like one. Or , if you prefer, it is a question which the speaker does not expect anyone to answer.
You cannot even call it a rhetorical question. With a rhetorical question the person asking the question does not expect you to give them an answer, but they do expect you to think about the question and answer it to yourself.
As @Tᴚoɯɐuo said earlier, this is better understood as being an exclamation that the speaker feels that they have done something silly. Or perhaps it is someone who can see the funny side of something which they have done that is mildly embarrassing.
However, I am curious about your question. If you only heard the sentence, how do you know that it did not have a question mark?