Hacking 101 – Cross site scripting – Web Security Tutorial
What is Cross-site scripting?
Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted websites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end-user. Flaws that allow these attacks to succeed are quite widespread and occur anywhere a web application uses input from a user within the output it generates without validating or encoding it.
There are 3 types of XSS, I’m going to talk about the 2 most used:
►Reflected XSS Attack:
When an attacker injects his malicious script into a search query, a search box,or the end of a URL, it’s called Reflected XSS Attack. It’s like throwing a ball
against a wall and receive him back.
►Stored XSS Attack:
Is when an injected XSS script is stored permanently on a website, for example in a guestbook or bulletin board. Stored XSS hit’s everyone who just reaches the site with the malicious code.How to Protect Yourself:
The primary defenses against XSS are described in the OWASP XSS Prevention Cheat Sheet.Also, it’s crucial that you turn off HTTP TRACE support on all web servers. An attacker can steal cookie data via Javascript even when document.cookie is disabled or not supported by the client. This attack is mounted when a user posts a malicious script to a forum so when another user clicks the link, an asynchronous HTTP Trace call is triggered which collects the user’s cookie information from the server, and then sends it over to another malicious server that collects the cookie information so the attacker can mount a session hijacking attack. This is easily mitigated by removing support for HTTP TRACE on all web servers.
For video tutorials watch this video.
Thanks, fo Reading.
Comments
Post a Comment