Installing NSIA » History » Version 20
Luke Murphey, 11/28/2010 02:07 AM
1 | 10 | Luke Murphey | {{>toc}} |
---|---|---|---|
2 | 10 | Luke Murphey | |
3 | 1 | Luke Murphey | h1. Installing NSIA |
4 | 1 | Luke Murphey | |
5 | 1 | Luke Murphey | h2. Prerequisites |
6 | 1 | Luke Murphey | |
7 | 3 | Luke Murphey | NSIA requires "Java runtime environment (JRE)":http://java.sun.com/javase/downloads/index.jsp 1.6 or later. |
8 | 1 | Luke Murphey | |
9 | 15 | Luke Murphey | Note that some Linux operating systems (such as Ubuntu) include GCJ instead of Sun Java. GCJ is not currently supported and should not be used for running the V. On Ubuntu, run the following command to install Java (note that the Debian package will automatically prompt you to install this since it Sun Java is specified as a dependency): |
10 | 1 | Luke Murphey | |
11 | 11 | Luke Murphey | @sudo apt-get install sun-java6-jre@ |
12 | 1 | Luke Murphey | |
13 | 2 | Luke Murphey | Otherwise, go to Sun Microsystems’ website to "download the Java 6 JRE":http://java.sun.com/javase/downloads/index.jsp. |
14 | 1 | Luke Murphey | |
15 | 1 | Luke Murphey | h2. Installation Methods |
16 | 1 | Luke Murphey | |
17 | 15 | Luke Murphey | NSIA has three installation methods: Windows installer, Debian package and the archive method (no installer). |
18 | 1 | Luke Murphey | |
19 | 1 | Luke Murphey | h3. Windows Installer |
20 | 1 | Luke Murphey | |
21 | 1 | Luke Murphey | The installer only works on Windows. In addition to installing the application, the installer will install NSIA as a service. By default, it uses the internal database. An external database can be configured by updating the config.ini file (see below). |
22 | 1 | Luke Murphey | |
23 | 15 | Luke Murphey | h3. Debian Package (for Ubuntu) |
24 | 15 | Luke Murphey | |
25 | 17 | Luke Murphey | The Debian package (.deb) is designed for installation on recent versions of Ubuntu. Note that the installer will ask the user during the install to specify the administrator account username and password. Below is an example of the commands you would enter to download and install NSIA: |
26 | 17 | Luke Murphey | |
27 | 17 | Luke Murphey | <pre> |
28 | 19 | Luke Murphey | sudo wget https://threatfactor.com/Support/Files/nsia-1.0.0.deb |
29 | 19 | Luke Murphey | sudo dpkg -i nsia-1.0.0.deb |
30 | 17 | Luke Murphey | </pre> |
31 | 17 | Luke Murphey | |
32 | 17 | Luke Murphey | The package will automatically set NSIA to start at boot. Once the install is done, you can access NSIA with a web browser to http://localhost:8080. |
33 | 15 | Luke Murphey | |
34 | 1 | Luke Murphey | h3. Archive Method (No Installer) |
35 | 1 | Luke Murphey | |
36 | 1 | Luke Murphey | The zip archive should be used on non-Windows platforms (but can also be used on Windows). After unzipping the archive, run install.sh (on Unix/Linux) or install.bat (on Windows) to create the default user and initialize the database. |
37 | 1 | Luke Murphey | |
38 | 15 | Luke Murphey | h2. Configuring Java Runtime |
39 | 4 | Luke Murphey | |
40 | 20 | Luke Murphey | You may need to change the amount of memory that the Java runtime uses. The JVM settings can be configured in etc/config.ini. The config.ini file will be loaded by the ThreatFactor binaries (such as ThreatFactor NSIA.exe) and user to configure the Java runtime. Note that the settings in this file won't affect NSIA if you run it directly by calling Java. Additionally, you can specify the path of the Java runtime to use. |
41 | 1 | Luke Murphey | |
42 | 1 | Luke Murphey | Below is an example of the a configuration file: |
43 | 1 | Luke Murphey | |
44 | 1 | Luke Murphey | <pre> |
45 | 1 | Luke Murphey | # This sets the arguments sent to the Java virtual machine |
46 | 1 | Luke Murphey | JVM.Arguments=-Xmx512m |
47 | 20 | Luke Murphey | |
48 | 20 | Luke Murphey | # This defines the path to the Java runtime |
49 | 20 | Luke Murphey | JVM.Executable=C:\Windows\system32\java.exe |
50 | 1 | Luke Murphey | </pre> |
51 | 12 | Luke Murphey | |
52 | 1 | Luke Murphey | h2. Running as a Service / Daemon |
53 | 1 | Luke Murphey | |
54 | 1 | Luke Murphey | It you want NSIA st start every time the host starts, then it will need to be installed as a daemon (Unix) or service (Windows). |
55 | 1 | Luke Murphey | |
56 | 12 | Luke Murphey | h3. Installing as a Daemon (Linux/Unix) |
57 | 1 | Luke Murphey | |
58 | 15 | Luke Murphey | On Linux, you can use one of the init scripts to have NSIA start when the host boots. Note that Debian package sets this up for you. The init scripts are provided with zipped archive version of NSIA. Copy the init script into the /etc/init.d/ directory. You’ll need to create symlinks in the appropriate run levels for NSIA to start automatically on startup. On Ubuntu, you can use update-rc.d to create the symlinks for you: |
59 | 1 | Luke Murphey | |
60 | 1 | Luke Murphey | <pre> |
61 | 1 | Luke Murphey | sudo update-rc.d -f nsia defaults |
62 | 1 | Luke Murphey | sudo chmod 755 /etc/init.d/nsia |
63 | 1 | Luke Murphey | </pre> |
64 | 1 | Luke Murphey | |
65 | 1 | Luke Murphey | The init script assumes that NSIA is installed in /opt/nsia; edit the init script if it is installed in another location. Additionally, you will need to edit the init script if you want to change the command-line arguments that are sent to NSIA (for example, if you wish to specify the amount of memory that the Java runtime allocates, set the location of the config file, etc.). |
66 | 1 | Luke Murphey | |
67 | 1 | Luke Murphey | Note that NSIA should start after networking since it will try to initiate scanning after starting. |
68 | 1 | Luke Murphey | |
69 | 12 | Luke Murphey | h3. Installing as a Service (Windows) |
70 | 1 | Luke Murphey | |
71 | 15 | Luke Murphey | On Windows, NSIA needs to be installed as a service to automatically run every time the system starts. Note that the Windows installer does this for you automatically. To do this, install the included Win32 service using sc.exe: |
72 | 1 | Luke Murphey | |
73 | 1 | Luke Murphey | <pre> |
74 | 19 | Luke Murphey | sc create "nsia" DisplayName= "Threatfactor NSIA" binPath= "\"C:\Program Files\ThreatFactor.com\NSIA\bin\ThreatFactor NSIA Service.exe\"" |
75 | 1 | Luke Murphey | </pre> |
76 | 1 | Luke Murphey | |
77 | 19 | Luke Murphey | The above command assumes that NSIA is installed in "C:\Program Files\ThreatFactor.com\NSIA\bin\ThreatFactor NSIA Service.exe"; change the arguments as necessary. Make sure that the ''ThreatFactor NSIA Service.exe'' file is in the same path as the ''nsia.jar'' file (it won't be able to find it otherwise). Also, make sure that the binPath argument is double-quoted twice (includes the \"'s); otherwise, the service will not start if "Threatfactor NSIA.exe" is in the same directory as the "ThreatFactor NSIA Service.exe" (which it is by default). |
78 | 6 | Luke Murphey | |
79 | 6 | Luke Murphey | h2. Using an External Database |
80 | 6 | Luke Murphey | |
81 | 14 | Luke Murphey | By default, NSIA uses an internal database. However, it is possible to use a database that is accessed over a JDBC connection. See [[External Database]] for more information. |
82 | 7 | Luke Murphey | |
83 | 9 | Luke Murphey | h2. Running NSIA |
84 | 9 | Luke Murphey | |
85 | 9 | Luke Murphey | NSIA can be run three different ways: with the interactive CLI, GUI or as a service/daemon: |
86 | 9 | Luke Murphey | |
87 | 16 | Luke Murphey | | |*On Windows* |*On Unix/Linux* | |
88 | 16 | Luke Murphey | |Run From the Command-Line |Run ThreatFactor NSIA CLI.exe |Run "./ThreatFactor NSIA" | |
89 | 16 | Luke Murphey | |Run the GUI |Run ThreatFactor NSIA.exe |Run "./ThreatFactor NSIA GUI" | |
90 | 16 | Luke Murphey | |Run as a Windows Service |Start it from the command-line with "net start nsia" or with services.msc |NA | |
91 | 16 | Luke Murphey | |Run as a Unix Daemon |NA |sudo /etc/init.d/nsia start | |
92 | 9 | Luke Murphey | |
93 | 7 | Luke Murphey | h2. Configuring SSL |
94 | 7 | Luke Murphey | |
95 | 13 | Luke Murphey | By default, the web-interface does not use SSL. However, NSIA can be [[Configuring SSL|setup to use SSL]] instead. |