Web application security is critical in today’s digital world, and web application penetration testing is a crucial part of ensuring the security of your web applications. This is the process of simulating an attack on a web application to identify vulnerabilities that could be exploited by attackers.
In this article, we will explore the basics of web application penetration testing and the steps involved in conducting a successful test.
1. Planning and reconnaissance
The first stage involves:
- Defining the scope and goals of a test, including the systems to be addressed and the testing methods to be used.
- Gathering intelligence (e.g., network and domain names, mail server) to better understand how a target works and its potential vulnerabilities.
2. Scanning
The next step is to understand how the target application will respond to various intrusion attempts. This is typically done using:
- Static analysis – Inspecting an application’s code to estimate the way it behaves while running. These tools can scan the entirety of the code in a single pass.
- Dynamic analysis – Inspecting an application’s code in a running state. This is a more practical way of scanning, as it provides a real-time view into an application’s performance.
3. Gaining Access
This stage uses web application attacks, such as cross-site scripting, SQL injection and backdoors, to uncover a target’s vulnerabilities. Testers then try and exploit these vulnerabilities, typically by escalating privileges, stealing data, intercepting traffic, etc., to understand the damage they can cause.
4. Maintaining access
The goal of this stage is to see if the vulnerability can be used to achieve a persistent presence in the exploited system— long enough for a bad actor to gain in-depth access. The idea is to imitate advanced persistent threats, which often remain in a system for months in order to steal an organization’s most sensitive data.
5. Analysis
The results of the penetration test are then compiled into a report detailing:
- Specific vulnerabilities that were exploited
- Sensitive data that was accessed
- The amount of time the pen tester was able to remain in the system undetected
This information is analyzed by security personnel to help configure an enterprise’s WAF settings and other application security solutions to patch vulnerabilities and protect against future attacks.
Let’s look a closer look for the resources
#Resources To Learn
Learn How Certain Programming Languages Are Structured
No, you don’t need to be a master in every programming language ever created. You don’t need the skills to single-handedly create the next Google. You do not need to be the tech-equivalent of Michelangelo preparing to 3D print David.
You should, however, have a good sense of how certain programming languages are structured. You should also understand command line.
There are many paid subscription programs out there, like Codecademy, that offer a strong, structured way to learn programming languages. But as I promised, this is a compendium of free and open source resources. Here are a few starting points:
● JavaScript
o Introduction to JavaScript (free from Codecademy)
● SQL
o SQLZoo
● Python
o Note: Python 2 has been deprecated. I recommend you use resources for Python 3.
● Command Line
o A Command Line Primer for Beginners
Phase 1 — History
Phase 2 — Web and Server Technology
- Basic concepts of web applications, how they work and the HTTP protocol
- HTML basics part 1
- HTML basics part 2
- Difference between static and dynamic website
- HTTP protocol Understanding
- Parts of HTTP Request
- Parts of HTTP Response
- Various HTTP Methods
- Understanding URLS
- Intro to REST
- HTTP Request & Response Headers
- What is a cookie
- HTTP Status codes
- HTTP Proxy
- Authentication with HTTP
- HTTP basic and digest authentication
- What is “Server-Side”
- Server and client side with example
- What is a session
- Introduction to UTF-8 and Unicode
- URL encoding
- HTML encoding
- Base64 encoding
- Hex encoding & ASCII
Phase 3 — Setting up the lab with BurpSuite and bWAPP
MANISH AGRAWAL
- Setup lab with bWAPP
- Set up Burp Suite
- Configure Firefox and add certificate
- Mapping and scoping website
- Spidering
- Active and passive scanning
- Scanner options and demo
- Introduction to password security
- Intruder
- Intruder attack types
- Payload settings
- Intruder settings
ÆTHER SECURITY LAB
- №1 Penetration testing tool
- Environment Setup
- General concept
- Proxy module
- Repeater module
- Target and spider module
- Sequencer and scanner module
Phase 4 — Mapping the application and attack surface
- Spidering
- Mapping application using robots.txt
- Discover hidden contents using dirbuster
- Dirbuster in detail
- Discover hidden directories and files with intruder
- Identify application entry points
- Identify application entry points Pt.2
- Identify client and server technology
- Identify server technology using banner grabbing (telnet)
- Identify server technology using http recon
Phase 5 — Understanding and exploiting OWASP top 10 vulnerabilities
IBM
- Injection
- Broken authentication and session management
- Cross-site scripting
- Insecure direct object reference
- Security misconfiguration
- Sensitive data exposure
- Missing functional level access controls
- Cross-site request forgery
- Using components with known vulnerabilities
- Unvalidated redirects and forwards
F5 CENTRAL
- Injection
- Broken authentication and session management
- Insecure deserialisation
- Sensitive data exposure
- Broken access control
- Insufficient logging and monitoring
- XML external entities
- Using components with known vulnerabilities
- Cross-site scripting
- Security misconfiguration
LUKE BRINER
- Injection explained
- Broken authentication and session management
- Cross-site scripting
- Insecure direct object reference
- Security misconfiguration
- Sensitive data exposure
- Missing functional level access control
- Cross-site request forgery
- Components with known vulnerabilities
- Unvalidated redirects and forwards
Phase 6 — Bypassing client-side controls
- What is hidden forms in HTML
- Bypassing hidden form fields using tamper data
- Bypassing hidden form fields using Burp Suite (Purchase application)
- Changing price on eCommerce website using parameter tampering
- Understanding cookie in detail
- Cookie tampering with tamper data
- Cookie tamper part 2
- Understanding referer header in depth using Cisco product
- Introduction to ASP.NET viewstate
- ASP.NET viewstate in depth
- Analyse sensitive data in ASP.NET viewstate
Phase 7 — Attacking authentication/login
- Attacking login panel with bad password — Guess username password for the website and try different combinations
- Brute-force login panel
- Username enumeration
- Username enumeration with bruteforce password attack
- Authentication over insecure HTTP protocol
- Authentication over insecure HTTP protocol Pt.2
- Forgot password vulnerability — Case 1
- Forgot password vulnerability — Case 2
- Login page autocomplete feature enabled
- Testing for weak password policy
- Insecure distribution of credentials — When you register in any website or you request for a password reset using forgot password feature, if the website sends your username and password over the email in cleartext without sending the password reset link, then it is a vulnerability.
Phase 8 — Attacking access controls (IDOR, Priv esc, hidden files and directories)
Completely unprotected functionalities
- Finding admin panel
- Finding admin panel and hidden files and directories
- Finding hidden webpages with dirbuster
Insecure direct object reference
Privilege escalation
Phase 9 — Attacking data stores (Various types of injection attacks — SQL|MySQL|NoSQL|Oracle, etc.)
Bypassing login panel
SQL injection
- Part 1 — Install SQLi lab
- Part 2 — SQL lab series
- Part 3 — SQL lab series
- Part 4 — SQL lab series
- Part 5 — SQL lab series
- Part 6 — Double query injection
- Part 7 — Double query injection cont..
- Part 8 — Blind injection boolean based
- Part 9 — Blind injection time based
- Part 10 — Dumping DB using outfile
- Part 11 — Post parameter injection error based
- Part 12 — POST parameter injection double query based
- Part 13 — POST parameter injection blind boolean and time based
- Part 14 — Post parameter injection in UPDATE query
- Part 15 — Injection in insert query
- Part 16 — Cookie based injection
- Part 17 — Second order injection
- Part 18 — Bypassing blacklist filters — 1
- Part 19 — Bypassing blacklist filters — 2
- Part 20 — Bypassing blacklist filters — 3
- Part 21 — Bypassing WAF
- Part 22 — Bypassing WAF — Impedance Mismatch
- Part 23 — Bypassing addslashes — CharSet Mismatch
NoSQL injection
Xpath injection
LDAP injection
Phase 10 — Attacking back-end components (OS command injection, XMl interpreters, mail services, etc.)
OS command injection
*******************************************************************
Conclusion
In conclusion, web application penetration testing is an essential component of a comprehensive security program. By simulating real-world attacks, penetration testers can identify and mitigate vulnerabilities that could be exploited by malicious actors.
To be an effective web application penetration tester, it is important to have a strong foundation in web technologies, web application architecture, databases, networking, operating systems, scripting, and security concepts. In addition, a penetration tester should have excellent problem-solving skills, the ability to think creatively, and strong communication skills.
The exploitation process involves several steps, including reconnaissance, vulnerability assessment, exploitation, post-exploitation, and clean-up. It is important to remember that exploitation should only be performed by trained security professionals in a controlled environment and with the explicit consent of the system owner.
By understanding the process and skills required for web application penetration testing, organizations can better protect their systems and data from malicious actors.
If you found this article helpful, please give it some 👏 and share it with anyone who you think might find it helpful too! + Feedback