The pre-hacking phase which does not necessarily require a hacker to directly access the target is called footprinting. Footprinting involves gathering basic facts about the target, such as name and location. These pieces of information are useful when mounting an attack.
These facts are often discovered easily via a simple web search, although some information requires more extensive snooping or so-called social engineering. Social engineering involves tricking a target into giving up private information. Once the information is acquired, whether it was publicly available or not, the hacker goes on to the next stage, which is scanning. Scanning involves probing the target for weak points and does require a direct connection.