Cryptolab: Jupyter

Overview

There are many times in the process of doing some security investigation that it becomes necessary or useful to run some code, but not necessarily useful to write a full program. In addition it would be even more useful if the end result of this coding activity resulting in something that was inherently documented sufficiently so that it would not be useless in a month or so.

Recently I was directed to a software system that seems to offer all of that and more; the Jupyter Notebook. The Jupyter notebook system is browser bases system that enables the development document pages that contain text, graphics, and executable Python code. Although the end result is a functional application, due to the sparse nature of the interface there is minimal necessary effort to develop some GUI interface, no necessary effort to develop a how-to doc (since it really can be self documenting), and inline comments that also function as the documentation for the program and the problem you are addressing with the program.

IMO – this is the ideal type of tool for the type of investigative problems i generally want to investigate as part of security work.

Most importantly, the good news is that all of this can run on Windows 10. I am comfortable with Linux, but from a practical perspective most of the world runs on either Windows or OSX, and life is easier on either of those two platforms than Linux. So – although most of these articles are platform agnostic, it is probably more interesting and useful from a Windows 10 viewpoint.

Setting up Anaconda  / Verifying Jupyter

Installation

  1. Download the current version of Anaconda Python from Continuum (https://www.continuum.io/downloads)
  2. Run the install package.
  3. When complete, it should look like this.  Click finish.
  4. In the search box, enter ‘anaconda’ and select the ‘Anaconda Navigator’ option. 
  5.  Click on the gear in the upper right corner of the Jupyter Notbook tile. If it offers the option to ‘Update Application’, click it. Updates are always good. When complete come back to this panel and click the ‘Launch’ button the Jupyter Notebook tile. This will start the service and should bring up another page in your default web browser that looks something like this.
  6. Click on the ‘New’ button near the top right. This will create a new notebook. 
  7. in the notebook enter the text as shown.  On the menu ‘Cell’, click ‘Run All’, executing the short script entered. 
  8. This is a very simple ‘hello world’ entry to verify that notebook is functional.  Your done installing Jupyter Notebook.
  9. Powertip: Launch Jupyter Notebook faster by running ‘Jupyter Notebook’ directly. Enter ‘jupyter’ in the search bar to find the shortcut.

References

  • https://www.continuum.io/downloads
  • https://ipython.org/
  • https://conda.io/docs/test-drive.html