Sublist3r
Sublist3r copied to clipboard
Only this error
Hello and congratulation for this script! only one think after send command /etc/pihole/youtube-ads.sh I have this error:
/etc/sublist/Sublist3r-master/sublist3r.py:614: DeprecationWarning: please use dns.resolver.Resolver.resolve() instead
ip = Resolver.query(host, 'A')[0].to_text()
what can I do for fix?
Try using
python3
Try using
python3
thisi is my version:
root@pihole:~# python --version
Python 3.7.5
root@pihole:~# pip --version
pip 20.2.3 from /usr/local/lib/python3.7/dist-packages/pip (python 3.7)
root@pihole:~#
Unfortunately that's all I can think of being the problem. Some people switched to python3 to fix dns.resolver.
Unfortunately that's all I can think of being the problem. Some people switched to python3 to fix dns.resolver.
How I can switch to python3 ?
You are on python 3. The 3.x.x signifies that. Some used python2, due to --version showing 2.x.x
You are on python 3. The 3.x.x signifies that. Some used python2, due to --version showing 2.x.x
see below:
root@pihole:~# python3 /etc/sublist/Sublist3r-master/sublist3r.py -d google.com
Traceback (most recent call last):
File "/etc/sublist/Sublist3r-master/sublist3r.py", line 21, in <module>
from subbrute import subbrute
File "/etc/sublist/Sublist3r-master/subbrute/subbrute.py", line 18, in <module>
import dns.resolver
ModuleNotFoundError: No module named 'dns'
I, too, have this issue:
user@raspbpi:/etc/sublist $ python3 /etc/sublist/Sublist3r-master/sublist3r.py -h
Traceback (most recent call last):
File "/etc/sublist/Sublist3r-master/sublist3r.py", line 21, in <module>
from subbrute import subbrute
File "/etc/sublist/Sublist3r-master/subbrute/subbrute.py", line 18, in <module>
import dns.resolver
ModuleNotFoundError: No module named 'dns'
I, too, have this issue:
user@raspbpi:/etc/sublist $ python3 /etc/sublist/Sublist3r-master/sublist3r.py -h Traceback (most recent call last): File "/etc/sublist/Sublist3r-master/sublist3r.py", line 21, in <module> from subbrute import subbrute File "/etc/sublist/Sublist3r-master/subbrute/subbrute.py", line 18, in <module> import dns.resolver ModuleNotFoundError: No module named 'dns'
Update: Was able to resolve by pip3 install dnspython
Fix found: reinstall dnspython
git clone https://github.com/rthalley/dnspython cd dnspython/ python setup.py install
@darkt1981 @walksonair @wifi75 @jr1221
A- For the deprecation warning, this is easily resolved by editing code in both subbrute.py and sublist3r.py and replacing all instances of resolver.query by resolver.resolve assuming you are running the tool under python3.
B- To run the tool properly without encountering missing modules errors, or other similar errors, please abide by the following guide to properly run sublist3r properly linux using python3:
Under linux, use a python3 virtual environment specific to sublist3r. It should be a default action that you do for each and every single Python script.
You will be running the tool within this virtual python environment and not the system wide python installation. All python commands you run once the virtual environment is activated are specific to the virtual environment. Changes you make to a virtual environment, including installing dependencies only affect the virtual environment and do not affect the system wide installation of Python which usually ends up breaking python.
Assuming you are going to keep your python virtual environments in a directory called environments under your home directory, please proceed as follows:
1- $ python3 -m venv ~/environments/sublist3r // create a python version 3 virtual environment for sublist3r
2- $ source ~/environments/sublist3r/bin/activate // activate sublist3r python environment.
3- $ python -m pip install --upgrade pip // update pip inside virtual env.
4- $ cd ~/sublist3r/ // switch to your sublist3r folder.
5- $ pip install -r requirements.txt // install sublist3r script dependencies.
6- $ python sublist3r.py -d domain.com // run sublist3r.py from within activated environment
7- $ deactivate // deactivate environment once done the script run.
note: do not use sudo.
Repeat steps 2,6 and 7 every time you wish to run sublist3r.
This should solve this specific issue.
@darkt1981 @walksonair @wifi75 @jr1221
A- For the deprecation warning, this is easily resolved by editing code in both subbrute.py and sublist3r.py and replacing all instances of resolver.query by resolver.resolve assuming you are running the tool under python3.
B- To run the tool properly without encountering missing modules errors, or other similar errors, please abide by the following guide to properly run sublist3r properly linux using python3:
Under linux, use a python3 virtual environment specific to sublist3r. It should be a default action that you do for each and every single Python script.
You will be running the tool within this virtual python environment and not the system wide python installation. All python commands you run once the virtual environment is activated are specific to the virtual environment. Changes you make to a virtual environment, including installing dependencies only affect the virtual environment and do not affect the system wide installation of Python which usually ends up breaking python.
Assuming you are going to keep your python virtual environments in a directory called environments under your home directory, please proceed as follows:
1- $ python3 -m venv ~/environments/sublist3r // create a python version 3 virtual environment for sublist3r 2- $ source ~/environments/sublist3r/bin/activate // activate sublist3r python environment. 3- $ python -m pip install --upgrade pip // update pip inside virtual env. 4- $ cd ~/sublist3r/ // switch to your sublist3r folder. 5- $ pip install -r requirements.txt // install sublist3r script dependencies. 6- $ python sublist3r.py -d domain.com // run sublist3r.py from within activated environment 7- $ deactivate // deactivate environment once done the script run. note: do not use sudo.
Repeat steps 2,6 and 7 every time you wish to run sublist3r.
This should solve this specific issue.
after i reinstalled it was fixed, no need to run these steps atleast for me.
@darkt1981 you're missing the point . Using a virtual environment is best practice. Soon enough once u install other tools that use same dependencies as sublist3r but with other versions, one of ur tools will break. It works now. It will eventually either break this tool or another because of dependency conflicts. Use Python virtual environments to avoid those future problems.
The only fix for my issue was reverting to Python version 3.11.8. Here are the steps I followed:
pip or brew install pyenv
pyenv install 3.11.8
pyenv global 3.11.8
bash: export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv init -)"
zsh: export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv init -)"
After editing, apply the changes: source ~/.zshrc
confirm that 3.11.8 python --version