Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

requests.exceptions.InvalidURL: Failed to parse

I think my code is clean and simple , but i got this error :

requests.exceptions.InvalidURL: Failed to parse: http://support
.google.com/

When trying to run it .

I don't know why actually i tried too many things

when i change

fuzing_website_response = requests.get(f'http://{i}.{take_input}/')

to

fuzing_website_response = requests.get(f'http://{take_input}/{i}')

and run it and with valid URL input _ > it will give me the responses status_code successfully .

But the other code which try to enumerate subdomains given me the provided error even when http://support.google.com is a valid url

Detailed response with the reason of the problem will be appreciated.

Script code :






take_input = input('Enter the website > ')
take_file = open('list.txt','r')


for i in take_file:
    fuzing_website_response = requests.get(f'http://{i}.{take_input}/')
    print (f'{take_input}/{i} ---> {fuzing_website_response.status_code}')
like image 335
Oussama Hamad Avatar asked Jun 17 '26 04:06

Oussama Hamad


1 Answers

This is actually something with the urllib3 library because requests parses the url with urllib3, urllib3's parser isn't percent-encoding characters within the userinfo section of the URL, just upgrade your urllib3 it will work.

How to upgrade or install ?

python -m pip install --upgrade urllib3

pip install urllib3

from github repository:

git clone git://github.com/urllib3/urllib3.git
cd urllib3
python setup.py install
like image 92
Yagiz Degirmenci Avatar answered Jun 18 '26 17:06

Yagiz Degirmenci



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!