Businesses have learnt the hard way that vulnerabilities & loopholes can cost them money and more. Stats show that as many as 99.7% of businesses have at least one undiscovered vulnerability. These security issues are nothing but a ticking bomb waiting to blow off. Ignorance is not bliss when it comes to cybersecurity. You have to identify and patch these security loopholes at the earliest to protect your website.
Some common vulnerabilities such as SQL injection, Cross-site scripting (XSS), Cross-site Request Forgery (CSRF) can easily be exploited by cybercriminals, through which they can steal sensitive data present in your website or even get a complete control over your website. To avoid this, it is always good to take preventative measures such as doing a penetration testing for your website in order to identify and fix vulnerabilities yourself before cybercriminals take advantage of it.
So, let’s talk more on Website Penetration Testing sometimes referred as website security audit.
What is Website Penetration Testing or Pentesting?
Penetration Testing is a simulated hacker-style attack on an application aimed at gauging the gravity of the existing vulnerabilities. This is to say, Penetration Testing focuses more on how each of these vulnerabilities could be exploited as opposed to Vulnerability Assessment, which merely identifies and lists all existing vulnerabilities in your website.
For example, consider a thief tries to enter your house to rob you and you want to take security measures so that the thief won’t be able to enter your house. Here, vulnerability assessment is similar to making sure you have all your house windows and doors closed. And penetration testing is similar to checking the strength or any weaknesses of your windows or doors. So that even if a thief tries to enter they will not find any entry points to enter your house and you can have a peaceful sleep.
Basically, vulnerability assessment is an initial step in the whole process. Whereas, penetration testing uses the findings (the list of vulnerabilities) and exploits them to work out the degree of risk attached to it. Vulnerability assessment can use both automated & manual ways. Whereas, penetration testing is generally a manual process done by experienced security engineers.
While both Vulnerability Assessment & Penetration Testing concerns the same area, they are not quite the same. And have been wrongly used interchangeably in the past. This confusion has led to web owners asking for Vulnerability Assessment when they really need Penetration Testing and vice versa.
Now, I am sure, you can depict the difference between the above two.
Further in this article we will go deeper into penetration testing and take a closer look into the complete methodology involved in VAPT (tools + checklist).
Why Do You Need Pentesting Testing?
It is crucial to identify your site’s security loopholes so that you are never caught off guard. VAPT lets you anticipate possible mishaps that could take place. This invariably contributes to better risk management for your website.
I have seen website owners often ask things like, “Mine is just a small website, do I need a Vulnerability Assessment & Penetration Testing?“.
The answer is yes. Research has it that nearly 60% of cyberattacks target small businesses. So, there’s a good chance of your website being targeted, if left untended to.
In a nutshell, website penetration testing can help you in the following ways:
- To identify and fix security flaws in your website.
- It gives you a holistic view of misconfigured integrations implemented within a site.
- Penetration testing emulates real-life attack scenarios and helps in mitigating risks.
- It can help you in achieve certain compliance requirements such as GDPR, ISO 27001, PCI-DSS, HIPAA and more.
- It enables you to uncover potential vulnerabilities in your site.
- It can save your from legal consequences and hefty penalties under data security policies.
- It helps in preparing your security team to cope up with a real-life cyber attack.
Methodology for Website Penetration Testing (Tools Included)
Website penetration testing is done primarily in 3 phases:
- Information Gathering: In information gathering, the pentester tries to find fingerprints in the backend of the website. It usually includes Server OS, CMS version, etc.
- Discovery: The second step is where automatic tools are deployed to uncover any known security flaws or CVEs in the respective services. Here, a manual security scan by engineers is also required in order to discover business logic vulnerabilities because these kind of flaws are often missed by the scan made with automated tools.
- Exploitation: In the final step of exploitation, the goal is to leverage any vulnerabilities discovered in the second phase. This is often done manually to weed out false positives. The exploitation part is also used to exfiltrate information from the target and to maintain persistence.
Here is the Astra’s Penetration testing pricing for you.
1. Information Gathering
The first phase is information gathering in which, the pentester tries to find fingerprint the backend services of the website i.e. Server OS, CMS version, etc.
Here are a list tools you can use to use in information gathering phase:
Network Mapper a.k.a. NMAP
Nmap has been the absolute favorite recon tool of website pentester for a long time and there is a solid reason for that. The abilities of Nmap are:
- It can discover ppen ports on the server.
- Fingerprinting the server OS.
- Bypassing the firewall to scan the target stealthily.
- Uncovering services running on those ports.
- It’s NSE scripts can automate tasks including certain vulnerabilities detection.
Related blog – Penetration testing Company
To see more options, fire your Kali and in the command line terminal and type ‘nmap‘. Also, users can try Zenmap which is the GUI version of Nmap.
While tools like NMAP does a black box information gathering, there are certain tools like The Harvester which collect Open Source Intelligence (OSINT). OSINT is the information present in the public domain regarding your target i.e. Whois registration info, company emails, etc. This info comes in handy while website penetration testing. It is spread out on sites like Google, Whois, etc. So, the harvester compiles it from all sources and gives you a one-stop solution.
The second step is Discovery in which automatic tools are deployed to uncover any known flaws or known CVEs in the respective services.
Nikto is a tool specifically designed to scan vulnerabilities in around 270 types of servers. It can extensively search for 6700 server misconfiguration.
However, the limitation of Nikto is that it is very noisy and can often generate false positives. Moreover, the firewall evasion techniques of Nikto are very poor. However, when combined with another Inundator (to evade IDS) of Kali, it can be effective.
Therefore, before using Nikto for website penetration testing, make sure to turn off your firewall or IDS for better results.
To scan a target using Nikto, simply open the terminal in Kali and type:
nikto -h 'your-target‘
Burp Suite is a website pentesting framework built on java. It has a built-in proxy that intercepts traffic between your browser and the website pentesting target. This proxy can be then used to manipulate requests or for fuzzing to discover vulnerabilities in a website.
While manipulation of requests can help in finding vulnerabilities, fuzzing can uncover error messages and application behavior too. This tool has become almost an industry standard and is a must-have for website penetration testing.
Related blog – Web Application Security Testing
OpenVAS is a vulnerability scanner that can perform a complete vulnerability scan of the network infrastructure. It can be easily scaled as per your needs and can perform a wide variety of tests. This tool is owned by Greenbone and the paid solution is called Greenbone Security feed while the free one is called Greenbone Community feed. The prime difference between both the editions is the NVTs (Network Vulnerability Scanner test).
Metasploit framework is almost an industry standard when it comes to exploitation of the target. Metasploit can also perform recon using Nmap. If you find any vulnerabilities, there are a plethora of exploits to choose from. Finally, pair your exploit with a suitable payload and you are good to go. Metasploit even has a great choice of post-exploitation tools. Metasploit is owned by Rapid 7 and is written in ruby. Almost all proof of concepts of popular zero-day flaws is updated as Metasploit modules.
To launch Metasploit, open the terminal in your Kali Linux and type:
Sqlmap is a one-stop solution to find any SQL injection vulnerabilities on your website and to exploit them. Sqlmap can fuzz the target parameters in the URL and even data fields on the page to find any SQL injection points. Sqlmap can thereafter exploit them to provide you a pseudo SQL shell or cmd shell from the target machine.
To see more options, open the terminal in your Kali and type:
Xsser is a small and lightweight tool to find and exploit XSS bugs during website penetration testing. XSS bugs are fairly common and there is a lot you can uncover with this small tool.
To run the GUI version, open the terminal in Kali and type:
How Penetration Testing Can Help You Achieve Compliance?
Today’s e-commerce sites often deal with sensitive user payment information in their daily operations. And to protect this sensitive customer data there should be a standard security practice on every website.
This is ensured by the Payment Card Industry which has almost all organizations dealing with debit and credit cards participated for securing payment data and transactions. Therefore, PCI Data Service Standards (DSS) is a set of 12 security protocols that every business dealing with credit card info has to comply with. These protocols were developed by the PCI security standard council. In case there is a failure to comply with these protocols, PCI may impose a fine or terminate the credit card processing privileges of that particular organization.
These 12 requirements to be PCI-DSS compliant are as follows:
Network and Systems Security
Requirement #1: Install and maintain a WAF to protect the data of cardholders.
Requirement #2: Default and hard-coded passwords provided by the vendor should not be used.
Requirement #3: Protect the data stored of the cardholder from cyber attacks.
Requirement #4: The transmission of cardholder data should be encrypted over open networks.
Regular Vulnerability Management
Requirement #5: Keep the antivirus solution updated and ensure proper mechanism against malware.
Requirement #6: Develop a secure application and maintain secure systems.
Proper Access Control Measures
Requirement #7: Restrict access to cardholder data by implementing role-based access control.
Requirement #8: Identify and authenticate access to system components.
Requirement #9: Set constraints to physical access to cardholder data.
Network Monitoring and Testing
Requirement #10: Regularly monitor all access to network resources and cardholder data
Requirement #11: Run frequent tests on all the security systems and processes.
Information Security Policy
Requirement #12: Implement a policy that covers all personnel for information security.
Website Penetration Testing Checklist
- Port Scanning
- Web Server, CMS Version, and OS fingerprinting.
- HTTP Methods
- Cookie Attributes
- Finding alternative content i.e. directory/files brute force.
- Finding default configurations or misconfigurations.
- Login Fuzzing.
- Testing Session Tokens.
- Injections: SQL, XSS, XML, Template, OS Command.
- Open Redirection.
- LFI & RFI attacks.
- Business Logic Flaws.
- Denial of Service.
- Testing REST and SOAP web services.
- HTTPS strip
- Oracle Padding Attack
- Weak Cryptography or Poor implementation
- Browser hijacking using XSS.
- Data Exfiltration using various injections.
- Authentication Bypass.
- Offline password cracking.
- Cross-Site Request Forgery.
Checkout our complete checklist on Penetration Testing
Final Thoughts on Pentesting
The crux of this article is that website penetration testing is important for everyone operating online, be its small blogs or large corporations. Moreover, there are plenty of tools available freely to conduct website penetration testing.
The three steps of website pentesting (Information gathering, discovery & exploitation) will guide and organize the whole process. So get started today and audit the security of your website.
Related blog – Detailed Sample Penetration Testing Report
However, if you feel that you are new to this field or find this task cumbersome, worry not Astra is always there to help you. Our community of experienced security experts will pentest your website and report any vulnerabilities in a detailed and easy to understand manner. They will also provide you with the fixation steps and even promise to help you or your developer in patching it.
If you wish to get help from experts at Astra, get in touch with us using the chat widget at the bottom right corner of your screen or click here.