Common Network and Application Attacks and How to Defend Against Them
Network attacks target how data moves: denial-of-service floods, man-in-the-middle interception, ARP and DNS spoofing, scanning and password brute force. Application attacks target flaws in software: injection (such as SQL injection), cross-site scripting, broken access control, server-side request forgery and cross-site request forgery.
Topic: Network Security in Cybersecurity & Ethical Hacking · Explainer
Also covers: Web & API Security, SOC & Blue Team
Quick answer: Network attacks target how data moves: denial-of-service floods, man-in-the-middle interception, ARP and DNS spoofing, scanning and password brute force. Application attacks target flaws in software: injection (such as SQL injection), cross-site scripting, broken access control, server-side request forgery and cross-site request forgery. Defences combine network controls (firewalls, segmentation, encryption, DDoS protection, MFA) with secure coding (parameterised queries, output encoding, server-side authorization checks) and testing against the OWASP Top 10 and CWE Top 25.
Key takeaways
- Encryption with proper certificate validation defeats most interception attacks.
- MFA and rate limiting blunt brute-force and password-spraying attempts.
- Parameterised queries prevent SQL injection; output encoding prevents XSS.
- Broken access control is the top OWASP risk; check authorization on the server for every request.
- Layered defences are needed because network and application attacks often combine.
Table of Contents
- What Are the Common Network Attacks?
- What Are the Common Application Attacks?
- How Do You Prevent SQL Injection?
- How Do You Prevent Cross-Site Scripting?
- How Do You Prevent Man-in-the-Middle Attacks?
- How Do You Handle DDoS Attacks?
- How Do You Build a Defence Programme?
- References
What Are the Common Network Attacks?
| Attack | How it works | Defence |
|---|---|---|
| DDoS (MITRE T1498/T1499) | Floods services with traffic | DDoS protection, CDN, rate limiting |
| Man-in-the-middle (T1557) | Intercepts or alters traffic | TLS with validation, HSTS, VPN |
| ARP spoofing | Fakes MAC-to-IP mappings on a LAN | Dynamic ARP inspection, segmentation |
| DNS spoofing | Returns false DNS answers | DNSSEC, trusted resolvers, encrypted DNS |
| Scanning and reconnaissance | Maps open ports and services | Reduce exposure, firewall, monitoring |
| Brute force and spraying (T1110) | Guesses passwords | MFA, lockout, rate limiting |
What Are the Common Application Attacks?
| Attack | OWASP / CWE | Defence |
|---|---|---|
| Broken access control, IDOR | A01 / CWE-639, CWE-862 | Server-side authorization on every request |
| Injection (SQL, command) | A03 / CWE-89, CWE-78 | Parameterised queries, avoid shell calls |
| Cross-site scripting | A03 / CWE-79 | Context-aware output encoding, CSP |
| Server-side request forgery | A10 / CWE-918 | Allowlist outbound destinations, block metadata IPs |
| Cross-site request forgery | CWE-352 | SameSite cookies, CSRF tokens |
| Path traversal | CWE-22 | Canonicalise and check paths |
The OWASP Top 10 and CWE Top 25 rank these risks. Related guides: broken access control and path traversal.
How Do You Prevent SQL Injection?
# Vulnerable: user input concatenated into SQL
cur.execute("SELECT * FROM users WHERE email = '" + email + "'")
# Safe: parameterised query (Python DB-API)
cur.execute("SELECT * FROM users WHERE email = %s", (email,))
Use least-privilege database accounts too, so a successful injection has limited reach. The OWASP Cheat Sheet Series has language-specific guidance.
How Do You Prevent Cross-Site Scripting?
<!-- Template engines such as Jinja2 escape by default -->
<p>Hello, {{ username }}</p>
# HTTP header adding a Content Security Policy as a second layer
Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'
Never insert untrusted input into HTML, JavaScript or attributes without encoding for that context.
How Do You Prevent Man-in-the-Middle Attacks?
- Use HTTPS everywhere and enable HSTS (RFC 6797).
- Validate certificates in apps and APIs; never disable verification in code.
- Use WPA3 on Wi-Fi and VPNs on untrusted networks.
- Enable switch protections such as dynamic ARP inspection on enterprise LANs.
How Do You Handle DDoS Attacks?
Use a DDoS protection service or CDN in front of public services, rate limit at the edge, and have a response plan with your provider. CISA's DDoS guidance covers preparation and response. See also how IndiaMART uses Cloud Armor.
How Do You Build a Defence Programme?
- Inventory exposed services and applications.
- Apply network controls: firewall, segmentation, encryption, MFA.
- Adopt secure coding standards and code review.
- Scan dependencies and run application security testing in CI.
- Pentest regularly and monitor logs for attacks.
WebAsha offers web application and network security training.
References
Frequently Asked Questions
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0