Hackers use various techniques to gain unauthorized access to computer systems and networks. Untargeted hackers perform reconnaissance like ping sweeps and stealth scans to find vulnerable systems. Targeted hackers research their target through activities like address and phone number reconnaissance, vulnerability scanning, and social engineering. Both use compromised systems and rootkits to maintain backdoor access. Common attack methods include exploiting vulnerabilities, buffer overflows, and social engineering tricks.