Shadow was moving slowly through the dimly lit parts of the castle. After spending more than 30 minutes watching the soldiers and captains from a distance he was able to figure out that captains were not allowed in the castle either. He used his daggers to swiftly climb the wall surrounding the castle as he then slowly made his way inside.
He wanted to find a guard inside to kill and impersonate but he gave up on that quite quickly as he saw the guards never leaving their posts. It would be too weird if one was suddenly walking everywhere in the castle, not to mention that the disappearance of one of them would make everyone alarmed as they all switched around every 30 minutes or so. That was probably something they came up with to prevent something like Shadow killing the guards off slowly while impersonating them. He had to agree that the tactic was quite good.