黑客入门 Powershell - 第一部分 Powershell 是什么?Powershell 中的 cmdlet?Powershell 命令 vs Linux 终端命令:Powershell 中的 Get-help?

2025-06-07

黑客的 Powershell - 第一部分

什么是 Powershell?

Powershell 中的 cmdlet?

Powershell 命令与 Linux 终端命令

在 Powershell 中获取帮助?

替代文本
欢迎回来,我有抱负的黑客们,这是一系列的 Powershell,将向你们解释命令行的威力!让我们开始吧!!
众所周知,作为一名职业黑客(白帽、黑帽),你需要精通 Linux 及其衍生产品。这是有原因的。
[!0]Linux 是一个开源操作系统,大多数黑客工具都是内置的 Linux。
[!1]除了 Windows 中的 cmd.exe 之外,Linux 的终端可以完全控制操作系统。
由于这几个原因,作为黑客/渗透测试人员,我们相信 Linux 为我们的渗透测试任务提供了良好的环境,但近年来,微软似乎在 Linux 的命令行和终端的优势方面获得了信仰。最后,现在他们似乎了解了命令行的优势和优点,作为回应,windows powershell应运而生。

什么是 Powershell?

替代文本
PowerShell 是一种基于任务的命令行 Shell 和脚本语言,构建于 .NET 之上。PowerShell 可帮助系统管理员和高级用户快速自动执行管理操作系统(Linux、macOS 和 Windows)和进程的任务。PowerShell 命令允许您通过命令行管理计算机。
注:有关 PowerShell 历史的更多详细信息,请访问维基百科。

Powershell 中的 cmdlet?

替代文本
Cmdlet 是 PowerShell 环境中用于实现特定功能的专用命令。Cmdlet 类似于 Linux 终端中的命令。Windows
PowerShell 与 Linux 中的 BASH Shell 之间的一个主要区别在于,Microsoft 为 PowerShell 开发了 cmdlet(命令集)。这些 cmdlet 是单个命令,有时可以完成类似于函数的更复杂的任务。这些 cmdlet 采用动词-名词的形式,例如“get-help”。

Powershell 命令与 Linux 终端命令

Linux 和 powershell 中有一些相同的主要命令,但它们在渗透测试领域都有各自的优势,例如,cat 命令在 Linux 中用于从文件中读取数据并将其内容作为输出,此命令在 powershell 中也有效。

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Loading personal and system profiles took 703ms.
C:\windows\system32> cat

cmdlet Get-Content at command pipeline position 1
Supply values for the following parameters:
Path[0]:
Enter fullscreen mode Exit fullscreen mode

在 Powershell 中获取帮助?

获取 power-shell 中某个重要且基础的命令的帮助,尤其是在您想将 powershell 用作黑客框架或工具时,此命令将对您非常有帮助。Get-help 可让您找到任何特定命令的完整帮助信息,并附带详细示例。
注意:例如,PowerShell 中有一个命令“invoke-psnmap”,它是一个 nmap 包装器,用作端口扫描器,如果您不知道如何使用它,则可以使用“get-help”。

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Loading personal and system profiles took 908ms.
C:\Users\HP> get-help invoke-psnmap

NAME
    Invoke-PSnmap
Enter fullscreen mode Exit fullscreen mode

替代文本

这是“渗透测试人员的 Powershell”系列的第一部分,其中包含一些关于 Powershell 命令的基本信息,感谢您访问本博客。
在下一部分中,我将讲解 Powershell 中的一些重要命令,这些命令将帮助您在 Windows 系统中轻松执行渗透任务,而无需使用 Linux。

本系列仅面向黑客初学者,敬请欣赏并支持我,请在 GitHubTwitter
上关注我,并访问ankitdobhal.github.io
替代文本

文章来源:https://dev.to/powerexploit/powershell-for-hackers-part-1-39l3
PREV
哇!10行代码就能抓取维基百科内容!让我们编写Python脚本来抓取维基百科内容或用于维基百科搜索器:
NEXT
100个带有CSS渐变的背景图案