Drozer console connect - SyntaxError. Help Please.
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
- git clone https://github.com/FSecureLABS/drozer.git
- cd drozer
- python.exe setup.py bdist_msi
- install drozer pip2 install pyyaml pip2 install protobuf pip2 install pyopenssl pip2 install twisted pip2 install service_identity
- install agent.apk in Nox player
- adb forward tcp:31415 tcp:31415
- 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
@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.
try the docker image please
https://github.com/FSecureLABS/drozer/tree/develop/docker
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.
closing this issue
the docker image has been well received and works pretty flawlessly