Cisco - vmanage
Cisco - vmanage
Yol 1
(Örnek https://www.synacktiv.com/en/publications/pentesting-cisco-sd-wan-part-1-attacking-vmanage.html adresinden alınmıştır)
Biraz belgelere göz attıktan sonra, confd
ve farklı ikili dosyalarla ilgili (Cisco web sitesindeki bir hesapla erişilebilir) bazı belgelere göre, IPC soketini kimlik doğrulamak için /etc/confd/confd_ipc_secret
konumunda bir gizli kullanıldığını bulduk:
Hatırlayın, Neo4j örneğimiz var mı? Bu, vmanage
kullanıcısının ayrıcalıkları altında çalışıyor, bu da bize önceki zafiyeti kullanarak dosyayı almayı sağlıyor:
confd_cli
programı komut satırı argümanlarını desteklemez, ancak /usr/bin/confd_cli_user
'ı argümanlarla çağırır. Bu nedenle, kendi argüman setimizle /usr/bin/confd_cli_user
'ı doğrudan çağırabiliriz. Ancak mevcut yetkilerimizle okunabilir değil, bu yüzden rootfs'ten alıp scp kullanarak kopyalamamız, yardımı okumamız ve kabuğu elde etmek için kullanmamız gerekiyor:
Yol 2
Synacktiv ekibinin blog¹'ünde, bir root kabuğu elde etmek için zarif bir yol tarif edilmiştir, ancak dezavantajı yalnızca root tarafından okunabilen /usr/bin/confd_cli_user
kopyasını elde etmeyi gerektirmesidir. Ben, bu tür zorluklar olmadan root ayrıcalığına yükseltmek için başka bir yol buldum.
/usr/bin/confd_cli
ikili dosyasını parçaladığımda aşağıdakileri gözlemledim:
"ps aux" komutunu çalıştırdığımda aşağıdakileri gözlemledim (not -g 100 -u 107)
Ben, "confd_cli" programının, giriş yapmış kullanıcıdan topladığı kullanıcı kimliği ve grup kimliğini "cmdptywrapper" uygulamasına ilettiğini varsaydım.
İlk denemem, "cmdptywrapper"ı doğrudan çalıştırmak ve ona -g 0 -u 0
sağlamaktı, ancak başarısız oldu. Görünüşe göre bir dosya tanımlayıcısı (-i 1015) yolda bir yerde oluşturuldu ve onu sahteleyemiyorum.
Synacktiv'in blogunda belirtildiği gibi (son örnek), confd_cli
programı komut satırı argümanını desteklemiyor, ancak onu bir hata ayıklayıcıyla etkileyebilirim ve neyse ki sistemde GDB bulunuyor.
API'yi zorlamak için bir GDB betiği oluşturdum ve getuid
ve getgid
işlevlerinin 0 değerini döndürmesini sağladım. Zaten deserializasyon RCE aracılığıyla "vmanage" ayrıcalığına sahip olduğum için, /etc/confd/confd_ipc_secret
dosyasını doğrudan okuma iznim var.
root.gdb:
Cisco vManage
Introduction
Cisco vManage is a cloud-based network management platform that provides centralized control and monitoring of Cisco SD-WAN devices. It allows network administrators to configure, monitor, and troubleshoot their SD-WAN infrastructure.
Privilege Escalation
Default Credentials
Cisco vManage uses default credentials for initial access. The default username is admin
and the default password is admin
. It is important to change these default credentials to prevent unauthorized access.
Command Injection
Cisco vManage is vulnerable to command injection attacks. An attacker can exploit this vulnerability by injecting malicious commands into user input fields. This can lead to remote code execution and privilege escalation.
To exploit this vulnerability, an attacker needs to identify the vulnerable input fields and inject the malicious commands. This can be done by analyzing the application's source code or by using automated tools like Burp Suite.
Once the attacker successfully injects the malicious commands, they can execute arbitrary commands on the underlying operating system with the privileges of the application.
File Upload
Cisco vManage allows users to upload files for various purposes. However, it does not properly validate the uploaded files, which can lead to privilege escalation.
An attacker can exploit this vulnerability by uploading a malicious file that contains a payload. Once the file is uploaded, the attacker can trigger the payload to execute arbitrary commands on the underlying operating system with the privileges of the application.
To exploit this vulnerability, an attacker needs to identify the file upload functionality and upload a malicious file. This can be done by analyzing the application's source code or by using automated tools like Burp Suite.
Remote Code Execution
Cisco vManage is vulnerable to remote code execution attacks. An attacker can exploit this vulnerability by injecting malicious code into user input fields or by uploading a malicious file.
To exploit this vulnerability, an attacker needs to identify the vulnerable input fields or the file upload functionality. Once the attacker successfully injects the malicious code or uploads the malicious file, they can execute arbitrary commands on the underlying operating system with the privileges of the application.
Conclusion
Privilege escalation in Cisco vManage can be achieved through default credentials, command injection, file upload, and remote code execution vulnerabilities. It is important to secure Cisco vManage by changing the default credentials, implementing input validation, and properly validating uploaded files. Regular security assessments and patching are also recommended to mitigate these vulnerabilities.
Last updated