Skip to content

Instantly share code, notes, and snippets.

@xep624
Created September 5, 2017 13:31
Show Gist options
  • Save xep624/9f6bc8f8f6dd43d3a85d89b398c3838a to your computer and use it in GitHub Desktop.
Save xep624/9f6bc8f8f6dd43d3a85d89b398c3838a to your computer and use it in GitHub Desktop.
A script to run Drozer console on Mac OS
#!/bin/bash
# This script requires installed drozer on your computer (https://github.com/mwrlabs/drozer)
# and agent.apk on your device/emulator ($ adb install agent.apk)
# Before running this script, you should firstly invoke these commands:
# $ virtualenv drozer_env
# $ source drozer_env/bin/activate
# $ ./drozer_env.sh
#
# Problem description:
# On Mac OS versions from El Capitan don't have OpenSSL installed, so compiling pyOpenSSL
# doesn't work. Drozer also depends on older versions of some libraries. In order not to
# mess up the system Python setup, it is better to install Python with homebrew and
# creating a dedicated environment with virtualenv.
wget https://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.tar.gz
tar xzvf pyOpenSSL-0.13.tar.gz
cd pyOpenSSL-0.13
sed -i '' 's/X509_REVOKED_dup/X509_REVOKED_dupe/' OpenSSL/crypto/crl.c
python setup.py build_ext -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include
python setup.py build
python setup.py install
easy_install protobuf==2.4.1 twisted==10.2.0
wget https://github.com/mwrlabs/drozer/releases/download/2.3.4/drozer-2.3.4.tar.gz
tar xzf drozer-2.3.4.tar.gz
easy_install drozer-2.3.4-py2.7.egg
adb forward tcp:31415 tcp:31415
drozer console connect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment