Running a python script with -i flag brings us to the end of the exectuion and prompts a python shell
To inspect what are the supported methods available from the output object the dir can be used
Requests
Requests module are used to make requests to the webpage
for i inrange(182930):print(f"\rNow the value is{i}",flush=False,end="")
pyhton3-iexploit.py
resp = requests.get("https://dhaneshsivasamy07.gitbook.io")# look at the supported attributesdir(resp)# access the methodresp.text resp.elapsedresp.status_code# can be further inspecteddir(resp.text)dir(resp.elapsed)# accessingresp.elapsed.microsecondsresp.elapsed.total_seconds()
import requestsurl ="https://google.com"# make a get requestr = requests.get(url=url)# know the status codeprint(r.status_code)# print the contents of the responeprint(r.text)# make a post requestp = requests.post(url=url)# status code and contents can be accessed with p.status_code and p.text# send a data along with the post requestdata ={"user":"dnoscp","password":"iamfastasfuckboii"}url ="http://127.0.0.1/login.php"dn = requests.post(url=url, data=data)# make the requst go through a proxydata ={"user":"dnoscp","password":"iamfastasfuckboii"}url ="http://127.0.0.1/login.php"proxy ={"http":"http://127.0.0.1:8080"}dnp = requests.post(url=url, data=data, proxies=proxy)# When handling with forms and ajax requests, make use of the Session() which hold# the information that is processed and will use in the subsequent request# Session() is a function in requests modulesession =Session()get_ = session.get(url=url)post_ = session.post(url=url, data=data, proxies=proxy)