How to detect Web attacks
Attack Detecting attacks Especially web attacks Is more easy than you ever think.
How to detect Web attacks
Attack Detecting attacks Especially web attacks Is more easy than you ever think.
But the thing is that you need a Tools and a proper plan To test them and to find Weakness. So this is a full article where we are going to look about. Everything about Web attack About client side attacks & Server side attacks. And many more things So if you are a cyber security enthusiastic or a security practitioner. Then this is article for you.
Hey hackers
I’m a passionate cybersecurity enthusiast and ethical hacker. I love solving CTFs Finding Weakness in system & vulnerabilities, while also diving into recently discovered vulnerabilities to enhance my skills.

Client-Side Attacks: A Persistent Threat to Users and Organizations:
Client-side attacks target weaknesses in user behavior or device security rather than server infrastructure. They exploit browser vulnerabilities or manipulate users into unsafe actions to compromise accounts and steal sensitive data. As organizations increasingly rely on third-party plugins and dynamic web applications, the attack surface in browsers continues to expand, creating more opportunities for attackers.
How Client-Side Attacks Work in Practice: Consider a seemingly innocent shopping experience: you’re browsing an e-commerce site and click on a product image. Unbeknownst to you, the page contains a hidden, invisible window running malicious code in the background. This hidden window loads a fraudulent site that captures your login session cookies the tokens that authenticate your identity. The attack happens silently, leaving no trace of suspicious activity. The attacker can now masquerade as you and access your account without ever triggering a security alert.
Why Security Operations Centers Struggle to Detect These Attacks Traditional SOC tools provide minimal visibility into client-side threats. Server-side logs and network traffic analysis reveal little about what happens inside a user’s browser. Since client-side attacks execute directly on the user’s system, attackers can run malicious code, exfiltrate data, and manipulate the browser environment without generating the suspicious HTTP requests or network anomalies that SOC analysts typically monitor. Detecting these attacks requires additional browser-side security controls or endpoint monitoring capabilities that many organizations lack.
The Most Common Client-Side Attack :
- Cross-Site Scripting (XSS): Malicious scripts are injected into trusted websites and executed in the victim’s browser. For example, an unfiltered comment box might allow an attacker to post
<script>alert('You have been hacked');</script>. While this example is harmless, real attacks steal cookies or session data. - Session hijacking, credential theft, account compromise, data exfiltration
- Cross-Site Request Forgery (CSRF):The attacker tricks the browser into sending unauthorized requests on behalf of an authenticated user to a trusted site.
- Unauthorized account actions, fund transfers, password changes, data modification
- Clickjacking:Attackers overlay invisible interactive elements on top of legitimate page content, deceiving users into clicking on malicious links or buttons they believe are safe. Malware installation, credential harvesting, unauthorized transactions, account takeover.
Server-Side Attacks — Exploiting Backend Vulnerabilities:-
Server-side attacks target flaws in web servers, application code, or backend infrastructure rather than user behavior. Unlike client-side attacks that manipulate how users interact with websites, server-side attacks exploit vulnerabilities in system logic, misconfigurations, and improper input handling. By leveraging these weaknesses, attackers gain unauthorized access, steal sensitive information, and compromise critical services.
Real-World Impact of Server-Side Vulnerabilities:
Web applications typically collect user input through multiple forms login credentials, search queries, order history requests, and more. When a website mishandles input from even a single form, attackers can breach the vulnerability to access sensitive customer data and financial information stored in backend databases. The consequences extend beyond data theft to include service disruption and reputational damage.
Why Server-Side Attacks Leave a Detectable Trail:
A key advantage for defenders is that server-side attacks generate evidence that can be traced and analyzed. Every web request sent to an application is processed by the server and recorded in logs and monitoring systems. Additionally, network traffic carrying these requests can reveal suspicious patterns and behavior. This visibility combined with proper log analysis and network monitoring allows security teams to identify and respond to server-side threats more effectively than client-side attacks.
The Most Common Server-Side Attack Vectors:
Attackers use automated tools to rapidly test numerous username and password combinations against a login system, cycling through credential lists and common passwords until gaining unauthorized access.
Using Web Server Logs to Detect Attacks:
Access logs are essential defensive tools that record every request sent to a web server, revealing patterns of scanning, exploitation, and other malicious activity. By analyzing log entries systematically, defenders can identify attacks that would otherwise go undetected. Understanding the standard log format and recognizing attack signatures is critical for effective threat detection.
Understanding Access Log Components
Each access log entry contains multiple fields that can indicate either benign or suspicious activity:
- Client IP Address Requests from known malicious sources or IP addresses outside expected geographic ranges may indicate external attacks or compromised accounts.
- Timestamp and Requested Page Requests made at unusual hours, high-frequency requests in short timeframes, or repeated access patterns suggest automated attacks or reconnaissance.
- Status Code Repeated 404 responses indicate directory enumeration or scanning; unusual status codes (especially 302 redirects after failed attempts) may signal successful exploitation.
- Response Size Responses significantly smaller or larger than normal baseline sizes can indicate data exfiltration, error responses, or unexpected content delivery.
- Referrer Referring pages that don’t align with normal site navigation patterns may indicate attackers probing different entry points or following unusual paths.
- User-Agent Outdated browser versions, missing user-agent strings, or known attack tool signatures (e.g., sqlmap, wpscan) directly identify automated attacks.
How Attack Sequences Appear in Logs:
A typical attack chain unfolds in distinct phases, each leaving traces in the access log. In real-world scenarios, benign traffic would dominate the logs, making it essential to recognize malicious patterns among normal activity.
Phase 1: Reconnaissance Through Directory Fuzzing
The attacker begins by probing the application for exploitable endpoints. Using automated tools, they request common directories and file names (e.g., /admin, /login.php, /config). Successful requests return 200 status codes, revealing valid targets for further exploitation.
Phase 2: Credential Compromise via Brute-Force
Once vulnerabilities are identified, the attacker targets login forms. Logs show repeated POST requests to /login.php sent in rapid succession—a telltale sign of automated credential testing. Most requests fail with 401 (Unauthorized) or 403 (Forbidden) responses. The attack succeeds when a POST request returns a 302 Found status code, indicating a redirect to the user's account page at /account. This status change marks the moment access was gained.
Phase 3: Data Exfiltration via SQL Injection
With account access secured, the attacker shifts focus to the database. They submit SQL injection payloads like ' OR '1'='1 or 1' OR 'a'='a to the /search form. If the application builds SQL queries dynamically rather than using parameterized queries, these payloads can bypass authentication logic and allow attackers to dump entire databases.
Network Traffic Analysis for Attack Detection:
Network traffic analysis provides deeper visibility into cyber attacks than server logs alone by capturing and inspecting the raw data exchanged between clients and servers.
The Limitations of Encrypted Protocols:
Encryption significantly restricts what analysts can observe in network traffic. Protocols like HTTPS and SSH encrypt their payloads, making the underlying data unreadable without access to decryption keys. This protection while essential for legitimate security also shields malicious activity from packet-level inspection. For detailed traffic analysis, defenders typically focus on unencrypted HTTP traffic or have access to decryption keys for HTTPS inspection in controlled environments.
How Attack Sequences Appear in Network Traffic
Using packet analysis tools like Wireshark, analysts can trace the same attack sequence visible in server logs but with dramatically more detail. By applying filters to focus on specific IP addresses, protocols, or user-agent strings, defenders can isolate malicious traffic and examine its contents packet by packet.
Phase 1: Directory Enumeration
The attacker begins with automated directory scanning, sending requests to identify valid endpoints. Each successful response can be traced in the packet capture, revealing which directories and forms exist on the target server.

