Skip to content

Instantly share code, notes, and snippets.

@gsingh93
Created December 8, 2015 15:58
Show Gist options
  • Save gsingh93/10f42f99fc43b61b461c to your computer and use it in GitHub Desktop.
Save gsingh93/10f42f99fc43b61b461c to your computer and use it in GitHub Desktop.
Check for WordPress plugin vulnerabilities
#!/usr/bin/env python2
import requests
import json
from pprint import pprint
wp_version = '4.3'
plugins = []
print '[+] Checking WordPress version ' + wp_version
res = requests.get('https://wpvulndb.com/api/v2/wordpresses/' + ''.join(wp_version.split('.')))
assert res.status_code == 200
wp_json = json.loads(res.content)
pprint(wp_json[wp_version]['vulnerabilities'])
print ''
print '[+] Checking %d plugins' % len(plugins)
for plugin in plugins:
res = requests.get('https://wpvulndb.com/api/v2/plugins/' + plugin)
if res.status_code != 200:
print 'Invalid plugin name ' + plugin
else:
d = json.loads(res.content)
if len(d[plugin]['vulnerabilities']) != 0:
print plugin + ':'
pprint(d[plugin]['vulnerabilities'])
else:
print plugin + ': no vulnerabilities'
print ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment