tag:blogger.com,1999:blog-8539880144347728238.post5073978114207192653..comments2024-01-24T04:15:08.086-05:00Comments on Carnal0wnage Blog: Run a PowerShell module in MeterpreterUnknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8539880144347728238.post-30025744479795752752012-10-13T15:29:40.131-04:002012-10-13T15:29:40.131-04:00Set-ExecutionPolicy requires admin privileges; on ...Set-ExecutionPolicy requires admin privileges; on the other hand<br /><br /><i>powershell -NoProfile -ExecutionPolicy Unrestricted .\script.ps1</i><br /><br />works fine even without admin privileges.<br /><br />Note that the default PowerShell host (ConsoleHost) depends a lot on having a native console available - even executing a console application or trying to read input is done via the native console instead of using standard input/output streams.<br /><br />An alternative might be to implement an alternative Host class, like <a href="http://pastebin.com/rMM5REti" rel="nofollow">my StreamHost</a>.<br /><br />I tried to implement that as a PowerShell script, but failed due to the fact I could not read from the standard<br />input stream without hanging the ConsoleHost that is used to execute the script.<br /><br />Maybe someone else is more successful there.mihihttp://twitter.com/mihi42noreply@blogger.comtag:blogger.com,1999:blog-8539880144347728238.post-31008429417598189982012-10-11T15:36:25.855-04:002012-10-11T15:36:25.855-04:00Would something like this work:
C:\WINDOWS\system...Would something like this work:<br /><br /><i>C:\WINDOWS\system32\cmd.exe /c powershell -command `"& {Set-ExecutionPolicy Unrestricted -Force}`" && powershell -File `"C:\sript1.ps1`"</i>Russel Van Tuylhttps://www.blogger.com/profile/05886073679303764153noreply@blogger.com