Skriven av: Bede | den 8 november 2018 Kl 21:58
|
Har sökt en del om xss (Cross site scripting) och har stötte främst på Response.AddHeader "x-xss-protection", "1" som förslag på skydd. Då trillade jag över denna kodsnutt.
Jag undrar helt enkelt vad som menas med alla rader.
Kod:
<%@ EnableSessionState="False"%> <%@ LANGUAGE="VBSCRIPT"%> <%Option Explicit %> <% Response.ExpiresAbsolute=#July 7,2001 12:00:00# Response.AddHeader "Pragma", "no-cache" Response.AddHeader "cache-control","no-store" Response.AddHeader "Access-Control-Allow-Origin","*" Response.AddHeader "Access-Control-Expose-Headers","server-name,translateorigin" Response.AddHeader "x-content-type-options", "nosniff" Response.AddHeader "x-frame-options", "SAMEORIGIN" Response.AddHeader "x-xss-protection", "1" Response.Buffer = True Response.ContentType = "text/html" Response.Charset= "UTF-8" Response.CodePage = 65001 Session.LCID=1036 %>
EnableSessionState = ? LANGUAGE = Scriptspråk
Option Explicit = Att alla variablar måste defineras (med dim)
Response.ExpiresAbsolute = specifies the date and time at which a page cached on a browser expires
Response.AddHeader "Pragma", "no-cache" = typ samma som ovan
Response.AddHeader "cache-control","no-store" = typ samma som ovan
Response.AddHeader "Access-Control-Allow-Origin","*" = förstår inte, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
Response.AddHeader "Access-Control-Expose-Headers","server-name,translateorigin" = jag förstår nog inte headers alls över lag, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers
Response.AddHeader "x-content-type-options", "nosniff" = Vad är MIME?? https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
Response.AddHeader "x-frame-options", "SAMEORIGIN" = Att iframes endast kan läsas från samma domän??? - The page can only be displayed in a frame on the same origin as the page itself. The spec leaves it up to browser vendors to decide whether this option applies to the top level, the parent, or the whole chain, although it is argued that the option is not very useful unless all ancestors are also in the same origin (see bug 725490). Also see Browser compatibility for support details.
Response.AddHeader "x-xss-protection" = Enables XSS filtering (usually default in browsers). If a cross-site scripting attack is detected, the browser will sanitize the page (remove the unsafe parts).
Response.Buffer = When the output is buffered, the server will hold back the response to the browser until all of the server scripts have been processed, or until the script calls the Flush or End method.
Response.ContentType = "text/html" = Vilket visningsformat för användaren.
Response.Charset= "UTF-8" = Specifies the character encoding for the HTML document.
Response.CodePage = 65001 = Teckenregister, men tycker det är samma som utf-8??
LCID = Changing, Date, Time, and Currency Format
Tycker att många av dessa är lika, är det för att de tas emot olika av nyare och äldre läsare? Räcker detta att exekvera i asp eller måste de även skrivas i metataggar? Samt är det något nödvändigt/bra att ha som fattas?
Redigerad av: Bede la till lite nya rader.
|
|