Citrix Netscaler, Application Delivery Controller and Citrix Gateway Attack CVE-2019-19781

Detects CVE-2019-19781 exploitation attempt - URI contains /vpn/../vpns/

Rule Content

- title: Citrix Netscaler, Application Delivery Controller and Citrix Gateway Attack
    CVE-2019-19781
  description: Detects CVE-2019-19781 exploitation attempt - URI contains /vpn/../vpns/
  id: ac5a6409-8c89-44c2-8d64-668c29a2d756
  references:
  - https://support.citrix.com/article/CTX267679
  - https://support.citrix.com/article/CTX267027
  author: Arnim Rupp
  status: experimental
  date: 2020/01/02
  logsource:
    category: webserver
    product: null
    service: null
  detection:
    selection:
      c-uri-path: '*/vpn/../vpns/*'
    condition: selection
  fields:
  - client_ip
  - vhost
  - url
  - response
  falsepositives:
  - Unknown
  level: critical

Querying Elasticsearch

Import Libraries


In [ ]:
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
import pandas as pd

Initialize Elasticsearch client


In [ ]:
es = Elasticsearch(['http://helk-elasticsearch:9200'])
searchContext = Search(using=es, index='logs-*', doc_type='doc')

Run Elasticsearch Query


In [ ]:
s = searchContext.query('query_string', query='c-uri-path.keyword:*\/vpn\/..\/vpns\/*')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()