Web Application Penetration Testing

Sai Samarth
16 min readFeb 17, 2022

--

Web Application Pentesting is a method of identifying, analyzing and Report the vulnerabilities which are existing in the Web application including buffer overflow, input validation, code Execution, Bypass Authentication, SQL Injection, CSRF, Cross-site scripting in the target web Application which is given for Penetration Testing.

Repeatable Testing and Conduct a serious method One of the Best Method conduct Web Application Penetration Testing for all kind of web application vulnerabilities.

Web Application Penetration Testing Checklist

Information Gathering

1. Retrieve and Analyze the robot.txt files by using a tool called GNU Wget.

2. Examine the version of the software. database Details, the error technical component, bugs by the error codes by requesting invalid pages.

3. Implement techniques such as DNS inverse queries, DNS zone Transfers, web-based DNS Searches.

4. Perform Directory style Searching and vulnerability scanning, Probe for URLs, using tools such as NMAP and Nessus.

5. Identify the Entry point of the application using Burp Proxy, OWSAP ZAP, TemperIE, WebscarabTemper Data.

6. By using traditional Fingerprint Tool such as Nmap, Amap, perform TCP/ICMP and service Fingerprinting.

7.By Requesting Common File Extension such as.ASP,EXE, .HTML, .PHP ,Test for recognized file types/Extensions/Directories.

8. Examine the Sources code From the Accessing Pages of the Application front end.

Authentication Testing

1. Check if it is possible to “reuse” the session after Logout.also check if the application automatically logs out a user has idle for a certain amount of time.

2. Check whether any sensitive information Remain Stored stored in browser cache.

3. Check and try to Reset the password, by social engineering crack secretive questions and guessing.

4.check if the “Remember my password” Mechanism is implemented by checking the HTML code of the login page.

5. Check if the hardware devices directly communicate and independently with authentication infrastructure using an additional communication channel.

6. Test CAPTCHA for authentication vulnerabilities presented or not.

7. Check whether any weak security questions/Answer are presented.

8. A successful SQL injection could lead to the loss of customer trust and attackers can steal phone numbers, addresses, and credit card details. Placing a web application firewall can filter out the malicious SQL queries in the traffic.

Authorization Testing

1. Test the Role and Privilege Manipulation to Access the Resources.

2.Test For Path Traversal by Performing input Vector Enumeration and analyze the input validation functions presented in the web application.

3.Test for cookie and parameter Tempering using web spider tools.

4. Test for HTTP Request Tempering and check whether to gain illegal access to reserved resources.

Configuration Management Testing

1. Check directory and File Enumeration review server and application Documentation. also, check the infrastructure and application admin interfaces.

2. Analyze the Web server banner and Performing network scanning.

3. Check and verify the presence of old Documentation and Backup and referenced files such as source codes, passwords, installation paths.

4.check and identify the ports associated with the SSL/TLS services using NMAP and NESSUS.

5.Review OPTIONS HTTP method using Netcat and Telnet.

6. Test for HTTP methods and XST for credentials of legitimate users.

7. Perform application configuration management test to review the information of the source code, log files and default Error Codes.

Session Management Testing

1. Check the URL’s in the Restricted area to Test for Cross sight Request Forgery.

2.Test for Exposed Session variables by inspecting Encryption and reuse of session token, Proxies and caching, GET&POST.

3. Collect a sufficient number of cookie samples and analyze the cookie sample algorithm and forge a valid Cookie in order to perform an Attack.

4. Test the cookie attribute using intercept proxies such as Burp Proxy, OWASP ZAP, or traffic intercept proxies such as Temper Data.

5. Test the session Fixation, to avoid seal user session.(session Hijacking )

Data Validation Testing

1. Performing Sources code Analyze for javascript Coding Errors.

2. Perform Union Query SQL injection testing, standard SQL injection Testing, blind SQL query Testing, using tools such as sqlninja,sqldumper,sql power injector .etc.

