Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in selenium #599

Open
ali-0x11 opened this issue Nov 18, 2022 · 23 comments
Open

error in selenium #599

ali-0x11 opened this issue Nov 18, 2022 · 23 comments

Comments

@ali-0x11
Copy link

OS Used - ALL Information (architecture, linux flavor, etc.)

kali linux

Pastebin link to error you are encountering

the tools did not take any screen shoots

Expected behavior (vs. what you encountered)

Trying to make web screenshots using syntax:
./Eyewitness.py -f urllist.txt --web

Any additional information

Process Process-2:
Traceback (most recent call last):
File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/kali/Desktop/EyeWitness/Python/EyeWitness.py", line 253, in worker_thread
driver = create_driver(cli_parsed, user_agent)
File "/home/kali/Desktop/EyeWitness/Python/modules/selenium_module.py", line 39, in create_driver
profile = webdriver.FirefoxProfile()
File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox/firefox_profile.py", line 61, in init
with open(
FileNotFoundError: [Errno 2] No such file ordirectory:'/usr/lib/python3/distpackages/selenium/webdriver/firefox/webdriver_prefs.json'

@catpipeless
Copy link

I'm having this same issue on a new minimal kali installation after running apt install eyewitness. I fixed it by copying an old '/usr/lib/python3/distpackages/selenium/webdriver/firefox/webdriver_prefs.json' to the new device.

@digininja
Copy link
Contributor

digininja commented Nov 18, 2022 via email

@catpipeless
Copy link

catpipeless commented Nov 18, 2022

I did try installing it from github, by cloning the project and then running the setup.sh script. This did not resolve the issue.

@Relkci
Copy link
Collaborator

Relkci commented Nov 18, 2022

This can be merged with #598, still an issue. Might be dependent on specific distro apt repos from setup?

In the mean time, try the fix from #598

@ali-0x11
Copy link
Author

Don't use the package manager version, always install from GitHub, it makes debugging stuff a lot easier.

On Fri, 18 Nov 2022, 20:12 catpipeless, @.> wrote: I'm having this same issue on a new minimal kali installation after running apt install eyewitness. I fixed it by copying an old '/usr/lib/python3/distpackages/selenium/webdriver/firefox/webdriver_prefs.json' to the new device. — Reply to this email directly, view it on GitHub <#599 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA4SWLE3JIMBN2UULBLR7DWI7PLHANCNFSM6AAAAAASEZUZRM . You are receiving this because you are subscribed to this thread.Message ID: @.>

i download it from github but still the same issue

@Relkci
Copy link
Collaborator

Relkci commented Nov 19, 2022

Try the fix from #598

What distro and version of Linux are you using?

@catpipeless
Copy link

I don't see a fix in #598

@Relkci
Copy link
Collaborator

Relkci commented Nov 19, 2022

I don't see a fix in #598

Oh, right. #587

Find a copy of the missing file and drop it in the expected folder

@7h30th3r0n3
Copy link

I don't think it's related but I'd like it posted here if anyone has the same problem.
I got an error message after downgrading urllib3 :

[] Selenium not found.
[
] Please run the script in the setup directory!

downgrade commands :

pip uninstall urllib3
pip install urllib3==1.22

Once updated everything works again :
pip3 install urllib3 --upgrade

👍

@jeastonIT
Copy link

Same issue...

I tried uninstalling, reinstalling, installing from git only. downgrading. reinstalling selenium.

Nothing works.
image

@daffi1238
Copy link

daffi1238 commented Dec 19, 2022

Someone could upload the content of the file '/usr/lib/python3/distpackages/selenium/webdriver/firefox/webdriver_prefs.json'?

I remove all the old versions in my machine.

Thank you guys!

EDIT:
I found the proper file!, the content is the next!:
{
"frozen": {
"app.update.auto": false,
"app.update.enabled": false,
"browser.displayedE10SNotice": 4,
"browser.download.manager.showWhenStarting": false,
"browser.EULA.override": true,
"browser.EULA.3.accepted": true,
"browser.link.open_external": 2,
"browser.link.open_newwindow": 2,
"browser.offline": false,
"browser.reader.detectedFirstArticle": true,
"browser.safebrowsing.enabled": false,
"browser.safebrowsing.malware.enabled": false,
"browser.search.update": false,
"browser.selfsupport.url" : "",
"browser.sessionstore.resume_from_crash": false,
"browser.shell.checkDefaultBrowser": false,
"browser.tabs.warnOnClose": false,
"browser.tabs.warnOnOpen": false,
"datareporting.healthreport.service.enabled": false,
"datareporting.healthreport.uploadEnabled": false,
"datareporting.healthreport.service.firstRun": false,
"datareporting.healthreport.logging.consoleEnabled": false,
"datareporting.policy.dataSubmissionEnabled": false,
"datareporting.policy.dataSubmissionPolicyAccepted": false,
"devtools.errorconsole.enabled": true,
"dom.disable_open_during_load": false,
"extensions.autoDisableScopes": 10,
"extensions.blocklist.enabled": false,
"extensions.checkCompatibility.nightly": false,
"extensions.update.enabled": false,
"extensions.update.notifyUser": false,
"javascript.enabled": true,
"network.manage-offline-status": false,
"network.http.phishy-userpass-length": 255,
"offline-apps.allow_by_default": true,
"prompts.tab_modal.enabled": false,
"security.fileuri.origin_policy": 3,
"security.fileuri.strict_origin_policy": false,
"signon.rememberSignons": false,
"toolkit.networkmanager.disable": true,
"toolkit.telemetry.prompted": 2,
"toolkit.telemetry.enabled": false,
"toolkit.telemetry.rejected": true,
"xpinstall.signatures.required": false,
"xpinstall.whitelist.required": false
},
"mutable": {
"browser.dom.window.dump.enabled": true,
"browser.laterrun.enabled": false,
"browser.newtab.url": "about:blank",
"browser.newtabpage.enabled": false,
"browser.startup.page": 0,
"browser.startup.homepage": "about:blank",
"browser.startup.homepage_override.mstone": "ignore",
"browser.usedOnWindows10.introURL": "about:blank",
"dom.max_chrome_script_run_time": 30,
"dom.max_script_run_time": 30,
"dom.report_all_js_exceptions": true,
"javascript.options.showInConsole": true,
"network.captive-portal-service.enabled": false,
"security.csp.enable": false,
"startup.homepage_welcome_url": "about:blank",
"startup.homepage_welcome_url.additional": "about:blank",
"webdriver_accept_untrusted_certs": true,
"webdriver_assume_untrusted_issuer": true
}
}

Just copy that in /usr/lib/python3/distpackages/selenium/webdriver/firefox/webdriver_prefs.json and it's done!

@0x6d6f7468
Copy link
Collaborator

Heads up to folks hitting this issue: Issue might exist by conflicting selenium versions. Was troubleshooting this with a coworker and the issue existed in /usr/lib/..., but Selenium was found in /usr/local/lib/... and that location contained the webdriver_prefs.json file.

Removing the Selenium module present in /usr/lib/... fixed our issue. Need to research more to see if something else is going on.

@cosad3s
Copy link

cosad3s commented Jan 8, 2023

Maybe, there is another kind of conflict regarding Python3 Selenium because these two folders are quoted:

Maybe distro-dependent I do not know.

Thanks @0x6d6f7468:

$ find /usr/ -name "webdriver_prefs.json"
/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver_prefs.json
/usr/local/lib/python3.9/dist-packages/selenium/webdriver/firefox/webdriver_prefs.json
/usr/local/lib/python3.7/dist-packages/selenium/webdriver/firefox/webdriver_prefs.json

So I try to copy one of them:

sudo cp /usr/local/lib/python3.9/dist-packages/selenium/webdriver/firefox/webdriver_prefs.json /usr/lib/python3/dist-packages/selenium/webdriver/firefox/webdriver_prefs.json

But, now I have this error:

################################################################################
#                                  EyeWitness                                  #
################################################################################
#           FortyNorth Security - https://www.fortynorthsecurity.com           #
################################################################################

Starting Web Requests (41 Hosts)
Message: Service geckodriver unexpectedly exited. Status code was: 64

Edit: Ok fine, I just ran the setup.sh, and https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-linux64.tar.gz was missing on my system. Works now :)

