The main stages of hacking are:
Reconnaissance – Gathering information about the target through open source research, social engineering, WHOIS lookups, DNS interrogation etc.
Scanning – Scanning the target's systems and network to map out vulnerabilities, open ports, IPs, OS versions etc.
Gaining access – Attempting to gain unauthorized access by exploiting known vulnerabilities found through scanning.
Maintaining access – Installing backdoors, rootkits and other persistent access methods if initial access is gained.
Covering tracks – Hiding evidence of hacking activities through log deletion, rootkit installation etc.
Analysis – Harvesting data gleaned during access for passwords, sensitive documents, emails etc.