Jan 17, 2015 06:00 AM
(This post was last modified: Jan 17, 2015 06:01 AM by Crypto™.)
Hey guys, this is just something I whipped up while waiting for some updates to install. Nothing fancy, but it will quickly attempt to discern the version of a WordPress site through two separate methods.
It requires Python Requests, but it's quite easy to install.
Screenshot (Click to View)
Gist
Usage:
It requires Python Requests, but it's quite easy to install.
Screenshot (Click to View)
Code
import argparse
import requests # Requires install of Requests: http://python-requests.org/
import re
from urlparse import urlparse
def main():
parser = argparse.ArgumentParser("Detects WP version from readme.html or meta tag")
parser.add_argument("-t", "--target", action="append", dest="targets", help="Add a target to scan")
args = parser.parse_args()
if args.targets != None:
scan(args.targets)
def scan(targets):
for target in targets:
if not target[:5] == "http:" and not target[:6] == "https:":
target = "http://" + target
tltarget = target
target = target + '/readme.html'
url = urlparse(target)
r = requests.get(url.geturl())
if r.status_code != 200:
tlurl = urlparse(tltarget)
t = requests.get(tlurl.geturl())
w = re.compile(r'<meta name\=\"generator\" content\=\"(WordPress \d+\.\d+\.?(\d+)?)\" \/>', re.I)
n = w.search(t.text)
if n:
print "Site " + tlurl.netloc + tlurl.path + ": Running WordPress " + n.group(1)
else:
print "Site " + tlurl.netloc + tlurl.path + ": No version found"
else:
v = re.compile(r"Version (\d+\.\d+\.?(\d+)?)", re.I)
m = v.search(r.text)
if m:
print "Site " + url.netloc + url.path + ": Running WordPress " + m.group(1)
else:
print "Site " + url.netloc + url.path + ": No version found"
if __name__ == "__main__":
main()Gist
Usage:
Code
python wp-fingerprinter.py -t targetblog.com -t blog.target.com -t target.com/path/to/blog -t http://blog.site.com -t https://site.com/wordpress
Get a signed message before dealing: Keybase
Still here sometimes.
Still here sometimes.



![[Image: 0H7bwvK.png]](https://i.imgur.com/0H7bwvK.png)
![[Image: M9ipuZe.png]](https://i.imgur.com/M9ipuZe.png)
