OpenSecurity/Readme.md
changeset 3 65432e6c6042
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/OpenSecurity/Readme.md	Mon Dec 02 14:02:05 2013 +0100
     1.3 @@ -0,0 +1,151 @@
     1.4 +# How To OpenSecurity Demo
     1.5 +
     1.6 +## Installation
     1.7 +
     1.8 +1. Copy the OpenSecurity parent Folder as-is to "C:\Program Files"
     1.9 +
    1.10 +2. Inside this folder you find:
    1.11 +
    1.12 +    OpenSecurity/
    1.13 +    ├── client  ............... OpenSecurity client code
    1.14 +    ├── cygwin  ............... A cygwin subsystem used inside OpenSecurity
    1.15 +    ├── gfx  .................. OpenSecurity images and icons used
    1.16 +    ├── install  .............. Necessary 3rd party installment
    1.17 +    └── server  ............... OpenSecuirty server code
    1.18 +
    1.19 +3. Switch into the "install" folder. There you have:
    1.20 +
    1.21 +    OpenSecurity/
    1.22 +    └── install/
    1.23 +        ├── OpenSecurity.reg
    1.24 +        ├── PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-x32.exe
    1.25 +        ├── PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-x64.exe
    1.26 +        ├── python-2.7.6.amd64.msi
    1.27 +        ├── python-2.7.6.msi
    1.28 +        ├── VirtualBox-4.3.4-91027-Win.exe
    1.29 +        └── web.py-0.37
    1.30 +    
    1.31 +    Please install the software via double-click:
    1.32 +
    1.33 +    * python-2.7.6.msi on 32-Bit
    1.34 +        _or_ 
    1.35 +      python-2.7.6.amd64.msi on 64-Bit
    1.36 +      
    1.37 +    * PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-x32.exe on 32-Bit
    1.38 +        _or_
    1.39 +      PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-x64.exe on 64-Bit
    1.40 +    
    1.41 +    * VirtualBox-4.3.4-91027-Win.exe
    1.42 +    
    1.43 +    If you didn't change any settings you'll have a Win32 Python
    1.44 +    installation at C:\Python27 right now. This is important for 
    1.45 +    the next step.
    1.46 +    
    1.47 +    1. Open up a cmd box --> Start / Execute / "cmd"
    1.48 +    2. Switch into the OpenSecurity folder where the web.py resides:
    1.49 +    
    1.50 +        C:> cd C:\Program Files\OpenSecurity\install\web.py-0.37
    1.51 +        
    1.52 +    3. Install web.py by calling the setup.py with the "install" command
    1.53 +       from within a python shell:
    1.54 +       
    1.55 +        C:\Program Files\OpenSecurity\install\web.py-0.37> C:\Python27\python.exe setup.py install
    1.56 +        running install
    1.57 +        running build
    1.58 +        running build_py
    1.59 +        creating build
    1.60 +        creating build\lib
    1.61 +        creating build\lib\web
    1.62 +        copying web\application.py -> build\lib\web
    1.63 +        copying web\browser.py -> build\lib\web
    1.64 +        copying web\db.py -> build\lib\web
    1.65 +        copying web\debugerror.py -> build\lib\web
    1.66 +        copying web\form.py -> build\lib\web        
    1.67 +        ...
    1.68 +
    1.69 +4. Finally update your registry by double-clicking the OpenSecurity.reg file.
    1.70 +
    1.71 +5. To make changes in effect (automatically starting the OpenSecurity client and server daemons) you should restrat the machine.
    1.72 +
    1.73 +NOTE: 
    1.74 +    Windows will pop up an UAC dialog for X11, OpenSecurity Client Daemon and OpenSecuirty Server Daemon
    1.75 +
    1.76 +    
    1.77 +## VirtualBox VM Images
    1.78 +
    1.79 +For the current setup to work you need at least a single Virtual Machine:
    1.80 +
    1.81 +1. Create a Virtual Machine for Debian Linux
    1.82 +    --> The machine should be named 'Debian 7'
    1.83 +    --> There must be a user called 'user'
    1.84 +
    1.85 +2. Have a Debian 7 (or 7.2) network installation ready and install a fresh new Debian system, with a user called 'user'.
    1.86 +
    1.87 +3. Create 2 (!) Network Interfaces for your Virtual Machine
    1.88 +    a) The first will be set to "NAT" --> this will be eth0
    1.89 +    b) The second will be set to "Host-Only Adapter" --> this will be eth1
    1.90 +
    1.91 +4. Power up the Virtual Machine and set the network interface configuration (/etc/network/interfaces) to:
    1.92 +
    1.93 +    auto lo
    1.94 +    iface lo
    1.95 +    
    1.96 +    auto eth0
    1.97 +    allow-hotplug eth0
    1.98 +    iface eth0 inet dhcp
    1.99 +    
   1.100 +    auto eth1
   1.101 +    iface eth1 inet static
   1.102 +        address 192.168.56.101
   1.103 +        netmask 255.255.255.0
   1.104 +        gateway 192.168.56.1
   1.105 +        
   1.106 +5. Create a passwordless SSH connection from within Cygwin into the VM:
   1.107 +
   1.108 +    a) ensure the VM is started and you have a user login called 'user'.
   1.109 +    b) start a cygwin shell by double-clicking "C:\Program Files\OpenSecurity\cygwin\Cygwin.vbs"
   1.110 +    c) generate a ssh-key
   1.111 +    
   1.112 +        $ ssh-keygen
   1.113 +        
   1.114 +        --> do not set passphrases, leave all to default
   1.115 +    d) copy the public key to the virtual machine
   1.116 +    
   1.117 +        $ scp ~/.ssh/id_rsa.pub user@192.168.56.101:
   1.118 +        
   1.119 +    e) add the public key to the list of authorized keys:
   1.120 +    
   1.121 +        - login into the virtual machine
   1.122 +        - open up a terminal
   1.123 +        
   1.124 +        $ mkdir ~/.ssh &> /dev/null
   1.125 +        $ cat id_rsa.pub >> ~/.ssh/authorized_keys
   1.126 +        
   1.127 +    f) test the passwordless connection by open the cyginw command prompt on the Windows Host again:
   1.128 +    
   1.129 +        $ ssh user@192.168.56.101
   1.130 +        
   1.131 +       --> this should now give you a login shell on the virtual machine without a password request.
   1.132 +        
   1.133 +        (you can now safely delete the id_rsa.pub file in your virtual machine's home)
   1.134 +
   1.135 +
   1.136 +## Demonstration
   1.137 +
   1.138 +* Start the Virtual Machine
   1.139 +    --> You do not have to log in. Just start the machine. If the X11-Login Screen appears, all is done.
   1.140 +    
   1.141 +* Start the opensecurity-client by calling
   1.142 +
   1.143 +    NOTE: you may omit this step if you double-clicked the OpenSecuirty.reg file previously.
   1.144 +
   1.145 +    C:> C:\
   1.146 +    C:> cd "C:\Program Files\OpenSecurity\client"
   1.147 +    C:\Program Files\OpenSecurity\client> start "opensecurity_client_restful_server.py 8090"
   1.148 +    
   1.149 +    
   1.150 +* Open Up a browser and type:
   1.151 +
   1.152 +    "http://127.0.0.1:8090"
   1.153 +    
   1.154 +    HAVE FUN! =D