Setting up drozer

Installing and setting up drozer is fairly straightforward; the set up process is demonstrated for both Windows 7 and Unix/Linux types of systems.

How to do it...

Before we start hacking out some drozer scripts and get to know the exploitation and enumeration modules, you will need to grab a copy of the drozer installer suited to your system. Here's how you do that:

  1. Head over to https://www.mwrinfosecurity.com/products/drozer/community-edition/ to grab a copy of the drozer framework; of course, here I will be talking about the community edition. If you wish to spend some cash on the non-free edition, head over to https://products.mwrinfosecurity.com/drozer/buy.
    How to do it...

    Windows users should click on the drozer (Windows installer) option; it should start downloading the drozer-installer-[version].zip file immediately.

    How to do it...

    Unix/Linux users would, depending on your distribution or OS flavor, choose either the drozer (Debian/Ubuntu Archive) file or the drozer (RPM) package file.

  2. Once you've downloaded the drozer version compatible with your system, you will need to do the following, depending on your system:

    For Windows users:

    1. You will need to unzip/unpack the drozer-installer-[version].zip file to a place/path you can easily remember.
      How to do it...
    2. Once unzipped, run the file called setup.exe included in the ZIP archive. An install wizard should start up as shown in the following screenshot:
      How to do it...
    3. Once the install wizard is set up, all you need to do is follow the prompts, pay attention to the configuration dialogs, and also make sure to take note of where drozer will be installed on your system; you will need to visit this path often to use drozer. Once installation starts, you should see the following dialog appear:
      How to do it...
    4. Once installation is complete, you should have drozer installed to the path you've specified. By default, this is configured to be at the root of the C drive, as shown in the following screenshot:
      How to do it...

      For Unix/Linux users:

      The drozer framework is available in a package file format relevant to your system, so either a DEB file for Debian users or an RPM file for Red Hat users. All you need to do with this file is open it using your package manager, and it will handle the rest. Debian users can make use of the following command to get drozer installed:

      dpkg –I drozer-[version].deb
      
  3. Once drozer is installed, you should try to run it. How you run it will partly depend on your operating system.

    For Windows users:

    1. Open a command prompt and head over to the path you've installed your drozer to. By default—as previously mentioned—this is the C:drozer path.
    2. Invoke drozer by executing the following command:
             C:drozerdrozer
      

      You should see the output similar to the following screenshot:

      How to do it...
    3. As a diagnostic test, try invoking the drozer console. If there's anything wrong, it should notify you of the errors before telling you that the device—which is not attached here—is unavailable or refusing connections. Execute the following command:
             C:drozerdrozer console
      

      Unless you've been clever enough to fix the error, you should see the output similar to the one shown in the following screenshot:

      How to do it...

      This error means drozer cannot locate your Java installation.

  4. Assuming you've already installed Java, you can add drozer to your system PATH variable.

    On Windows Augmenting your PATH variable is pretty straightforward; you start by performing the following steps:

    1. Open My Computer.
    2. Click on System properties.
    3. Under the Control Panel section of the screen, click on Advanced system settings.
      How to do it...
    4. A User Access Control prompt should pop up. If you have administrator access, simply click on OK or enter the administrator password.
    5. On the System Properties dialog, click on the button labeled Environment Variables....
      How to do it...
    6. Once the Environment Variables dialog pops up, under the section labeled System variables, scroll down to the variable called Path and click on Edit….
      How to do it...
    7. Another dialog should pop up, allowing you to edit the PATH variable. Add the following string to the end of the value:
             ;C:Program FilesJavajre7

For Unix/Linux users:

  1. You can invoke drozer by executing the following command from your terminal window:
    drozer
    
  2. If all is well, you should see exactly the same output as the Windows drozer edition.
  3. If Java has not been added to your PATH variable, execute the following command to get it added:
    PATH=$PATH:`which java
    

    To make this persistent, add the previous command line to the end of your /home/[user]/.bashrc file.

There's more…

Before drozer can get up and running, you will need to install the drozer Agent on an Android device. This is pretty simple; here's how you do it:

  1. Assuming the device is connected to your host machine via USB, you can install the drozer.apk file as follows:
    adb install drozer.apk
    
  2. For this to work, you need to make sure that Unknown Sources and USB Debugging are both enabled for the target Android device.

    On launching drozer, you should see the following:

    There's more…
  3. To make using the drozer console from the command-line interface a little easier, you could also add drozer itself to your system PATH variable.

    For Windows users:

    1. Access the Environment Variable dialog as described in the previous recipe.
    2. Add the following string to your PATH variable:

             ;C:drozerdrozer
      

    If you are a Unix/Linux user, execute the following command from your terminal:

    PATH=$PATH:`which drozer`
    

    To make this persistent, add the previous command line to the end of your /home/[user]/.bashrc file.

If the DEB file fails to install, there is another way to get drozer installed that is relatively painless. To get drozer installed without the DEB package, perform the following steps:

  1. To start off, grab a copy of the Python development headers and packages by executing the following command:

    apt-get install python-dev
    
  2. Grab a copy of the Python setup tools by executing the following command:

    apt-get install python-setuptools
    
  3. Install the 32-bit support libraries for your Debian system:

    apt-get install ia32-libs-i386
    
  4. Install the Python dependencies; the first one is protobuf, which you can install by executing the following command:
    easy_install –allow-hosts pypi.python.org protobuf==2.4.1
    
  5. Once protobuf is installed, you'll need to install twisted for python, which you can do by executing the following command:
    easy_install twisted==10.2.0
    

  6. What you need to do then is grab a copy of the drozer architecture independent package available at https://www.mwrinfosecurity.com/system/assets/571/original/drozer-2.3.2.tar.gz.
  7. Once downloaded, unpack this into some directory of your choice. Once unpacked, it should contain a file called drozer-[version]-py2.7.egg. You can then install this EGG by executing the following command:
    easy_install drozer-[version]-py2.7.egg
    

    And that's it—drozer should be ready to rock!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.44.94