Created
December 8, 2015 15:58
-
-
Save gsingh93/10f42f99fc43b61b461c to your computer and use it in GitHub Desktop.
Check for WordPress plugin vulnerabilities
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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