1

内网渗透—Windows Powershell基础 | Dar1in9's Blog

 1 year ago
source link: https://dar1in9s.github.io/2022/03/11/%E6%B8%97%E9%80%8F/%E5%86%85%E7%BD%91%E6%B8%97%E9%80%8F%E2%80%94Windows%20Powershell%E5%9F%BA%E7%A1%80/#PowerShell%E5%9F%BA%E6%9C%AC%E6%A6%82%E5%BF%B5
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
内网渗透—Windows Powershell基础
2022-03-11|渗透
字数总计: 332|阅读时长: 1 分钟

“内网渗透”这一整块的学习是《内网安全攻防——渗透测试实战指南》的学习笔记。

Windows Powershell是一种命令行shell程序和脚本环境,它内置在Windows7、windows server 2008R2 及更高版本中。

PowerShell基本概念

.ps1文件:一个powershell脚本就是一个文本文件,扩展名为ps1。其内容包含了一系列powershell命令,每个命令显示为独立的一行。

执行策略:为了防止使用者运行恶意脚本,powershell提供了一个执行策略。使用Get-ExecutionPolicy可以查询:

  • AllSigned:仅当脚本由受信任的发布者签名时才能运行

  • RemoteSigned:在本地创建的脚本可以运行,但从网上下载的脚本只有拥有数字签名证书的才能运行

  • Restricted:允许单独的命令,但不允许脚本。
    Windows 客户端计算机的默认执行策略。

  • Unrestricted:允许所有脚本运行

可以使用Set-ExecutionPolicy <policy name>来设置执行策略。

管道:管道的作用是将一个命令的输出作为另一个命令的输入,两个命令之间用“|”连接

PowerShell常用命令

在powershell中,命令被称为cmdlet。命令规范采用“动词-名词”的形式,例如New-Item。动词一般为AddNewGetRemoveSet等。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK