首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏Dotnet Dancer

    超越边界:利用C#实现跨服务器的进程管理

    runspace = RunspaceFactory.CreateRunspace(connectionInfo)) { runspace.Open(); using (PowerShell ps = PowerShell.Create()) { ps.Runspace = runspace; runspace = RunspaceFactory.CreateRunspace(connectionInfo)) { runspace.Open(); runspace = RunspaceFactory.CreateRunspace(connectionInfo)) { runspace.Open(); using (PowerShell ps = PowerShell.Create()) { ps.Runspace = runspace;

    33510编辑于 2024-08-13
  • 来自专栏FreeBuf

    PowerShell 技术在网络安全测试中的应用

    AddArgument(3) $powershell.RunspacePool = $runspacePool $handle = $powershell.BeginInvoke() 1.创建 Runspace 这个方法接受两个参数,分别是池中最小和最大的 Runspace 数量。这里设定的是池中至少有1个 Runspace,最多有5个 Runspace。 第二行调用Open()方法开启 Runspace 池,使其准备好接受任务。 () powershell.RunspacePool = runspacePool这行代码将之前创建的 PowerShell 实例与 Runspace 池关联起来。 这样,这个 PowerShell 实例就可以使用 Runspace 池中的一个 Runspace 来执行。

    1K10编辑于 2024-07-10
  • 来自专栏张善友的专栏

    IronPython整合Windows PowerShell

    to execute powershell commands within _runspace = RunspaceFactory.CreateRunspace() _runspace.Open() _intrinsics = _runspace.SessionStateProxy.GetVariable("ExecutionContext") def translate(name): ''' ''' self.meth = meth def __call__(self, *args): ''' ''' return self.meth.Invoke(*args) def init_runspace __dict__.update(cmds) init_runspace() if __name__ == '__main__': print """Run \'dir(shell)\' to get commands are accessed using the form: shell.get_process("cmd").select(First=2) """ PowerShell里面有几个对象:RunSpace

    1.4K70发布于 2018-01-30
  • 来自专栏数据分析

    C# 调用PowerShell方法

    string script =File.ReadAllText(@"Path\Sum.ps1"); 2 private static void CallPS1() 3 { 4 using (Runspace runspace = RunspaceFactory.CreateRunspace()) 5 { 6 runspace.Open(); 7 8 PowerShell ps = PowerShell.Create(); 9 ps.Runspace = runspace; 10 ps.AddScript(script

    4K40发布于 2018-03-01
  • 来自专栏信安之路

    手把手带你开发一款 IIS 模块后门

    powershell pscmd = Encoding.UTF8.GetString(Convert.FromBase64String(pscmd)); Runspace runspace = RunspaceFactory.CreateRunspace(); runspace.Open(); Pipeline pipeline = runspace.CreatePipeline(); pipeline.Commands.AddScript(pscmd); pipeline.Commands.Add ("Out-String"); Collection<PSObject> results = pipeline.Invoke(); runspace.Close

    2.1K30发布于 2019-09-17
  • 来自专栏FreeBuf

    如何绕过PowerShell访问限制并实现PowerShell代码执行

    Environment.Exit(2); } return buffer; } private static string RunScript(string script) { Runspace sb.AppendLine(pobject.ToString()); } return sb.ToString(); } } } 其中的RunScript()方法会创建一个“runspace

    2.7K30发布于 2019-12-10
  • 来自专栏kayden

    权限提升分析及防御

    = [Advapi32]::DuplicateToken($SysTokenHandle, 2, [ref]$hDuplicateTokenHandle) # Simple PS runspace definition echo "[>] Starting token race" $Runspace = [runspacefactory]::CreateRunspace () $StartTokenRace = [powershell]::Create() $StartTokenRace.runspace = $Runspace $Runspace.Open() [void]$StartTokenRace.AddScript({ Param ($Thread, $hDuplicateTokenHandle ProcessInfo.hProcess) $CallResult = [Kernel32]::CloseHandle($ProcessInfo.hThread) } # Kill runspace

    2K20编辑于 2022-09-29
  • 来自专栏重生信息安全

    UnmanagedPowerShell工具分析

    state.AuthorizationManager = null; // Bypass PowerShell execution policy 绕过PowerShell执行策略 //RunspaceFactory--定义用于创建Runspace 对象的工厂类 //使用指定的PSHost和InitialSessionState创建运行空间 using (Runspace runspace = RunspaceFactory.CreateRunspace runspace.Open(); //Create an empty pipeline using (Pipeline pipeline = runspace.CreatePipeline()) { /

    2.9K10发布于 2020-03-06
  • 来自专栏FreeBuf

    SharpStrike:基于C#实现的后渗透漏洞利用研究工具

    execute (upload/download, enable/disable WinRM) ** Denotes PowerShell usage (either using a PowerShell Runspace

    75810发布于 2021-10-11
  • 来自专栏张善友的专栏

    CentOS 7 上面安装PowerShell

    New-ItemProperty Cmdlet Microsoft.PowerShell.Management New-Item Cmdlet Microsoft.PowerShell.Management Get-Runspace Disable-PSSessionConfiguration Cmdlet Microsoft.PowerShell.Core Disable-PSBreakpoint Cmdlet Microsoft.PowerShell.Utility Debug-Runspace

    1.9K80发布于 2018-01-19
  • 来自专栏全栈工程师修炼之路

    PS对象处理操作常用命令

    Property string Name {get;} # PrivateData Property psobject PrivateData {get;} # Runspace Property runspace Runspace {get;} # UI Property System.Management.Automation.Host.PSHostUserInterface

    10.7K11编辑于 2022-09-29
  • 来自专栏TeamsSix的网络空间安全专栏

    内网学习笔记 | 2、PowerShell

    Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy DebuggerEnabled : True IsRunspacePushed : False Runspace

    1.9K20发布于 2021-03-05
  • 来自专栏安恒网络空间安全讲武堂

    浅谈Python在CTF中的运用

    一、p0wnedShell – PowerShell Runspace 漏洞利用后期工具包 ?

    3K31发布于 2019-03-08
  • 来自专栏全栈工程师修炼之路

    PS命令之操作系统远程管理及进程服务操作示例

    - ---- --------- ------------ ------------ ----- ----------------- ------------ # 1 Runspace1

    8.4K40编辑于 2022-09-29
  • 来自专栏全栈工程师修炼之路

    2.Powershell基础入门学习必备语法介绍

    Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy DebuggerEnabled : True IsRunspacePushed : False Runspace

    6.8K10编辑于 2022-09-29
  • 来自专栏TeamsSix的网络空间安全专栏

    【建议收藏】历时一年的内网学习笔记合集

    Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy DebuggerEnabled : True IsRunspacePushed : False Runspace

    4.1K10编辑于 2022-09-20
领券