1 | 1 | | # PowerShdll |
2 | 2 | | Run PowerShell with dlls only. |
| 3 | + | |
3 | 4 | | Does not require access to powershell.exe as it uses powershell automation dlls. |
4 | 5 | | |
| 6 | + | PowerShdll can be run with: rundll32.exe, installutil.exe, regsvcs.exe, regasm.exe, regasm.exe. |
| 7 | + | |
5 | 8 | | ## dll mode: |
6 | 9 | | |
| 10 | + | ### Rundll32: |
7 | 11 | | ``` |
8 | 12 | | Usage: |
9 | 13 | | rundll32 PowerShdll,main <script> |
| 14 | + | rundll32 PowerShdll,main -h Display this message |
10 | 15 | | rundll32 PowerShdll,main -f <path> Run the script passed as argument |
11 | | - | rundll32 PowerShdll,main -w Start an interactive console in a new window |
| 16 | + | rundll32 PowerShdll,main -w Start an interactive console in a new window (Default) |
12 | 17 | | rundll32 PowerShdll,main -i Start an interactive console in this console |
| 18 | + | If you do not have an interractive console, use -n to avoid crashes on output |
13 | 19 | | ``` |
14 | | - | |
15 | | - | ## exe mode |
| 20 | + | ### Alternatives (Credit to SubTee for these techniques): |
16 | 21 | | |
17 | 22 | | ``` |
18 | | - | Usage: |
19 | | - | PowerShdll.exe <script> |
20 | | - | PowerShdll.exe -f <path> Run the script passed as argument |
21 | | - | PowerShdll.exe -i Start an interactive console in this console |
| 23 | + | 1. |
| 24 | + | x86 - C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe /logfile= /LogToConsole=false /U PowerShdll.dll |
| 25 | + | x64 - C:\Windows\Microsoft.NET\Framework64\v4.0.3031964\InstallUtil.exe /logfile= /LogToConsole=false /U PowerShdll.dll |
| 26 | + | 2. |
| 27 | + | x86 C:\Windows\Microsoft.NET\Framework\v4.0.30319\regsvcs.exe PowerShdll.dll |
| 28 | + | x64 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regsvcs.exe PowerShdll.dll |
| 29 | + | 3. |
| 30 | + | x86 C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe /U PowerShdll.dll |
| 31 | + | x64 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /U PowerShdll.dll |
| 32 | + | 4. |
| 33 | + | regsvr32 /s /u PowerShdll.dll -->Calls DllUnregisterServer |
| 34 | + | regsvr32 /s PowerShdll.dll --> Calls DllRegisterServer |
22 | 35 | | ``` |
23 | 36 | | |
24 | | - | ## Known Issues |
25 | | - | |
26 | | - | Some errors do not seem to show in the output. May be confusing as commands such as Import-Module do not output an error on failure. |
27 | | - | Make sure you have typed your commands correctly! |
28 | | - | |