Programming
Casual
29

Get headers website and http requests method using python






  03-Aug-2022 20:14:40



Hi all I want make web pentesting tool using python I want this tool to get the content and request headers on the form or web, I want to make a simple and brute force bot then how can I get it?


DISCUSSION

I'm not familiar with Python, but in your case you can get the data by inspect element -> network -> header

tutorial : https://mkyong.com/computer-tips/how-to-view-http-headers-in-google-chrome/#:~:text=To%20view%20the%20request%20or,displayed%20on%20the% 20right%20panel  

Maybe you can use urllib

https://docs.python.org/3/library/urllib.request.html?highlight=request#module-urllib.request 

request lib

https://requests.readthedocs.io/en/latest/ 

I tried the sample code in Python, if an error occurs sorry, I didn't try it and run it

#!/bin/python

import requests
import sys


url = 'url.com'

headers =
{
    'Content-Type': 'your result or inspect',
}

checkpoint.post(url, headers=headers)

print(checkpoint)

If you want make brute force tool, you need know about algorthm, make array to sett you value or you can use file handling for wordlist like read, append, write anything then you parse this data (wordlist) to url or target host   

https://www.codecademy.com/learn/learn-data-structures-and-algorithms-with-python/modules/brute-force-algorithms/cheatsheet 

https://stackoverflow.com/questions/11747254/python-brute-force-algorithm 

CMIW 




Reply


03-Aug-2022 20:54:12



Change the http method in line 14, you can change in your case here list http method request https://rapidapi.com/blog/api-glossary/http-request-methods/ 


Reply


03-Aug-2022 21:04:41



How i can use file handling in Python? For example I will take a 1.txt file that will input it in the target


Reply


03-Aug-2022 21:09:04



Ummm, you need learn file handling or I/O file you can read doc Python https://docs.python.org/3/tutorial/inputoutput.html if you wan't read the file using "r" learn more about file handling https://www.w3schools.com/python/python_file_handling.asp 

You can use open() this function for file handling 

"r" - Read - Default value. Opens a file for reading, error if the file does not exist

"a" - Append - Opens a file for appending, creates the file if it does not exist

"w" - Write - Opens a file for writing, creates the file if it does not exist

"x" - Create - Creates the specified file, returns an error if the file exists


Reply


03-Aug-2022 21:02:09



Okkey try it, I will develop code from you


Reply


03-Aug-2022 21:09:36



Ok, but sorry i dont know much about Python hehee CMIW


Reply


03-Aug-2022 21:11:28



Ok no problem any here Pyhon programmer?

I want make portofolio


Reply


03-Aug-2022 21:28:35



You can wait, i don't think so maybe 


Reply



Login for comment and discussion.
Login Here
Sponsored

Oppss... No sponsors yet

Popular Posts
Complete Basic Course in Kali...
Djie sam soe Djie sam soe
Linux
7728
2
Top

Gps Tracker Seccodeid Free Too...
Djie sam soe Djie sam soe
General
5326
164
Top

Free Proxy List
Sandidi Sandidi
Networking
2961
3
Top

Mass Reverse IP Unlimited
ImamSy ImamSy
Hacking
2177
11
Top

Report McAfee Antivirus Hurrri...
Indrasp Indrasp
Windows
1629
93
Top

Related Post

Youtube Video

Subscribe