3. Analyze the HTML Code, Test for stored XSS, leverage stored XSS, using tools such as XSS proxy, Backframe, Burp Proxy, OWASP, ZAP, XSS Assistant.

4. Perform LDAP injection testing for sensitive information about users and hosts.

5. Perform IMAP/SMTP injection Testing for Access the Backend Mail server.

6.Perform XPATH Injection Testing for Accessing the confidential information

7. Perform XML injection testing to know information about XML Structure.

8. Perform Code injection testing to identify input validation Error.

9. Perform Buffer Overflow testing for Stack and heap memory information and application control flow.

10. Test for HTTP Splitting and smuggling for cookies and HTTP redirect information.

Denial of Service Testing

1. Send Any Large number of Requests that perform database operations and observe any Slowdown and New Error Messages.

2.Perform manual source code analysis and submit a range of input varying lengths to the applications

3.Test for SQL wildcard attacks for application information testing. Enterprise Networks should choose the best DDoS Attack prevention services to ensure the DDoS attack protection and prevent their network

4. Test for User specifies object allocation whether a maximum number of object that application can handle.

5. Enter Extreme Large number of the input field used by the application as a Loop counter. Protect website from future attacks Also Check your Companies DDOS Attack Downtime Cost.

6. Use a script to automatically submit an extremely long value for the server can be logged the request.

Web server pentesting performing under 3 major category which is identity, Analyse, Report Vulnerabilities such as authentication weakness, configuration errors, protocol Relation vulnerabilities.

1. “Conduct a serial of methodical and Repeatable tests “ is the best way to test the web server along with this to work through all of the different application Vulnerabilities.

2. “Collecting as Much as Information” about an organization Ranging from operation environment is the main area to concentrate on the initial stage of web server Pen testing.

3. Performing web server Authentication Testing, use Social engineering techniques to collect the information about the Human Resources, Contact Details, and other Social Related information.

4. Gathering Information about Target, use whois database query tools to get the Details such as Domain name, IP address, Administrative Details, autonomous system number, DNS etc.

5. Fingerprint webserver to gather information such as server name, server type, operating systems, an application running on the server etc use fingerprint scanning tools such as, Netcraft, HTTPrecon, ID Serve.

6. Crawel Website to gather Specific information from web pages, such as email addresses

7. Enumerate web server Directories to extract important information about web functionalities, login forms etc.

8. Perform Directory traversal Attack to access Restricted Directories and execute the command from outside of the Web server root directories.

9. Performing vulnerability scanning to identify the weakness in the network use the vulnerability scanning tools such as HPwebinspect, Nessus . and determine if the system can be exploited.

10. Perform we cache poisoning attack to force the web server’s cache to flush its actual cache content and send a specifically crafted request which will be stored in the cache.

11. Performing HTTP response splitting attack to pass malicious data to a vulnerable application that includes the data in an HTTP response header.

12. Bruteforce SSH,FTP, and other services login credentials to gain unauthorized access.13. Perform session hijacking to capture valid session cookies and ID’s,use tools such as Burb suite , Firesheep ,jhijack to automated session hijacking.

14. Performing a MITM attack to access sensitive information by intercepting the communications between the end-users and web servers.

15. Use tools such as Webalizer, AWStats to examine the web server logs .

Important Checklist Suggested by Microsoft

Services

  • Unnecessary Windows services are disabled.
  • Services are running with least-privileged accounts.
  • FTP, SMTP, and NNTP services are disabled if they are not required.
  • Telnet service is disabled.

Protocols

  • WebDAV is disabled if not used by the application OR it is secured if it is required.
  • TCP/IP stack is hardened
  • NetBIOS and SMB are disabled (closes ports 137, 138, 139, and 445).

