我正在尝试创建一个概念证明,这是我在我的网络安全课程中看到的一个例子。我已经设置好了所需的文件并尝试运行,但是一直出现错误。
这是示例:
C:\> type C:\windows\system32\notepad.exe > c:\windows\system32\calc.exe:notepad.exe
这是我所做的事情:
C:\> type c:\hello.exe > c:\README.txt:hello.exe
这里有一个可执行文件 hello.exe
,它会输出 hello world
,还有一个文本文件 README.txt
,里面包含一些随机文本。
我遇到的错误是:
out-file: The given path's format is not supported.
当第一个参数和重定向操作符之间有空格时,
Get-Content : A positional parameter cannot be found that accepts argument 'C:\README.txt:hello.exe'.
当没有空间时。
我已经尝试用cat
代替type
,在运算符之间添加和删除空格,在尝试导入数据之前创建备用流以及使用不同的文件类型。另外,一个相关问题是,我无法在NTFS文件上使::$DATA
起作用。它只会显示cat : Cannot find path 'C:\hello.exe::' because it does not exist.