Conduct A Web Application Penetration Testing
Tags: webdev, programming, performance, security
Published: 2021-11-08 10:30:35

In this digital age when everything is being done online, web applications have become an integral part of all businesses. Since today’s web applications usually store or send out sensitive data, they attract malicious hackers and script kiddies, at an unprecedented level, to find and exploit vulnerabilities in them for their personal gain or just to have fun.

To secure your web application, security testing is the best way to identify security loopholes and misconfiguration flaws in your application before malicious hackers do. This is achieved by simulating attacks in order to find the potential vulnerabilities in your application.

##Why Is Web Application Penetration Testing Important?

Web application penetration testing a.k.a web app pentesting is essential as it helps in determining the security posture of the entire web application including the database, back-end network, etc. Moreover, it suggests ways to strengthen it. Here is the list of some common objectives for performing web applications penetration testing:

* Identify security loopholes in web applications
* Verify the effectiveness of the existing security policies and controls
* Ensuring compliance such as PCI DSS, HIPAA, etc
* Check configuration and strength of components exposed to the public including firewalls.

##Types of Web Application Penetration Testing

You can either conduct internal or external penetration testing or both depending on the your business requirements.

1) External Penetration Testing

External Pentesting involves simulating attacks on the live website/web application. This kind of penetration testing runs on the Black Box testing methodology. 

During this, the pentester only gets the list of the organization’s IPs and domains, and using just IP & domains the pentester tries to compromise the target just like the real-world behavior of malicious hackers. 

This kind of testing provides a comprehensive view of the effectiveness of your application’s security controls that are publicly exposed since it includes testing servers, firewalls, and IDS.

####2) Internal Pentesting

Sometimes the organization overlooks the need to pentest the web application internally. They feel that no one can attack from inside an organization.  However, this isn’t the case anymore. After the external breach, internal penetration testing is done on a web application to identify and track the lateral movement of the hacker from inside.

Internal Pentesting done for a web app that is hosted on the intranet. Thus, it helps in preventing the attacks due to the exploitation of vulnerabilities existing within the corporate firewall.

##A Simplified Approach to Perform Web Application Pentesting:

There are four ideal phases in which web application pentesting can be performed.

####1) Planning Phase

During the planning phase, a number of important decisions are made that directly impact other phases of penetration testing. It includes defining scope, timeline, and people involved among other things.

Most importantly during defining the scope of the security assessment, there are various things that are considered before going to the next phase of testing. These may include application pages that need to be tested, deciding whether to perform internal or external testing or both, to name a few.

It is also crucial to define the timeline for the whole process. This ensures that the assessment doesn’t drag out and timely security controls can be put into play to strengthen the defense for your application.

####2) Pre-Attack Phase

In this phase, the reconnaissance is done which is important for paving the way for the next phase of testing. Especially, it includes looking for Open Source Intelligence (OSINT), or any other information available publicly that can be used against you.

We can perform port scanning, service identification, vulnerability assessment, etc in this phase of testing. To accomplish this you can use tools such as Nmap, Shodan, Google Dorks, dnsdumpster, etc.

As we all know, due to the growing adoption of social media among the organization’s employees, hackers can easily fool employees and extract or guess passwords they use for their social media, threat actors do this by carrying out social engineering attacks to target those organizations that have weak internal security posture implemented.

####3) Attack Phase

During the attack phase, the pentester tries to exploit the vulnerabilities found in the last phase. They try to go one step further by identifying and mapping the attack vectors. 

In an attack phase, the pentester gets into a web application’s internal structure and try to compromise the host. 

This may involve social engineering attacks, physical security breaching, web application exploits, phishing employees or CXOs of an organization, etc. 

####4) Post-Attack Phase

After the penetration testing is complete, a full detailed report is generated. This report can vary from organization to organization or type of application that is pen-tested. 

But generally, the penetration testing report includes a list of vulnerabilities, an analysis of the finding, proposed remediations, and a conclusion. Apart from that, the pentester is also responsible for restoring the systems and network configurations to their original states in the post-attack phase. 

![Conduct A Web Application Penetration Testing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2qy6n107daipxo4vo42z.png)