Active

Active Reconnaissance of a Web Application

Active reconnaissance involves directly interacting with the target web application to gather information. Unlike passive reconnaissance, this method is more intrusive and can trigger security alerts or logs on the target's systems. However, it provides more detailed and accurate information about the application's infrastructure, services, and potential vulnerabilities.

Below is a step-by-step description of how to perform active reconnaissance on a web application:


1. Port Scanning

  • Objective: Identify open ports and services running on the web server.

  • Tools:

    • Nmap: A powerful network scanning tool to discover open ports and services.

      • Example command: nmap -sV -p 1-65535 example.com

    • Masscan: A faster port scanner for large networks.

      • Example command: masscan -p1-65535 <IP> --rate=1000

  • What to Look For:

    • Common web ports (80, 443, 8080, etc.).

    • Unusual or unexpected open ports (e.g., database ports like 3306 for MySQL).


2. Service Fingerprinting

  • Objective: Determine the versions of software and services running on the server.

  • Tools:

    • Nmap: Use the -sV flag to detect service versions.

      • Example: nmap -sV example.com

    • Netcat: Manually probe services to identify banners and versions.

  • What to Look For:

    • Web server software (e.g., Apache, Nginx, IIS).

    • Programming languages or frameworks (e.g., PHP, Node.js).

    • Database services (e.g., MySQL, PostgreSQL).


3. Web Server Enumeration

  • Objective: Gather detailed information about the web server and its configuration.

  • Tools:

    • Nikto: A web server scanner that checks for misconfigurations and vulnerabilities.

      • Example: nikto -h example.com

    • Gobuster/Dirbuster: Tools for brute-forcing directories and files on the web server.

      • Example: gobuster dir -u https://example.com -w wordlist.txt

    • curl/wget: Command-line tools to manually inspect HTTP headers and responses.

      • Example: curl -I https://example.com

  • What to Look For:

    • Server headers (e.g., Server: Apache/2.4.29).

    • Directory listings or hidden files.

    • Misconfigurations (e.g., open directories, exposed admin panels).


4. Web Application Crawling

  • Objective: Map out the structure of the web application, including pages, forms, and endpoints.

  • Tools:

    • OWASP ZAP: A web application security scanner that includes a crawler.

    • Burp Suite: A tool for intercepting and analyzing web traffic, including crawling.

    • Arachni: A feature-rich web application scanner.

  • What to Look For:

    • Hidden or unlinked pages.

    • Input fields (e.g., login forms, search boxes).

    • API endpoints or dynamic content.


5. Vulnerability Scanning

  • Objective: Identify known vulnerabilities in the web application or its components.

  • Tools:

    • Nessus: A comprehensive vulnerability scanner.

    • OpenVAS: An open-source vulnerability scanner.

    • Acunetix: A commercial web vulnerability scanner.

  • What to Look For:

    • Common vulnerabilities (e.g., SQL injection, XSS, CSRF).

    • Outdated software or libraries.

    • Misconfigurations (e.g., insecure headers, weak SSL/TLS).


6. SSL/TLS Configuration Testing

  • Objective: Check the security of the web application's SSL/TLS implementation.

  • Tools:

    • SSL Labs: ssllabs.comarrow-up-right for analyzing SSL/TLS configuration.

    • TestSSL.sh: A command-line tool to test SSL/TLS vulnerabilities.

      • Example: testssl.sh example.com

    • Nmap: Use the --script ssl-enum-ciphers script to enumerate SSL/TLS ciphers.

      • Example: nmap --script ssl-enum-ciphers -p 443 example.com

  • What to Look For:

    • Weak ciphers or protocols (e.g., SSLv2, SSLv3).

    • Expired or self-signed certificates.

    • Misconfigurations (e.g., missing HSTS).


7. Fuzz Testing

  • Objective: Discover hidden endpoints, parameters, or vulnerabilities by sending unexpected input.

  • Tools:

    • Wfuzz: A web application fuzzing tool.

      • Example: wfuzz -c -z file,wordlist.txt --hc 404 https://example.com/FUZZ

    • Burp Suite Intruder: A tool for automating custom attacks and fuzzing.

    • FFuf: A fast web fuzzer.

      • Example: ffuf -w wordlist.txt -u https://example.com/FUZZ

  • What to Look For:

    • Hidden endpoints or parameters.

    • Error messages or unexpected behavior.


8. API Testing

  • Objective: Identify vulnerabilities or misconfigurations in the web application's APIs.

  • Tools:

    • Postman: A tool for manually testing API endpoints.

    • OWASP ZAP: Includes features for API testing.

    • Burp Suite: Can intercept and analyze API traffic.

  • What to Look For:

    • Unauthenticated access to sensitive endpoints.

    • Injection vulnerabilities (e.g., SQLi, XSS).

    • Rate limiting or authentication flaws.


9. Manual Testing

  • Objective: Perform manual checks to identify vulnerabilities that automated tools might miss.

  • Techniques:

    • Input Validation Testing: Test for SQL injection, XSS, and other input-based vulnerabilities.

    • Authentication Testing: Check for weak passwords, brute-force vulnerabilities, and session management flaws.

    • Business Logic Testing: Identify flaws in the application's logic (e.g., price manipulation, privilege escalation).

  • Tools:

    • Burp Suite: For intercepting and manipulating requests.

    • Browser Developer Tools: For inspecting and modifying client-side code.


10. Network Traffic Analysis

  • Objective: Analyze network traffic to identify sensitive data or vulnerabilities.

  • Tools:

    • Wireshark: A network protocol analyzer.

    • Tcpdump: A command-line packet analyzer.

  • What to Look For:

    • Unencrypted sensitive data (e.g., passwords, tokens).

    • Suspicious or unexpected traffic.


Summary of Active Reconnaissance Steps

  1. Perform port scanning to identify open ports and services.

  2. Fingerprint services to determine software versions.

  3. Enumerate web server directories and files.

  4. Crawl the web application to map its structure.

  5. Scan for vulnerabilities in the application and its components.

  6. Test SSL/TLS configuration for weaknesses.

  7. Use fuzz testing to discover hidden endpoints or parameters.

  8. Test APIs for vulnerabilities or misconfigurations.

  9. Perform manual testing to identify logic flaws or complex vulnerabilities.

  10. Analyze network traffic for sensitive data or anomalies.

Last updated