I heard hackers' top ports to hack computers through are port 80 and port 443. How do they do this though aren't port 80 and port 443 just for HTTP requests such as GET, POST?
Any open port can be used as an attack vector by a hacker to get into the system. Port 80 and port 443 just happen to be the most common ports open on the servers. Now there are two different ways to get into the system through port 80/443:
- Exploiting network behavior.
- Exploiting application behavior. (If any application is listening over port 80/443)
Former includes vulnerabilities in the system stack (platform) itself that is responsible for accepting data through the port and passing it to the application.
Latter includes vulnerabilities in the application, i.e., when the data has already reached application through platform.
Most common attacks exploit vulnerability in website running on port 80/443 to get into system, HTTP protocol itself or HTTP application (apache, nginx etc.) vulnerability.
80 HTTP, 443 HTTPs, they are used by web servers.
Can you hack something through port 80/443? It depends on the specific service that runs on those ports (which specific web server, i.e. nginx), and on the content which is provided by the web server. Usually it's latter which is vulnerable (sql injection, IDOR, look at OWASP top 10), even though also the web server can be configured wrongly.