Working on a project where I have to determine the source TCP port used for an executable program (Meaning, when the program is running, what TCP port would it use to connect to the remote location).
Now because it's only a project, it isn't a real program. When you run the program you just pops open a cmd prompt window and closes it, almost instantly. I've tried running the program and quickly running Nmap to see what I could see, but the program shuts down too quickly.
I'm only an amateur so I know I am missing something. Would the source code somehow list which TCP port it will use to make the connection? I already know it will connect to port 8080. Or is there a program that logs network/port activity?
I've tried to use PID with command prompt as well to help track the program, but each time it runs, it comes up as a new PID (obviously).