Accounts

  • Unused accounts are removed from the server.
  • Guest account is disabled.
  • IUSR_MACHINE account is disabled if it is not used by the application.
  • If your applications require anonymous access, a custom least-privileged anonymous account is created.
  • The anonymous account does not have write access to Web content directories and cannot execute command-line tools.
  • Strong account and password policies are enforced for the server.
  • Remote logons are restricted. (The “Access this computer from the network” user-right is removed from the Everyone group.)
  • Accounts are not shared among administrators.
  • Null sessions (anonymous logons) are disabled.
  • Approval is required for account delegation.
  • Users and administrators do not share accounts.
  • No more than two accounts exist in the Administrators group.
  • Administrators are required to log on locally OR the remote administration solution is secure.

Files and Directories

  • Files and directories are contained on NTFS volumes
  • Web site content is located on a non-system NTFS volume.
  • Log files are located on a non-system NTFS volume and not on the same volume where the Web site content resides.
  • The Everyone group is restricted (no access to \WINNT\system32 or Web directories).
  • Web site root directory has denied write ACE for anonymous Internet accounts.
  • Content directories have deny write ACE for anonymous Internet accounts.
  • Remote administration application is removed
  • Resource kit tools, utilities, and SDKs are removed.
  • Sample applications are removed

Shares

  • All unnecessary shares are removed (including default administration shares).
  • Access to required shares is restricted (the Everyone group does not have access).
  • Administrative shares (C$ and Admin$) are removed if they are not required (Microsoft Management Server (SMS) and Microsoft Operations Manager (MOM) require these shares).

Ports

  • Internet-facing interfaces are restricted to port 80 (and 443 if SSL is used)
  • Intranet traffic is encrypted (for example, with SSL) or restricted if you do not have a secure data center infrastructure.

Registry

  • Remote registry access is restricted.
  • SAM is secured (HKLM\System\CurrentControlSet\Control\LSA\NoLMHash).

Auditing and Logging

  • Failed logon attempts are audited.
  • IIS log files are relocated and secured.
  • Log files are configured with an appropriate size depending on the application security requirement.
  • Log files are regularly archived and analyzed.
  • Access to the Metabase.bin file is audited.
  • IIS is configured for W3C Extended log file format auditing.

Server Certificates

  • Ensure certificate date ranges are valid.
  • Only use certificates for their intended purpose (For example, the server certificate is not used for e-mail).
  • Ensure the certificate’s public key is valid, all the way to a trusted root authority.
  • Confirm that the certificate has not been revoked.

Web Application Pentesting Tools are more often used by security industries to test the vulnerabilities of web-based applications. Here you can find the Comprehensive Web Application Pentesting ToolsWeb Application Penetration Testing list that covers Performing Penetration testing Operation in all the Corporate Environments.

You can learn best Master level Web Hacking and Penetration Testing Complete Bundle from Leading Elearning Cybersecurity platform.

Web Application Pentesting Tools

Organization

  • OWASP — The Open Web Application Security Project (OWASP) is a 501(c)(3) worldwide not-for-profit charitable organization focused on improving the security of software.

Web Application Firewall

  • ModSecurity — ModSecurity is a toolkit for real-time web application monitoring, logging, and access control.
  • NAXSI — NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX, NAXSI means Nginx Anti Xss & Sql Injection.
  • sql_firewall SQL Firewall Extension for PostgreSQL
  • ironbee — IronBee is an open source project to build a universal Web Application Pentesting Tools . IronBee as a framework for developing a system for securing web applications — a framework for building a web application firewall (WAF).
  • Indusface — A new age web application firewall aimed in thwarting the threat actors to exfiltrate into the system, by detecting the application vulnerabilities, malware, and logical flaws.

