Captain Jack Harkness: Captain Jack Harkness, note the stripes.
Captain John Hart: Captain John Hart, note the sarcasm.
Captain Jack Harkness: Hey, I worked my way up through the ranks.
Captain John Hart: I bet the ranks were very grateful.
Captain Jack Harkness: Under normal circumstances, an exuberant Roman soldier would be my idea of a perfect morning.
Answer: He might have requisitioned or stolen it from Torchwood London, or he might have been ready down below once it'd been severed, searching for "the right Doctor" and not knowing that the newly-regenerated Doctor was the one he was looking for.
Captain Defenestrator