Open sambaccessnow opened 1 month ago
Could you tell me what versions of Flask, Flask-WTF and Werkzeug you have?
I tried to install the repo using a python3 venv and I've the same issue
❯❯❯❯ python3 -m venv venv ~/d/sdanalyzer master
❯❯❯❯ source venv/bin/activate ~/d/sdanalyzer master
❯❯❯❯ pip install . ~/d/sdanalyzer master
Processing /home/samba/dev/sdanalyzer
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting Flask==2.3.2 (from sdanalyzer==0.1.7)
Using cached Flask-2.3.2-py3-none-any.whl.metadata (3.7 kB)
Collecting Flask-WTF==1.0.1 (from sdanalyzer==0.1.7)
Using cached Flask_WTF-1.0.1-py3-none-any.whl.metadata (1.9 kB)
Collecting peewee==3.15.2 (from sdanalyzer==0.1.7)
Using cached peewee-3.15.2-py3-none-any.whl
Collecting androguard==3.3.5 (from sdanalyzer==0.1.7)
Using cached androguard-3.3.5-py3-none-any.whl.metadata (2.4 kB)
Collecting requests (from sdanalyzer==0.1.7)
Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting yara-python==4.2.3 (from sdanalyzer==0.1.7)
Using cached yara_python-4.2.3-cp312-cp312-linux_x86_64.whl
Collecting asn1crypto>=0.24.0 (from androguard==3.3.5->sdanalyzer==0.1.7)
Using cached asn1crypto-1.5.1-py2.py3-none-any.whl.metadata (13 kB)
Collecting click (from androguard==3.3.5->sdanalyzer==0.1.7)
Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting colorama (from androguard==3.3.5->sdanalyzer==0.1.7)
Using cached colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Collecting future (from androguard==3.3.5->sdanalyzer==0.1.7)
Using cached future-1.0.0-py3-none-any.whl.metadata (4.0 kB)
Collecting ipython>=5.0.0 (from androguard==3.3.5->sdanalyzer==0.1.7)
Using cached ipython-8.26.0-py3-none-any.whl.metadata (5.0 kB)
Collecting lxml (from androguard==3.3.5->sdanalyzer==0.1.7)
Using cached lxml-5.2.2-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (3.4 kB)
Collecting matplotlib (from androguard==3.3.5->sdanalyzer==0.1.7)
Using cached matplotlib-3.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
Collecting networkx>=1.11 (from androguard==3.3.5->sdanalyzer==0.1.7)
Using cached networkx-3.3-py3-none-any.whl.metadata (5.1 kB)
Collecting pydot>=1.4.1 (from androguard==3.3.5->sdanalyzer==0.1.7)
Using cached pydot-3.0.1-py3-none-any.whl.metadata (9.9 kB)
Collecting pygments (from androguard==3.3.5->sdanalyzer==0.1.7)
Using cached pygments-2.18.0-py3-none-any.whl.metadata (2.5 kB)
Collecting Werkzeug>=2.3.3 (from Flask==2.3.2->sdanalyzer==0.1.7)
Using cached werkzeug-3.0.3-py3-none-any.whl.metadata (3.7 kB)
Collecting Jinja2>=3.1.2 (from Flask==2.3.2->sdanalyzer==0.1.7)
Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
Collecting itsdangerous>=2.1.2 (from Flask==2.3.2->sdanalyzer==0.1.7)
Using cached itsdangerous-2.2.0-py3-none-any.whl.metadata (1.9 kB)
Collecting blinker>=1.6.2 (from Flask==2.3.2->sdanalyzer==0.1.7)
Using cached blinker-1.8.2-py3-none-any.whl.metadata (1.6 kB)
Collecting WTForms (from Flask-WTF==1.0.1->sdanalyzer==0.1.7)
Using cached wtforms-3.1.2-py3-none-any.whl.metadata (5.3 kB)
Collecting charset-normalizer<4,>=2 (from requests->sdanalyzer==0.1.7)
Using cached charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (33 kB)
Collecting idna<4,>=2.5 (from requests->sdanalyzer==0.1.7)
Using cached idna-3.7-py3-none-any.whl.metadata (9.9 kB)
Collecting urllib3<3,>=1.21.1 (from requests->sdanalyzer==0.1.7)
Using cached urllib3-2.2.2-py3-none-any.whl.metadata (6.4 kB)
Collecting certifi>=2017.4.17 (from requests->sdanalyzer==0.1.7)
Using cached certifi-2024.7.4-py3-none-any.whl.metadata (2.2 kB)
Collecting decorator (from ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached decorator-5.1.1-py3-none-any.whl.metadata (4.0 kB)
Collecting jedi>=0.16 (from ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached jedi-0.19.1-py2.py3-none-any.whl.metadata (22 kB)
Collecting matplotlib-inline (from ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached matplotlib_inline-0.1.7-py3-none-any.whl.metadata (3.9 kB)
Collecting prompt-toolkit<3.1.0,>=3.0.41 (from ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached prompt_toolkit-3.0.47-py3-none-any.whl.metadata (6.4 kB)
Collecting stack-data (from ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached stack_data-0.6.3-py3-none-any.whl.metadata (18 kB)
Collecting traitlets>=5.13.0 (from ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached traitlets-5.14.3-py3-none-any.whl.metadata (10 kB)
Collecting pexpect>4.3 (from ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached pexpect-4.9.0-py2.py3-none-any.whl.metadata (2.5 kB)
Collecting MarkupSafe>=2.0 (from Jinja2>=3.1.2->Flask==2.3.2->sdanalyzer==0.1.7)
Using cached MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.0 kB)
Collecting pyparsing>=3.0.9 (from pydot>=1.4.1->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached pyparsing-3.1.2-py3-none-any.whl.metadata (5.1 kB)
Collecting contourpy>=1.0.1 (from matplotlib->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached contourpy-1.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (5.8 kB)
Collecting cycler>=0.10 (from matplotlib->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached cycler-0.12.1-py3-none-any.whl.metadata (3.8 kB)
Collecting fonttools>=4.22.0 (from matplotlib->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached fonttools-4.53.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (162 kB)
Collecting kiwisolver>=1.3.1 (from matplotlib->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached kiwisolver-1.4.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.4 kB)
Collecting numpy>=1.23 (from matplotlib->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached numpy-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
Collecting packaging>=20.0 (from matplotlib->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
Collecting pillow>=8 (from matplotlib->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached pillow-10.4.0-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (9.2 kB)
Collecting python-dateutil>=2.7 (from matplotlib->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting parso<0.9.0,>=0.8.3 (from jedi>=0.16->ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached parso-0.8.4-py2.py3-none-any.whl.metadata (7.7 kB)
Collecting ptyprocess>=0.5 (from pexpect>4.3->ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached ptyprocess-0.7.0-py2.py3-none-any.whl.metadata (1.3 kB)
Collecting wcwidth (from prompt-toolkit<3.1.0,>=3.0.41->ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached wcwidth-0.2.13-py2.py3-none-any.whl.metadata (14 kB)
Collecting six>=1.5 (from python-dateutil>=2.7->matplotlib->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting executing>=1.2.0 (from stack-data->ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached executing-2.0.1-py2.py3-none-any.whl.metadata (9.0 kB)
Collecting asttokens>=2.1.0 (from stack-data->ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached asttokens-2.4.1-py2.py3-none-any.whl.metadata (5.2 kB)
Collecting pure-eval (from stack-data->ipython>=5.0.0->androguard==3.3.5->sdanalyzer==0.1.7)
Using cached pure_eval-0.2.2-py3-none-any.whl.metadata (6.2 kB)
Using cached androguard-3.3.5-py3-none-any.whl (922 kB)
Using cached Flask-2.3.2-py3-none-any.whl (96 kB)
Using cached Flask_WTF-1.0.1-py3-none-any.whl (12 kB)
Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Using cached asn1crypto-1.5.1-py2.py3-none-any.whl (105 kB)
Using cached blinker-1.8.2-py3-none-any.whl (9.5 kB)
Using cached certifi-2024.7.4-py3-none-any.whl (162 kB)
Using cached charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141 kB)
Using cached click-8.1.7-py3-none-any.whl (97 kB)
Using cached idna-3.7-py3-none-any.whl (66 kB)
Using cached ipython-8.26.0-py3-none-any.whl (817 kB)
Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB)
Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
Using cached networkx-3.3-py3-none-any.whl (1.7 MB)
Using cached pydot-3.0.1-py3-none-any.whl (22 kB)
Using cached pygments-2.18.0-py3-none-any.whl (1.2 MB)
Using cached urllib3-2.2.2-py3-none-any.whl (121 kB)
Using cached werkzeug-3.0.3-py3-none-any.whl (227 kB)
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Using cached future-1.0.0-py3-none-any.whl (491 kB)
Using cached lxml-5.2.2-cp312-cp312-manylinux_2_28_x86_64.whl (4.9 MB)
Using cached matplotlib-3.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.3 MB)
Using cached wtforms-3.1.2-py3-none-any.whl (145 kB)
Using cached contourpy-1.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (309 kB)
Using cached cycler-0.12.1-py3-none-any.whl (8.3 kB)
Using cached fonttools-4.53.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB)
Using cached jedi-0.19.1-py2.py3-none-any.whl (1.6 MB)
Using cached kiwisolver-1.4.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB)
Using cached MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (28 kB)
Using cached numpy-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.0 MB)
Using cached packaging-24.1-py3-none-any.whl (53 kB)
Using cached pexpect-4.9.0-py2.py3-none-any.whl (63 kB)
Using cached pillow-10.4.0-cp312-cp312-manylinux_2_28_x86_64.whl (4.5 MB)
Using cached prompt_toolkit-3.0.47-py3-none-any.whl (386 kB)
Using cached pyparsing-3.1.2-py3-none-any.whl (103 kB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Using cached traitlets-5.14.3-py3-none-any.whl (85 kB)
Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Using cached matplotlib_inline-0.1.7-py3-none-any.whl (9.9 kB)
Using cached stack_data-0.6.3-py3-none-any.whl (24 kB)
Using cached asttokens-2.4.1-py2.py3-none-any.whl (27 kB)
Using cached executing-2.0.1-py2.py3-none-any.whl (24 kB)
Using cached parso-0.8.4-py2.py3-none-any.whl (103 kB)
Using cached ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using cached pure_eval-0.2.2-py3-none-any.whl (11 kB)
Using cached wcwidth-0.2.13-py2.py3-none-any.whl (34 kB)
Building wheels for collected packages: sdanalyzer
Building wheel for sdanalyzer (pyproject.toml) ... done
Created wheel for sdanalyzer: filename=sdanalyzer-0.1.7-py3-none-any.whl size=33770 sha256=0eedfbb333f52d313bcbdce673aa983877e72f063d78d7ce7927ed59959c8d22
Stored in directory: /tmp/user/1000/pip-ephem-wheel-cache-61rbyoin/wheels/c8/b0/9e/b34bd60e192a0feecb688902789c6073856e4ef0c71ebe977c
Successfully built sdanalyzer
Installing collected packages: yara-python, wcwidth, pure-eval, ptyprocess, peewee, asn1crypto, urllib3, traitlets, six, pyparsing, pygments, prompt-toolkit, pillow, pexpect, parso, packaging, numpy, networkx, MarkupSafe, lxml, kiwisolver, itsdangerous, idna, future, fonttools, executing, decorator, cycler, colorama, click, charset-normalizer, certifi, blinker, WTForms, Werkzeug, requests, python-dateutil, pydot, matplotlib-inline, Jinja2, jedi, contourpy, asttokens, stack-data, matplotlib, Flask, ipython, Flask-WTF, androguard, sdanalyzer
Successfully installed Flask-2.3.2 Flask-WTF-1.0.1 Jinja2-3.1.4 MarkupSafe-2.1.5 WTForms-3.1.2 Werkzeug-3.0.3 androguard-3.3.5 asn1crypto-1.5.1 asttokens-2.4.1 blinker-1.8.2 certifi-2024.7.4 charset-normalizer-3.3.2 click-8.1.7 colorama-0.4.6 contourpy-1.2.1 cycler-0.12.1 decorator-5.1.1 executing-2.0.1 fonttools-4.53.1 future-1.0.0 idna-3.7 ipython-8.26.0 itsdangerous-2.2.0 jedi-0.19.1 kiwisolver-1.4.5 lxml-5.2.2 matplotlib-3.9.1 matplotlib-inline-0.1.7 networkx-3.3 numpy-2.0.0 packaging-24.1 parso-0.8.4 peewee-3.15.2 pexpect-4.9.0 pillow-10.4.0 prompt-toolkit-3.0.47 ptyprocess-0.7.0 pure-eval-0.2.2 pydot-3.0.1 pygments-2.18.0 pyparsing-3.1.2 python-dateutil-2.9.0.post0 requests-2.32.3 sdanalyzer-0.1.7 six-1.16.0 stack-data-0.6.3 traitlets-5.14.3 urllib3-2.2.2 wcwidth-0.2.13 yara-python-4.2.3
❯❯❯❯ sdanalyzer phone --create "phone samba" ~/d/sdanalyzer master
Traceback (most recent call last):
File "/home/samba/.local/bin/sdanalyzer", line 5, in <module>
from sdanalyzer.main import main
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/sdanalyzer/main.py", line 14, in <module>
from .app import app, Phone, Apk
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/sdanalyzer/app.py", line 7, in <module>
from .forms import PhoneForm
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/sdanalyzer/forms.py", line 1, in <module>
from flask_wtf import FlaskForm
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/flask_wtf/__init__.py", line 4, in <module>
from .recaptcha import Recaptcha
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/flask_wtf/recaptcha/__init__.py", line 1, in <module>
from .fields import RecaptchaField
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/flask_wtf/recaptcha/fields.py", line 3, in <module>
from . import widgets
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/flask_wtf/recaptcha/widgets.py", line 4, in <module>
from werkzeug.urls import url_encode
ImportError: cannot import name 'url_encode' from 'werkzeug.urls' (/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/werkzeug/urls.py). Did you mean: 'urlencode'?
I think the issue come from the old Flask-WTF version, could you try pip install -U Flask-WTF
to get the latest version? I am not sure why you have an old version as it is defined in the setup file.
Ah right, my bad, I forgot to push the latest upgrades. Could you try now with the latest commit?
Thanks, I've tried again after running a git pull
, then I've installed all in the virtual environment via pip install .
and tried to run that again but:
❯❯❯❯ git pull ~/d/sdanalyzer master
remote: Enumerating objects: 24, done.
remote: Counting objects: 100% (24/24), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 13 (delta 8), reused 13 (delta 8), pack-reused 0
Unpacking objects: 100% (13/13), 5.08 KiB | 1.02 MiB/s, done.
From github.com:Te-k/sdanalyzer
21b0a01..c71e2a6 master -> origin/master
Updating 21b0a01..c71e2a6
Fast-forward Makefile | 3 ++
sdanalyzer/app.py | 114 ++++++++++++++++++++++++++++++++++++--------------------------
sdanalyzer/data/default.conf | 2 ++
sdanalyzer/forms.py | 6 ++--
sdanalyzer/main.py | 269 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------
sdanalyzer/templates/apk_show.html | 2 +-
sdanalyzer/utils.py | 171 ++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------
setup.py | 43 ++++++++++++------------
8 files changed, 343 insertions(+), 267 deletions(-)
create mode 100644 sdanalyzer/data/default.conf
❯❯❯❯ pip install . ~/d/sdanalyzer master
Processing /home/samba/dev/sdanalyzer
Installing build dependencies ... done
--- CUT ---
Successfully installed Flask-3.0.3 Flask-WTF-1.2.1 Mako-1.3.5 PySocks-1.7.1 alembic-1.13.2 androguard-4.1.2 apkInspector-1.3.0 banal-1.0.6 dataset-1.6.2 frida-16.4.5 greenlet-3.0.3 loguru-0.7.2 mutf8-1.0.6 oscrypto-1.3.0 peewee-3.17.6 pyyaml-6.0.1 sdanalyzer-0.1.7 sqlalchemy-1.4.52 typing-extensions-4.12.2 virustotal-python-1.0.2 yara-python-4.5.1
❯❯❯❯ sdanalyzer phone --create "phone samba" ~/d/sdanalyzer master
Traceback (most recent call last):
File "/home/samba/.local/bin/sdanalyzer", line 5, in <module>
from sdanalyzer.main import main
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/sdanalyzer/main.py", line 14, in <module>
from .app import app, Phone, Apk
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/sdanalyzer/app.py", line 7, in <module>
from .forms import PhoneForm
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/sdanalyzer/forms.py", line 1, in <module>
from flask_wtf import FlaskForm
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/flask_wtf/__init__.py", line 4, in <module>
from .recaptcha import Recaptcha
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/flask_wtf/recaptcha/__init__.py", line 1, in <module>
from .fields import RecaptchaField
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/flask_wtf/recaptcha/fields.py", line 3, in <module>
from . import widgets
File "/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/flask_wtf/recaptcha/widgets.py", line 4, in <module>
from werkzeug.urls import url_encode
ImportError: cannot import name 'url_encode' from 'werkzeug.urls' (/home/samba/.local/share/pipx/venvs/sdanalyzer/lib/python3.12/site-packages/werkzeug/urls.py). Did you mean: 'urlencode'?
Hi Thanks for sdanalyzer, I'm trying to run this on a linux, ubuntu 24.04
After cloning the repo I ran
pip install .
, but it doesn't work anymore on linux, so I used pipxpipx install .
and I've installed sdanalyzer successfully
Then I tried to create a new phone profile and it crashed on some urlencode issue
Maybe urlencode lib name is changed ?
Do I need to install some specific python lib?