Scanning / Pentesting

  • sqlmap — sqlmap is an open source Web Application Penetration Testing Tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers. It comes with a powerful detection engine, many niche features for the ultimate penetration tester and a broad range of switches lasting from database fingerprinting, over data fetching from the database, to accessing the underlying file system and executing commands on the operating system via out-of-band connections.
  • ZAP — The Zed Attack Proxy (ZAP) is an easy to use integrated Web Application Pentesting Tools for finding vulnerabilities in web applications. It is designed to be used by people with a wide range of security experience and as such is ideal for developers and functional testers who are new to penetration testing. ZAP provides automated scanners as well as a set of tools that allow you to find security vulnerabilities manually.
  • OWASP Testing Checklist v4 — List of some controls to test during a web vulnerability assessment. Markdown version may be found here.
  • w3af — w3af is a Web Application Attack and Audit Framework. The project’s goal is to create a framework to help you secure your web applications by finding and exploiting all web application vulnerabilities.
  • Recon-ng — Recon-ng is a full-featured Web Reconnaissance framework written in Python. Recon-ng has a look and feels similar to the Metasploit Framework.
  • PTF — The Penetration Testers Framework (PTF) is a way for modular support for up-to-date tools.
  • Infection Monkey — A semi automatic pen testing tool for mapping/pen-testing networks. Simulates a human attacker.
  • ACSTIS — ACSTIS helps you to scan certain web applications for AngularJS Client-Side Template Injection (sometimes referred to as CSTI, sandbox escape or sandbox bypass). It supports scanning a single request but also crawling the entire web application for the AngularJS CSTI vulnerability.

Runtime Application Self-Protection

  • Sqreen — Sqreen is a Runtime Application Self-Protection (RASP) solution for software teams. An in-app agent instruments and monitors the app. Suspicious user activities are reported and attacks are blocked at runtime without code modification or traffic redirection.

Development

  • Secure by Design — Book that identifies design patterns and coding styles that make lots of security vulnerabilities less likely. (early access, published continuously, final release fall 2017)
  • Securing DevOps — Book that explores how the techniques of DevOps and Security should be applied together to make cloud services safer. (early access, published continuously, final release January 2018)
  • Understanding API Security — a Free eBook sampler that gives some context for how API security works in the real world by showing how APIs are put together and how the OAuth protocol can be used to protect them.
  • OAuth 2 in Action — Book that teaches you practical use and deployment of OAuth 2 from the perspectives of a client, an authorization server, and a resource server.

Usability

  • Usable Security Course — Usable Security course at coursera. Quite good for those looking for how security and usability intersects.

Big Data

  • data_hacking — Examples of using IPython, Pandas, and Scikit Learn to get the most out of your security data.
  • hadoop-pcap — Hadoop library to read packet capture (PCAP) files.
  • Workbench — A scalable python framework for security research and development teams.
  • OpenSOC — OpenSOC integrates a variety of open source big data technologies in order to offer a centralized tool for security monitoring and analysis.
  • Apache Metron (incubating) — Metron integrates a variety of open source big data technologies in order to offer a centralized tool for security monitoring and analysis.
  • Apache Spot (incubating) — Apache Spot is open source software for leveraging insights from flow and packet analysis.
  • binarypig — Scalable Binary Data Extraction in Hadoop. Malware Processing and Analytics over Pig, Exploration through Django, Twitter Bootstrap, and Elasticsearch.

DevOps

  • Securing DevOps — A book on Security techniques for DevOps that reviews state of the art practices used in securing web applications and their infrastructure.

Books

Documentation

Tools

Cheat Sheets

Docker images for Penetration Testing

Vulnerabilities

Courses

Online Hacking Demonstration Sites

Labs

SSL

Security Ruby on Rails

Conclusion

Web application pentesting tools are very essential to perform penetration testing over the various web-based application to find security flaws and protect the application from cybercriminals. there are various pentesting Tools are available, above mentioned web application pentesting Tools are top list to perform a various level of pentesting operation and report to the respective vendor to patch the web application vulnerabilities.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Sai Samarth
Sai Samarth

Written by Sai Samarth

I am a Ethical Hacker, Forensic Investigatior,OSINT Evangelist,My interests range from technology to entrepreneurship! https://about.me/cybersamarth

No responses yet

Write a response