识别
格式识别
graphql
向/graphql路径发请求,请求格式类似json但是非json,并非key value对应。
POST /graphql
{
me {
name
}
}
restful
以swagger为典型,用的比较多,传输格式为json、xml、urlencode等。
soap
post请求包格式如下:
<?xml
version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
</soap:Header>
<soap:Body>
<soap:Fault>
</soap:Fault>
</soap:Body>
</soap:Envelope>
gRPC
HTTP2,需要分析一下数据包。https://github.com/nevermoe/protobuf_decoder,根据分析,其实grpc和其他技术并无区别,可以先将protobuf格式转为json
路径识别
swagger
/swagger
/api/swagger
/swagger/ui
/api/swagger/ui
/swagger-ui.html
/api/swagger-ui.html
/user/swagger-ui.html
/libs/swaggerui
/api/swaggerui
/swagger-resources/configuration/ui
/swagger-resources/configuration/security
/api-docs
/v2/api-docs
/v1/api-docs
/api.html
/sw/swagger-ui.html
/template/swagger-ui.html
/spring-security-rest/api/swagger-ui.html
/spring-security-oauth-resource/swagger-ui.html
/v1.x/swagger-ui.html
/swagger/index.html
https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/swagger.txt
springboot actuator
/mappings
/actuator/mappings
/metrics
/actuator/metrics
/beans
/actuator/beans
/configprops
/actuator/configprops
/actuator/env
/jolokia/list
/actuator
/auditevents
/autoconfig
/caches
/conditions
/docs
/dump
/env
/flyway
/health
/heapdump
/httptrace
/info
/intergrationgraph
/jolokia
/logfile
/loggers
/liquibase
/prometheus
/refresh
/scheduledtasks
/sessions
/shutdown
/trace
/threaddump
/actuator/auditevents
/actuator/health
/actuator/conditions
/actuator/info
/actuator/loggers
/actuator/heapdump
/actuator/threaddump
/actuator/scheduledtasks
/actuator/httptrace
/actuator/jolokia
/actuator/hystrix.stream
/hystrix.stream
https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/spring-boot.txt
graphql
https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/graphql.txt
https://github.com/dolevf/nmap-graphql-introspection-nse/blob/6594cce7b590a7194641494ed33c018d9ecd6b89/graphql-introspection.nse#L47
/graphql
/graphiql
soap
/webservices
/webservice
/services
/service
/xxx?wsdl
odata
/$metadata
wadl
/application.wadl
/application.wadl?detail=true
/api/application.wadl
https://github.com/dwisiswant0/wadl-dumper
漏洞扫描
被动+主动相结合,个人认为除了接口泄露、CORS之类的漏洞,其他主要都是靠被动扫描出货(实战)
接口泄露模块(主动)
graphql
内省查询,默认情况下可以暴露出对象定义、接口参数等信息。
/graphsql
{
__schema {
types {
name
}
}
}
https://mp.weixin.qq.com/s/gp2jGrLPllsh5xn7vn9BwQ
基础工具graphiql等,可以直接执行。
https://github.com/dolevf/nmap-graphql-introspection-nse/blob/6594cce7b590a7194641494ed33c018d9ecd6b89/graphql-introspection.nse#L47
soap
访问/service 等地址后可以获取全部接口名称,比如UserDetailsService,则访问/service/UserDetailsService?wsdl可获取soap接口详细信息。
swagger
访问到/swagger.html 等地址后,可获取全部接口信息。
https://github.com/lijiejie/swagger-exp/blob/master/swagger-exp.py
未授权访问模块(主动)
拿到接口文档之后可以遍历一下接口,看看是否需要token,如果不需要则是未授权访问。
dos模块(需要结合实际情况)
看接口是不是耗高资源,修改某些值到很大导致资源消耗巨大dos,反复请求dos,graphql嵌套查询dos。
不是很好写自动化。
注入模块(主动+被动)
对api接口的各种参数进行fuzz,sql注入、命令注入等等。对于xml-rpc请求包可以被动进行xxe扫描。
越权访问模块(被动)
对于带token的请求,被动获取到请求包之后修改参数进行访问。
信息泄露模块(一直开着)
检测返回包是否有敏感信息。
https://github.com/gh0stkey/HaE
误报是一个问题。
gRPC fuzz(被动)
对于gRPC的请求,解码之后修改参数看返回,可结合注入模块和越权访问模块。
https://github.com/trailofbits/protofuzz
认证安全(被动)
jwt 爆破key、不安全的算法、修改为空,等等。
oauth url跳转、csrf、xss
杂七杂八(被动)
cors、不安全的http协议,
java鉴权绕过fuzz
针对于java应用的url进行fuzz鉴权绕过 类似于/..;/ 、;.css 等
暂时无法在文档外展示此内容
js中的接口泄露
类似于下面几个项目,从js中找到泄露的接口,可以很好的集成优化一下。
yarri/LinkFinder
https://github.com/Threezh1/JSFinder
https://github.com/p1g3/JSINFO-SCAN
数据解析库的识别
识别后端解析数据用的是什么库,比如fastjson,xstream等,如果有的话可能有反序列化漏洞