Hmmm. Where I live now, my friends frequently visit any time from 9am-2am, and many of them are the kind of people who would keep knocking like that. Especially if they're drunk. Also, I would suspect that it's my roommate because it's weird for her to be out at 2am. I would ask who it is, and if the person refuses to respond I would lock the door (which is usually unlocked) and tell them that I am not going to let them in until I know who they are. If the person continues to knock, I call the police.
If this is at my parents' house, however, that's a different story. The house is in the middle of nowhere; the only time we've had visitors in the middle of the night was when my uncle was badly injured and our phone line was down, so a police officer had to come and tell us what had happened. I would be more worried that it's a murderer if I'm in that house, and I would be especially worried because there are more doors and windows. Even if the person leaves the doorway, I have no idea whether he/she is sneaking around the back. And there's one window that I could see the person through at that angle, but it's right next to the door, so he/she would definitely see me looking at him/her. And I can't even sneak around and grab a gun, because I would have to go right past the door and the person would see me. I would probably... augh, I have no idea. That sounds terrifying. I guess I would call my parents and ask for advice.
If this is at my parents' house, however, that's a different story. The house is in the middle of nowhere; the only time we've had visitors in the middle of the night was when my uncle was badly injured and our phone line was down, so a police officer had to come and tell us what had happened. I would be more worried that it's a murderer if I'm in that house, and I would be especially worried because there are more doors and windows. Even if the person leaves the doorway, I have no idea whether he/she is sneaking around the back. And there's one window that I could see the person through at that angle, but it's right next to the door, so he/she would definitely see me looking at him/her. And I can't even sneak around and grab a gun, because I would have to go right past the door and the person would see me. I would probably... augh, I have no idea. That sounds terrifying. I guess I would call my parents and ask for advice.