pip install requests
When I did that on Kali 2017.3, it was
already installed, as shown below.
python
The Python interactive shell opens,
as shown below.
At the Python >>> prompt, execute these commands to fetch my Web page.
import requests
r = requests.get("https://samsclass.info")
print r.headers
print r.status_code
The "requests.get" method sends a GET to
the server, and the reply is placed into
the object named "r".
The headers and status_code are attributes of "r", and are printed, as shown below.
print r.text
The entire HTML code for my page scrolls
by, ending as shown below.
print dir(r)
The entire HTML code for my page scrolls
by, ending as shown below.
https://games.samsclass.info/cookielogin/
From the Chrome menu bar, click View, Developer, "Developer Tools". In the Developer Tools pane, click the Network tab.
In the Cookie Login Page, enter a username of foo and a password of bar and click the Submit button, as shown below.
In the Developer Tools pane, a request appears, showing a relative URL of cookelogin.php?n=foo&p=bar, as shown below.
In the Developer Tools pane, click cookeligin.php?n=foo&p=bar.
A "Headers" pane appears, showing the URL and Request Method, as shown below.
r = requests.get("https://games.samsclass.info/cookielogin/cookielogin.php?n=foo&p=bar")
print r.text
The login is rejected,
as shown below.
Repeat the GET request, changing the username to root and the password to toor to see a "Welcome >b<Linux Root User!" message, as shown below.
This is a simple login form. Test it with any username and password you like.
Note the Method, URL, and parameters, as shown below.
Log in with Python, as shown below.
Here's an example using loops to log in to the form above:
The user name is one of these:
Write a script that finds the correct credentials and logs in.
When you find it, save an image showing the correct user name and PIN, and also the secret word the server sends, as shown below:
Save the whole-desktop images as "Proj 2xb", "Proj 2xc", "Proj 2xd", and "Proj 2xe".
Credits
CEO: Sarah Bellum
Staff: Pete Moss, Sandy Beach
(Stolen from A Prairie Home Companion)