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

oscrypto / openSSL regex bug when running setup.sh #2286

Closed
Sp00kyB00k opened this issue Nov 15, 2023 · 5 comments
Closed

oscrypto / openSSL regex bug when running setup.sh #2286

Sp00kyB00k opened this issue Nov 15, 2023 · 5 comments

Comments

@Sp00kyB00k
Copy link

ENVIRONMENT

OS and Version: Kali Linux Rolling Release 6.5.0-kali3-amd64
Python Version: 3.11.6
MobSF Version: 3.7.9 Beta

EXPLANATION OF THE ISSUE

When trying to install MobSF with the provided setup.sh, you may run into the issue that the install fails because it is unable to detect the version of libcrypto.
image
When working with versions that are higher or equal than 3.0.10 of OpenSSL, the Regex used to detect does not work.
Currently it is

\b(\d\.\d\.\d[a-z]*)\b

Personally I monkeypatched /home/Sp00kyB00k/.cache/pypoetry/virtualenvs/mobsf-vfi9xHNf-py3.11/lib/python3.11/site-packages/oscrypto/_openssl/_libcrypto_cffi.py to which is far from perfect but good enough to get the install rolling.

\b(\d\.\d\.\d+[a-z]*)\b

Adding the extra + with the last digit should fix it.

STEPS TO REPRODUCE THE ISSUE

Install on Kali Linux by cloning the repository and running the setup.sh

Copy link

👋 @SpookyB00k
Issues is only for reporting a bug/feature request. For limited support, questions, and discussions, please join MobSF Slack channel
Please include all the requested and relevant information when opening a bug report. Improper reports will be closed without any response.

@Sp00kyB00k
Copy link
Author

Adding to this bug, because of some other error I found which I cannot find screenshots taken off.
For another related error, you may need to disable the Python Keyring when installing.
Albeit temporary.
This can be done with python3 -m keyring --disable

@danilabs
Copy link

Awesome @SpookyB00k you save me a lot of time 👏 !
Thank you!

Sp00kyB00k added a commit to Sp00kyB00k/Mobile-Security-Framework-MobSF that referenced this issue Nov 16, 2023
Fixed a bug in oscrypto where the regex would fail to recognize the right version of SSL due to insufficient check on multiple digits. 
However the owner of the repo does not plan to make a new release soon due to time constraints. 
See -> wbond/oscrypto#78 

This can be fixed by using a specific version from git pointing to the right commit. 
Hence this change in the pyproject.toml file.
@ajinabraham
Copy link
Member

We are removing oscrypto dependency from MobSFv3.8 onwards. That should address this.

@baptx
Copy link

baptx commented Mar 14, 2024

Thanks, the solution worked.
For information, I also had an error "externally-managed-environment" that I fixed by modifying setup.sh to add --break-system-packages at the end of each pip line.
More details here: https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3/75722775#75722775
This needs to be fixed in the official script @ajinabraham, using venv may be better.

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

4 participants