NullArray / DorkNet

Selenium powered Python script to automate searching for vulnerable web apps.
GNU General Public License v3.0
338 stars 97 forks source link

unable to install requirements #1

Closed bitniko closed 7 years ago

bitniko commented 7 years ago

hi, while trying to install the requirements with cmd "pip install -r requirements.txt" i get the following msg: Ignoring selenium: markers 'python_version < "2.7"' don't match your environment Ignoring blessings: markers 'python_version < "2.7"' don't match your environment

my python version is: Python 2.7.9 my pip version is: pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)

what can i do? thanks..

NullArray commented 7 years ago

Hi @bitniko have you tried installing manually with pip ?

Open a command prompt and try the following:

pip install selenium

And

pip install blessings

I think pip should collect the proper version for your environment if you do it manually. Let me know if it works.

bitniko commented 7 years ago

hi @NullArray , i follow your instructions but now when i try to use the script with the example parameter i get the following error:

[!]Unhandled option, defaulting to unproxied connection... Traceback (most recent call last): File "./dorknet.py", line 154, in proc_one = search() File "./dorknet.py", line 107, in search driver = webdriver.Firefox() File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdri ver.py", line 152, in init keep_alive=True) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriv er.py", line 98, in init self.start_session(desired_capabilities, browser_profile) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriv er.py", line 188, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriv er.py", line 252, in execute self.error_handler.check_response(response) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorha ndler.py", line 194, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Unable to find a matchin g set of capabilities

do you know how to solve it?

print selenium.version 3.4.1

NullArray commented 7 years ago

Isn't Selenium 3.4.1 the Selenium version for Python 3? When i open an instance of the 2.7 interpreter and try print selenium.version i get an module has no attribute 'version' error. Try installing Selenium from source instead.

https://pypi.python.org/pypi/selenium/2.7.0

This one should be compatible with DorkNet.

bitniko commented 7 years ago

dunno, to get selenium version type: python -c 'import selenium; print selenium.__version__' i've installed both requirements from source as you suggested and now i get the following error:

Traceback (most recent call last): File "dorknet.py", line 11, in from selenium.webdriver.support import expected_conditions as EC

NullArray commented 7 years ago

What's the full error message for the latest issue you posted?

bitniko commented 7 years ago

the full error message is:

Traceback (most recent call last):
  File "dorknet.py", line 11, in <module>
    from selenium.webdriver.support import expected_conditions as EC
ImportError: cannot import name expected_conditions

tested with python version 2.7.9 and selenium version 2.7.0

i also tried to test in a virtual machine with Ubuntu with default python version 2.7 and while trying to install requirements using PIP i got the message:

Ignoring selenium: markers 'python_version < "2.7"' don't match your environment Ignoring blessings: markers 'python_version < "2.7"' don't match your environment

so i ask, what exactly python version are you using? what version of requirements are you using? Regards..

NullArray commented 7 years ago

Python 2.7.6, GCC 4.8.4, on Ubuntu 14.04. I'll change it in the requirements file.

NullArray commented 7 years ago

https://github.com/NullArray/DorkNet/commit/7876c7f8aa0447024b86985534eb68d2026be6b8

bitniko commented 7 years ago

i managed to install python 2.7.6 but i still get the error:

Traceback (most recent call last): File "dorknet.py", line 11, in from selenium.webdriver.support import expected_conditions as EC ImportError: cannot import name expected_conditions

what exact version of selenium and blessings are you using?

NullArray commented 7 years ago

Hello again, i am using Selenium 3.0.2.

bitniko commented 7 years ago

ok.. so i have a fresh OS installation with Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64) i don't have python installed.. can you tell me step-by-step what i have to install in order to make your software work?

bitniko commented 7 years ago

hi NullArray, im not using a GUI window manager, just a shell.. now when i try to run i get this error msg:

Traceback (most recent call last): File "dorknet.py", line 154, in proc_one = search() File "dorknet.py", line 107, in search driver = webdriver.Firefox() File "/home/vps/.pyenv/versions/2.7.6/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 152, in init keep_alive=True) File "/home/vps/.pyenv/versions/2.7.6/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 98, in init self.start_session(desired_capabilities, browser_profile) File "/home/vps/.pyenv/versions/2.7.6/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 188, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/home/vps/.pyenv/versions/2.7.6/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in execute self.error_handler.check_response(response) File "/home/vps/.pyenv/versions/2.7.6/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: connection refused

the output from geckodriver.log is:

1494280543324 geckodriver INFO Listening on 127.0.0.1:50328 1494280544370 geckodriver::marionette INFO Starting browser /usr/lib/firefox/firefox.sh with args ["-marionette"] Error: GDK_BACKEND does not match available displays

do you know how to fix?

NullArray commented 7 years ago

Try this.

pip install pyvirtualdisplay selenium

You might need xvfb too:

sudo apt-get install xvfb

Then add this code to the top of the main DorkNet.py script

from pyvirtualdisplay import Display
display = Display(visible=0, size=(800, 600))
display.start()
bitniko commented 7 years ago

NullArray, it seems to be working, at least it display some results.. but i have some other issues/questions: if i want to use 2 google operators like "inurl:" and "site:" as a dork, its not possible? it seems there are limited results, is it possible to increase? thanks..

NullArray commented 7 years ago

Glad you got it to work! As it stands, DorkNet does not support multi-operator search queries or multi-page results. If you use the --dork argument you will get the first page of results for the dork you specified. In general this is not much of a problem, the --dork argument is added for special cases mostly.

When i designed this tool intended it to be used with a list of dorks. If you have 10 dorks in a list and DorkNet saves the first pages of results for 10 dorks you will still have 10 pages. Which all things considered is a lot of data to go through.

I don't have plans to add multi-page support, however i might add multi-operator support for the --dork argument. I opened a ticket with that in mind.

https://github.com/NullArray/DorkNet/issues/2

Will that be all then?

bitniko commented 7 years ago

Will that be all then?

for now yes, thanks for all the help..

NullArray commented 7 years ago

No worries, if there's anything else, you're always free to open a new ticket.