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
- Download the current version of Anaconda Python from Continuum (https://www.continuum.io/downloads)
- Run the install package.
- When complete, it should look like this. Click finish.
- In the search box, enter ‘anaconda’ and select the ‘Anaconda Navigator’ option.
- 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.
- Click on the ‘New’ button near the top right. This will create a new notebook.
- in the notebook enter the text as shown. On the menu ‘Cell’, click ‘Run All’, executing the short script entered.
- This is a very simple ‘hello world’ entry to verify that notebook is functional. Your done installing Jupyter Notebook.
- Powertip: Launch Jupyter Notebook faster by running ‘Jupyter Notebook’ directly. Enter ‘jupyter’ in the search bar to find the shortcut.