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

Drozer console connect - SyntaxError. Help Please. #397

Closed
pt615 opened this issue Sep 29, 2021 · 4 comments
Closed

Drozer console connect - SyntaxError. Help Please. #397

pt615 opened this issue Sep 29, 2021 · 4 comments

Comments

@pt615
Copy link

pt615 commented Sep 29, 2021

I tried reinstalling python2.7, reinstalling drozer, setting environment variables, updating modules, installing from another pc.
But I get the same message as below.
please Help.

Steps to reproduce

  1. git clone https://github.com/FSecureLABS/drozer.git
  2. cd drozer
  3. python.exe setup.py bdist_msi
  4. install drozer
    pip2 install pyyaml
    pip2 install protobuf
    pip2 install pyopenssl
    pip2 install twisted
    pip2 install service_identity
  5. install agent.apk in Nox player
  6. adb forward tcp:31415 tcp:31415
  7. drozer console connect success

Expected behaviour

drozer console connect success

Actual behaviour

C:\Users\user>drozer.bat console connect

Traceback (most recent call last):
  File "C:\Python27\Scripts\drozer", line 30, in <module>
    __import__("drozer.cli.%s" % (sys.argv[1]))
  File "C:\Python27\Lib\site-packages\drozer\cli\console.py", line 8, in <module>
    from drozer.console import Console
  File "C:\Python27\Lib\site-packages\drozer\console\__init__.py", line 4, in <module>
    from drozer.console.console import Console
  File "C:\Python27\Lib\site-packages\drozer\console\console.py", line 5, in <module>
    from pydiesel.api.protobuf_pb2 import Message
  File "C:\Python27\Lib\site-packages\pydiesel\api\__init__.py", line 9, in <module>
    from pydiesel.api.frame import Frame
  File "C:\Python27\Lib\site-packages\pydiesel\api\frame.py", line 3, in <module>
    from pydiesel.api.protobuf_pb2 import Message
  File "C:\Python27\Lib\site-packages\pydiesel\api\protobuf_pb2.py", line 3, in <module>
    from google.protobuf import descriptor
  File "C:\Python27\lib\site-packages\google\protobuf\descriptor.py", line 113
    class DescriptorBase(metaclass=DescriptorMetaclass):
                                  ^
SyntaxError: invalid syntax`

Environment

Operating system:
Windows 10

USER Renvironment variables
PATH =

C:\Python27`
C:\Python27\Scripts

PYTHONPATH =

C:\Python27\Lib\site-packages
C:\Users\user\drozer\src
C:\Users\user\drozer\test

SYSTEM environment variables

PATH =

%JAVA_HOME%\bin
C:\Program Files\Common Files\Oracle\Java\javapath

JAVA_HOME=
C:\Program Files\JAVA\jdk-17

Java Version:
Openjdk 17
Python 2.7

@DrorDvash
Copy link

DrorDvash commented Oct 6, 2021

@pt615
According to protobuf releases page:
At v3.18.0-rc2, protobuf drops support for python 2.7 and 3.5 (View here under 'Python' section)

In order to work with this package, you should install an earlier version of protobuf, such 3.17.3:
pip install protobuf==3.17.3 --upgrade -q
NOTE: The --upgrade flag can be used for both downgrade or upgrade. (Reference)

This worked for me, hope it will fix your problem too.

@Yogehi
Copy link
Collaborator

Yogehi commented Oct 15, 2021

try the docker image please

https://github.com/FSecureLABS/drozer/tree/develop/docker

@StephenShedden
Copy link

The commands you put up worked for me, I hard coded the path for java in the drozer config py file.
"\drozer\src\drozer\configuration.py"

path = system.which(name)
changed to;
path = 'C:\Program Files\Java\jdk-19\bin\javac.exe'

#is the required exe available on the PATH?
if path == None and cls.get("executables", name) == None:
path = 'C:\Program Files\Java\jdk-19\bin\javac.exe'

Hope that helps, I have had a lot of problems as well, so I am not sure if that one was the fix.
Good luck.

@Yogehi
Copy link
Collaborator

Yogehi commented Mar 4, 2023

closing this issue

the docker image has been well received and works pretty flawlessly

@Yogehi Yogehi closed this as completed Mar 4, 2023
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