a web shell is usually installed by taking advantage of vulnerabilities present in the web server's software. that is why removal of these vulnerabilities are important to avoid the potential risk of a compromised web server.