Programming
Casual
265

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?

*Beware click the link!


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 report, comment and join discussion
Login Here
Sponsored

Popular Posts
Gps Tracker Seccodeid Free Too...
General
21220
202
Top


Djie sam soe Djie sam soe
Complete Basic Course in Kali...
Linux
14255
4
Top


Djie sam soe Djie sam soe
Komintod (Ministry of Communic...
Data Leak
6442
78
Top


Murtad methamphetamine Murtad methamphetamine
Free Proxy List
Networking
3608
3
Top


Sandidi Sandidi
Mass Reverse IP Unlimited
Tools Hacking
3349
13
Top


ImamWawe ImamWawe

Related Post

Youtube Video

Subscribe