@0x6d6f7468
Copy link
Collaborator

Glad you got it working. Thinking maybe we should add a check in the setup script that either removes existing versions of Selenium, or copies the downloaded webdriver_prefs.json to the /usr/lib directory. Will investigate when I have a moment.

@ChrisTruncer
Copy link
Contributor

that is a good idea, and likely should get added in

@0x6d6f7468
Copy link
Collaborator

I can sketch something up quick if you like. Do you have a preference between deleting existing selenium or copying webdriver_prefs.json all over the place? Or should the user get a prompted choice?

@digininja
Copy link
Contributor

digininja commented Jan 8, 2023 via email

@0x6d6f7468
Copy link
Collaborator

Yeah that's fair, digi. The solution seemed like a bit of a kludge in the moment, but was mostly to get another tester running. I'm not aware of an issue with deleting the /usr/lib location but perhaps even just symlinking the webdriver_prefs file would be good enough?

@digininja
Copy link
Contributor

digininja commented Jan 8, 2023 via email

@0x6d6f7468
Copy link
Collaborator

Ok. I can look at a few options for setup script changes and report back tomorrow with what seems to be the best solution.

@digininja
Copy link
Contributor

digininja commented Jan 9, 2024 via email

@Relkci
Copy link
Collaborator

Relkci commented May 20, 2024

@digininja This can be closed at this point? between Chris' work and the new setup script, i think this might be resolved.

@digininja
Copy link
Contributor

digininja commented May 20, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants