- title: Empty User Agent
id: 21e44d78-95e7-421b-a464-ffd8395659c4
status: experimental
description: Detects suspicious empty user agent strings in proxy logs
references:
- https://twitter.com/Carlos_Perez/status/883455096645931008
author: Florian Roth
logsource:
category: proxy
product: null
service: null
detection:
selection:
c-useragent: ''
condition: selection
fields:
- ClientIP
- c-uri
- c-useragent
falsepositives:
- Unknown
level: medium
In [ ]:
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
import pandas as pd
In [ ]:
es = Elasticsearch(['http://helk-elasticsearch:9200'])
searchContext = Search(using=es, index='logs-*', doc_type='doc')
In [ ]:
s = searchContext.query('query_string', query='c-useragent:""')
response = s.execute()
if response.success():
df = pd.DataFrame((d.to_dict() for d in s.scan()))
In [ ]:
df.head()