If the victim and attacker are on the same LAN and on a switch based network, a hacker can place himself between the client and the server, or he could act as a default gateway and hence capturing all the traffic in between.
How To Protect Yourself
- Use VPN Services
- Use Proxy server to access the internet
- Use an antivirus that provides best firewall options