Get a Pentest and security assessment of your IT network.

Cyber Security

Web Security Attacks: Learning Resources

TL;DR

This guide lists practical resources to learn about common web security attacks and how they work. It covers everything from basic concepts to hands-on practice.

1. Understand the Basics

Before diving into specific attacks, grasp these core concepts:

  • HTTP/HTTPS: How websites communicate.
  • HTML, CSS, JavaScript: The building blocks of web pages.
  • Databases (SQL): Where website data is stored.
  • Common Web Architectures: Client-server model, REST APIs.

Resources:

2. Cross-Site Scripting (XSS)

XSS lets attackers inject malicious scripts into websites viewed by other users.

  • Types: Reflected, Stored, DOM-based.
  • Prevention: Input validation and output encoding are key!

Resources:

Example (Reflected XSS):

<script>alert('XSS')</script>

3. SQL Injection

SQL injection allows attackers to manipulate database queries, potentially gaining access to sensitive data.

  • How it works: Exploiting vulnerabilities in how web applications handle user input when constructing SQL queries.
  • Prevention: Use parameterized queries or prepared statements. Never concatenate user input directly into SQL queries!

Resources:

Example (Basic SQL Injection):

' OR '1'='1

4. Cross-Site Request Forgery (CSRF)

CSRF forces users to perform unwanted actions on a web application they are authenticated with.

  • How it works: Exploiting trust a website has in a user’s browser.
  • Prevention: Use CSRF tokens, SameSite cookies, and check the Origin header.

Resources:

5. Authentication and Session Management Attacks

Attacks targeting how users log in and stay logged in.

  • Brute Force: Trying many passwords.
  • Session Hijacking: Stealing a user’s session cookie.
  • Insecure Direct Object References (IDOR): Accessing resources without proper authorization.

Resources:

6. Practice Platforms

Hands-on practice is crucial.

  • PortSwigger Web Security Academy: Excellent labs covering a wide range of attacks.
  • Hack The Box: More advanced challenges, often requiring real-world skills – https://www.hackthebox.com/
  • TryHackMe: Guided learning paths and virtual machines – https://tryhackme.com/

7. Tools

  • Burp Suite: A web proxy for intercepting and modifying HTTP traffic (free community edition available).
  • OWASP ZAP: Another free web security scanner.
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation