{"id":263,"date":"2018-04-01T19:47:29","date_gmt":"2018-04-01T19:47:29","guid":{"rendered":"http:\/\/malwrforensics.com\/en\/?p=263"},"modified":"2018-04-02T03:06:19","modified_gmt":"2018-04-02T03:06:19","slug":"extreme-vulnerable-node-application-xvna-reflected-cross-site-scripting-xss-step-by-step-tutorial","status":"publish","type":"post","link":"https:\/\/malwrforensics.com\/en\/2018\/04\/01\/extreme-vulnerable-node-application-xvna-reflected-cross-site-scripting-xss-step-by-step-tutorial\/","title":{"rendered":"eXtreme Vulnerable Node Application (XVNA) &#8211; reflected cross-site scripting (XSS) step by step tutorial"},"content":{"rendered":"<p>In this post we\u2019ll have a look at the nodejs XSS attack\/exploit in XVNA (eXtreme Vulnerable Node Application). Cross-site scripting is part of the\u00a0<a href=\"https:\/\/www.owasp.org\/index.php\/Category:OWASP_Top_Ten_2017_Project\">OWASP Top 10<\/a>\u00a0list that was published in 2017.<\/p>\n<p>We\u2019ll use the setup detailed\u00a0<a href=\"http:\/\/malwrforensics.com\/en\/2018\/03\/16\/step-by-step-environment-setup-for-extreme-vulnerable-node-application-xvna-security-testing\/\">here<\/a>\u00a0(XVNA runs on port 80). As a web proxy,\u00a0<a href=\"https:\/\/portswigger.net\/burp\">Burp<\/a>\u00a0or\u00a0<a href=\"https:\/\/www.owasp.org\/index.php\/OWASP_Zed_Attack_Proxy_Project\">ZAP<\/a>\u00a0are highly recommended, but you can use anything else that allows you to view\/edit\/send HTTP requests.<\/p>\n<p>From the main dashboard in XVNA, we need to go to the\u00a0<strong>A7:2017-XSS<\/strong>\u00a0section. Here we are offered the option to pick an item an check its price.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-264\" src=\"http:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss1.png\" alt=\"\" width=\"1416\" height=\"405\" srcset=\"https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss1.png 1416w, https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss1-300x86.png 300w, https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss1-768x220.png 768w, https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss1-1024x293.png 1024w\" sizes=\"auto, (max-width: 1416px) 100vw, 1416px\" \/><\/p>\n<p>If we study the request in our web proxy, we can see that the name of the item is given as a parameter to the <em>id<\/em> variable (<em>\/GET \/xss_r?id=&lt;name&gt;<\/em>).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-265\" src=\"http:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss2.png\" alt=\"\" width=\"285\" height=\"170\" \/><\/p>\n<p>Let&#8217;s search again and intercept the request. Now we can modify the request and add some javascript code. In this example we&#8217;ll use a <a href=\"https:\/\/www.owasp.org\/index.php\/Testing_for_Cross_site_scripting\">basic test<\/a>, but feel free to try other, more interesting,\u00a0<a href=\"http:\/\/www.xss-payloads.com\/payloads.html\">payloads<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-266\" src=\"http:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss3.png\" alt=\"\" width=\"430\" height=\"193\" srcset=\"https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss3.png 430w, https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss3-300x135.png 300w\" sizes=\"auto, (max-width: 430px) 100vw, 430px\" \/><\/p>\n<p>Instead of &#8220;Apple&#8221;, we now have a code that should display a popup with the message &#8220;XSS&#8221;. Once you made the changes to the request, you can forward it to the browser.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-267\" src=\"http:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss4.png\" alt=\"\" width=\"735\" height=\"376\" srcset=\"https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss4.png 735w, https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss4-300x153.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<p>Yay, it works! Let&#8217;s see why \ud83d\ude42<\/p>\n<p>The page (<em>a7_xss_reflected.html<\/em>) will display the text &#8220;<em>You have searched for &lt;search term&gt;<\/em>&#8220;. Try with another term, let&#8217;s say <em>XSS-test<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-270\" src=\"http:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss7.png\" alt=\"\" width=\"832\" height=\"479\" srcset=\"https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss7.png 832w, https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss7-300x173.png 300w, https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss7-768x442.png 768w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" \/><\/p>\n<p>If we check the a7_xss_reflected.html page, we can see that it displays the value of trustedMessage.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-268\" src=\"http:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss5.png\" alt=\"\" width=\"636\" height=\"294\" srcset=\"https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss5.png 636w, https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss5-300x139.png 300w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/p>\n<p>A quick search, reveals that the value is set in <em>a7_xss_reflected.js<\/em>, where\u00a0<em>$scope.trustedMessage<\/em>&#8216;s value isn&#8217;t sanitized.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-271\" src=\"http:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss6.png\" alt=\"\" width=\"721\" height=\"142\" srcset=\"https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss6.png 721w, https:\/\/malwrforensics.com\/en\/wp-content\/uploads\/2018\/04\/xvna_a7_xss6-300x59.png 300w\" sizes=\"auto, (max-width: 721px) 100vw, 721px\" \/><\/p>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post we\u2019ll have a look at the nodejs XSS attack\/exploit in XVNA (eXtreme Vulnerable Node Application). Cross-site scripting is part of the\u00a0OWASP Top 10\u00a0list that was published in 2017. We\u2019ll use the setup detailed\u00a0here\u00a0(XVNA runs on port 80). As a web proxy,\u00a0Burp\u00a0or\u00a0ZAP\u00a0are highly recommended, but you can use anything else that allows you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[43,68,72,25,66],"class_list":["post-263","post","type-post","status-publish","format-standard","hentry","category-security","tag-cross-site-scripting","tag-nodejs","tag-owasp","tag-xss","tag-xvna"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[]}},"featured_image_urls_v2":{"full":"","thumbnail":"","medium":"","medium_large":"","large":"","1536x1536":"","2048x2048":""},"post_excerpt_stackable_v2":"<p>In this post we\u2019ll have a look at the nodejs XSS attack\/exploit in XVNA (eXtreme Vulnerable Node Application). Cross-site scripting is part of the\u00a0OWASP Top 10\u00a0list that was published in 2017. We\u2019ll use the setup detailed\u00a0here\u00a0(XVNA runs on port 80). As a web proxy,\u00a0Burp\u00a0or\u00a0ZAP\u00a0are highly recommended, but you can use anything else that allows you to view\/edit\/send HTTP requests. From the main dashboard in XVNA, we need to go to the\u00a0A7:2017-XSS\u00a0section. Here we are offered the option to pick an item an check its price. If we study the request in our web proxy, we can see that the name&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/malwrforensics.com\/en\/category\/security\/\" rel=\"category tag\">Security<\/a>","author_info_v2":{"name":"malwrforensics","url":"https:\/\/malwrforensics.com\/en\/author\/u_malwrforensics\/"},"comments_num_v2":"0 comments","_links":{"self":[{"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/posts\/263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/comments?post=263"}],"version-history":[{"count":4,"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/posts\/263\/revisions"}],"predecessor-version":[{"id":274,"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/posts\/263\/revisions\/274"}],"wp:attachment":[{"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/media?parent=263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/categories?post=263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/tags?post=263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}