Exercise: Authentication and Session Management (Solution)
Bruteforce a login system
We have an application: KIS Klinik Sonnenschein. We want to bruteforce the site.
Automate login tests.
Wirte a small php (or java or python, or what you want) program to be run on your laptop. This program must send a request for login, where you can input a username and a password. You must test if the login is valid or not. You can test with the user
Wirte a small php (or java or python, or what you want) program to be run on your laptop. This program must send a request for login, where you can input a username and a password. You must test if the login is valid or not. You can test with the user
house
. The password is given in Moodle.
Solution
We write a python file that can send the login form and test if the page is the right one.solution_1_login.py
Brute force the login
-
Modify your program to test with the list of most often used
passwords Passwords. Select
the list
darkweb2017-top100.txt
. You will test userbie1
.
Solution We do read the file and test for each of the password if it matches the userbie1
.
solution_2_list.py - Modify the previous program, such that you can loop all possible passwords with 4 letters.
Find the password for usertaub
(this could last for a long time, start the next exercise while waiting for the result).
Solution We do loop on a set of characters (since I know the solution, I reduced the set of characters on purpose).
solution_3_brute.py
Credentials Theft
In Linux the file is placed in the following directory :
Access to gmail.com. It works Read the emails of the user.
You can also access Facebook with those cookies.
/home/username/snap/firefox/common/.mozilla/firefox/rand.profileSave your file there.
Access to gmail.com. It works Read the emails of the user.
You can also access Facebook with those cookies.
Related Pages
Contact
Prof. Dr. Emmanuel Benoist
Berner Fachhochschule - TI
Quellgasse 21
CH-2501 Biel/Bienne
Switzerland
Mail: emmanuel.benoist (at) bfh.ch
Berner Fachhochschule - TI
Quellgasse 21
CH-2501 Biel/Bienne
Switzerland
Mail: emmanuel.benoist (at) bfh.ch
Social Networks
Follow
me
on
Linkedin, Scholar
& Research gate