Network logs
Phase 2: Brute-Force Attack with Full Credential Visibility
Unlike server logs, network captures reveal the actual credentials tested during a brute-force attack. Examining packet 13 (the successful login attempt) shows the attacker submitted the username and password in the POST body. In this case, the successful credentials were simply admin / password123—a dangerously weak password for an administrative account. Server logs only showed that a POST request succeeded with a 302 redirect; network traffic reveals exactly what credentials were used to compromise the account.
Phase 3: SQL Injection with Payload and Results Visible
Network packet inspection exposes both the attack payload and the attacker’s success in real time. When the attacker submitted the SQL injection payload ' OR '1'='1 to the /passreset form, the HTTP response body contained the dumped database results. The captured traffic shows the attacker successfully extracted the Users table, including first names and surnames in clear text. This level of detail which credentials were tested, which injection payload was used, and what data was exfiltrated would be invisible in server access logs but becomes crystal clear in packet captures.
Web Application Firewalls: The First Line of Defense
Web Application Firewalls (WAFs) serve as critical gatekeepers for web applications, inspecting every request before it reaches the server and blocking malicious traffic before damage occurs.
How WAF Rules Protect Applications
WAFs protect applications through multiple rule categories, each addressing different threat vectors:
- Common Attack Patterns Detects and blocks known malicious payloads and attack signatures Block requests with User-Agent strings like
sqlmap,nikto, orwpscanthat indicate automated vulnerability scanners - Deny Known Malicious Sources Uses IP reputation databases, threat intelligence, and geographic restrictions to filter risky traffic Block IP addresses linked to recent botnet campaigns or restrict access to specific geographic regions
- Custom-Built Rules Tailored specifically to your application’s legitimate traffic patterns and security requirements Allow only GET and POST requests to
/login, or block unexpected HTTP methods to sensitive endpoints - Rate-Limiting & Abuse Prevention Restricts request frequency to prevent brute-force attacks, credential stuffing, and resource exhaustion Limit login attempts to 5 per minute per IP address; restrict API calls to 100 requests per hour per user.
Thankyou For Reading…
메타데이터
- post_id
- 896bd9dcbe0f
- slug
- how-to-detect-web-attacks-896bd9dcbe0f
- url
- https://medium.com/@mainekhacker/how-to-detect-web-attacks-896bd9dcbe0f
- canonical_url
- https://medium.com/@mainekhacker/how-to-detect-web-attacks-896bd9dcbe0f
- author_url
- https://medium.com/@mainekhacker
- status
- ok
- fetched_at
- 2026-07-09 05:53:33