Skip to content

Instantly share code, notes, and snippets.

@kristovatlas
Last active February 16, 2020 11:58
Show Gist options
  • Save kristovatlas/ab5d8a481e373bda7d4118b8fb0e294d to your computer and use it in GitHub Desktop.
Save kristovatlas/ab5d8a481e373bda7d4118b8fb0e294d to your computer and use it in GitHub Desktop.
Instructions for setting up drozer in MacOS 10.11 "El Capitan"
#Based on https://blog.ropnop.com/installing-drozer-on-os-x-el-capitan/
#Install recent python 2 and viritualenvwrapper
brew install python
brew upgrade python
pip install virtualenvwrapper
#At this point if you try to run mkvirtualenv, you'll get an error message. To resolve, follow the instructions indicated in /usr/local/bin/virtualenvwrapper.sh. In my current copy, they are:
# 1. Create a directory to hold the virtual environments.
# (mkdir $HOME/.virtualenvs).
# 2. Add a line like "export WORKON_HOME=$HOME/.virtualenvs"
# to your .bashrc.
# 3. Add a line like "source /path/to/this/file/virtualenvwrapper.sh"
# to your .bashrc.
# 4. Run: source ~/.bashrc
# 5. Run: workon
# 6. A list of environments, empty, is printed.
# 7. Run: mkvirtualenv temp
# 8. Run: workon
# 9. This time, the "temp" environment is included.
# 10. Run: workon temp
# 11. The virtual environment is activated.
mkdir $HOME/.virtualenvs
echo "#virtualenvwrapper settings" >> ~/.bash_profile
echo "export WORKON_HOME=$HOME/.virtualenvs" >> ~/.bash_profile
echo "source `which virtualenvwrapper.sh`" >> ~/.bash_profile
source ~/.bash_profile
#Enter viritual env
mkvirtualenv drozer
workon drozer
#Acquire and patch pyOpenSSL
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
#Build and install pyOpenSSL
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
#Install other dependencies
$ easy_install --allow-hosts pypi.python.org protobuf==2.4.1
$ easy_install twisted==10.2.0 #ignore any warnings/errors, it works
#Download and Install Drozer
#Manual TODO: Get latest drozer egg from: https://www.mwrinfosecurity.com/products/drozer/
#Don't forget to validate that the file is legit using your preferred method.
easy_install drozer-x.x.x-py2.7.egg
#Optional: Make Drozer accessible from any virtual environment with a shortcut
echo '#!'"$HOME/.virtualenvs/drozer/bin/python" > /usr/local/bin/drozer
echo "# EASY-INSTALL-SCRIPT: 'drozer==2.3.4','drozer'" >> /usr/local/bin/drozer
echo "__requires__ = 'drozer==2.3.4'" >> /usr/local/bin/drozer
echo "__import__('pkg_resources').run_script('drozer==2.3.4', 'drozer')" >> /usr/local/bin/drozer
chmod +x /usr/local/bin/drozer #make accessible to other virtual envs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment