AI pentesting guides / Free, open-source and AI pentesting

Methodology

How to pentest a web application, step by step

To pentest a web application, agree scope and authorisation, map the application and its attack surface, then test authentication, session handling, access control, input handling and business logic in turn, proving each issue with a reproducible request before writing it up. The OWASP Web Security Testing Guide is the standard reference for the detail of each step.

This page gives the working order and the questions to ask at each stage. It assumes you are testing an application you own or have written permission to test, ideally in a staging environment.

1. Scope, authorisation and set-up

  • Get written authorisation naming the hosts, environments and testing window.
  • Create test accounts for every role: at least two ordinary users and one administrator.
  • Agree what is off-limits, such as payment processing, email sending or data deletion.
  • Set up an intercepting proxy so you can see and replay every request.

2. Map the application

Browse every feature as each role while the proxy records traffic. Enumerate subdomains and paths, pull JavaScript files for hidden API routes, and note every parameter, file upload, redirect and integration. Fingerprint frameworks and versions. The output is a list of functions and the data each one touches, which drives everything that follows. Pay particular attention to features added recently, admin panels reachable from the public internet, and anything that accepts files or URLs, because these are where testers most often find serious issues.

3. Authentication and sessions

  • Test password reset flows for token predictability, reuse and account enumeration.
  • Check session tokens: randomness, expiry, invalidation on logout and password change, cookie flags.
  • If JWTs are used, test signature validation, algorithm handling and claims the server trusts.
  • Look for rate limiting on login and other sensitive actions.

4. Access control and input handling

Access control is where the most serious web application flaws usually are. For each function, try it as a lower-privileged user and as a different user of the same role: change IDs, replay admin requests with a normal session, add fields such as role to update requests. Then work through input handling: SQL and NoSQL injection, cross-site scripting, server-side request forgery on any URL parameter, path traversal on file parameters, and template injection where user input is rendered.

5. Business logic and reporting

Ask how the feature could be abused rather than broken: applying a discount twice, skipping a step in checkout, racing two requests. Finally, write up each issue with the exact request and response that proves it, its impact in plain language, a severity rating such as CVSS, and a specific fix. Retest after fixes. Keep evidence in a form an engineer can replay, such as a saved request or a short script, so fixes can be verified quickly.

With Pentest-Swarm

Automating the repetitive steps with Pentest-Swarm

Pentest-Swarm automates much of steps 2 to 4 for web applications, so your manual time goes on business logic and judgement.

  • Run the OWASP Top 10 pipeline: pentestswarm playbook run owasp-top10 --target staging.example.com.
  • Or an adaptive run: pentestswarm scan staging.example.com --scope staging.example.com --swarm --safe-mode.
  • Covers classes such as injection, XSS, SSRF, path traversal, broken authentication and JWT flaws, and access control.
  • Practise first on Juice Shop: pentestswarm scan --lab --lab-target juiceshop --tui.

Where it falls short

Pentest-Swarm does not replace the manual parts of this method: understanding the business, judging impact, and testing abuse cases and complex multi-step flows. It is not an intercepting proxy, and it struggles where login requires MFA or CAPTCHAs. Use it for breadth and evidence, and keep a proxy such as OWASP ZAP for hands-on work.

Questions

How long does a web app pentest take?

It depends on size and depth. A small application might take a few days of focused work; a large multi-role application much longer.

Should I test production or staging?

Staging that mirrors production is safer. If production must be tested, agree a window and avoid destructive actions.

What is the most common serious web app flaw?

Broken access control, which tops the OWASP Top 10, is consistently among the most common and most damaging.

Sources

  1. OWASP Web Security Testing Guide
  2. OWASP Top 10