XSS Flashcards

1
Q

What are the 3 types of XSS?

A

Reflected
Stored
Dom-based

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is reflected XSS?

A

When an application recieves data in a HTTP request and includes that data within the immediate response in an unsafe way

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is stored XSS?

A

When an application recieves data from an untrusted source and includes that data within its later response in an unsafe way

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Dom-base xss?

A

When an application contains some client-side Javascript that processes data from an untrusted source in an unsafe way, usually by writting the data back into the dom

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is XSS used for?

A
  • impersonate as the victim user
  • carry out any actions the user is able to perform
  • read any data the user is able to access
  • capture the users login creds
  • perform virtual defacement of the web site
  • inject trojan functionalities into the web site
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can XSS vulnerabilites be prevented?

A
  • Filter/ sanatise input on arrival
  • encode data on output
  • use appropriate response headers
  • content security policy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What areas of a web app do you test for reflected XSS?

A
  • every entry point for data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you test for reflected XSS?

A

1) submit random alphanumeric values into each entry point - to determine if the value is reflected in the response.
2) determine the reflection context - what is the location of the reflected value? Is it quoted within a javascript string?
3) test a candidate payload that will trigger Javascript execution if it is reflected unmodified within the response
4) test alternative payloads - if it was blocked or modified then try different payloads
5) test the attack in a browser - if one works in burp try it on the webpage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a simple Javascript to use in a reflected XSS attack that would trigger a visible pop-up?

A

‘alert(document.domain)’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What carrying out a stored XSS where are some areas that could be poteitnally vulnerable?

A
  • comments section
  • user nicknames in a chat room
  • contact detials on a customer order
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

If vulnerable to storded XSS where might you recieve data from untrusted sources?

A
  • a wemail application displaying messages recieved over SMTP
  • a marketing application displaying social media posts
  • a network monitoring application displaying packet dats from network traffic.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What string could you input to test if a webapp is vulnerable to stored XSs?

A

alert(1) or <><img></img>.src=1.onerror.=.alert(1)>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a Content Security Policy

A

A browser mechanism that aims to mitigate the impact of cross-site scripting and some other vulnerabilities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When testing or a stored XSS vulnerabilitry what entry points might you test?

A
  • parameters or other data within the URL query string and message body
  • the URL file path
    HTTP request headers that might not be exploitable
  • any out-of-band routes via which an atacker can deliver data into the application.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does a content security policy work?

A

If an app that employs a CSP contains XXS-like behaviour, then the CSP might hinder or preventexploitation of the vulnerability.
Often the CSP can be circumvented (worked around) to enable exploitation of the underlying vulnerability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is Dangling markup injection?

A

A technique that can be used to capture data cross-domain in situations where a full XSS exploit is not possible due to input filters or other defences.

17
Q

What can dengling markup injection be used for?

A

To capture sensitive information that is visible to other users - including CSRF tokens that can be used to perform unauthorized actions on behalf of the user.

18
Q

What is a CSRF token?

A

A unique, secret, unpredictable value that is generated by the server-side application and transmitted to the client in such a way that it is included in a subsequent HTTP request made by the client

19
Q

What is a sink?

A

Sinks are the places where untrusted data coming from the sources is actually getting executed resulting in DOM XSS.

20
Q

How can you test for a HTML sink?

A
  • place a random alphanumeric string into the source (eg location.search )
  • use developer tools to inspect the HTML and find where your string appears.
  • for each of the areas the string appears, identify the context
  • base dog the context you need to refine the input to see how it is processed. EG if string appears within double-quotes attribute then try to inject double quotes in your string to see if you can break out of the attribute.
21
Q

Whats the difference between a HTML and Javascript execution sink?

A
  • HTML sink - your input appears within the DOM
  • Javascript execution sink - your input doesnt necessarily appear anywhere within the DOM - so you cannot search for it.
22
Q

How do you determine whether your input is sent to a JavaScript execution sink?

A

Use the JavaScript debugger to determine wheather and hoe your input is sent to a sink.

23
Q

How do you test for a JavaScript execution sink?

A
  • for each potential source find cases within ther pages JavaScript code where the source is being referenced.
  • use the JavaScript debugger to add a break point and follow how the sources value is used.
  • if the source gets assigned to other variables youll need to use the search function again to track these variables and see if they are passed to a sink.
  • when a sink that is being assigned data that origniates from the source , use the debugger to inspect the value by hovering over the variable to show its value before it is sent to the sink.
  • then refine the input to see if you can deliver a successful XSS attack.