<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://dev1galaxy.org/extern.php?action=feed&amp;tid=126&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Creating a start and stop script for Nessus and nexpose]]></title>
		<link>http://dev1galaxy.org/viewtopic.php?id=126</link>
		<description><![CDATA[The most recent posts in Creating a start and stop script for Nessus and nexpose.]]></description>
		<lastBuildDate>Mon, 30 Jan 2017 21:32:21 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Creating a start and stop script for Nessus and nexpose]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=535#p535</link>
			<description><![CDATA[<p>I just have installed Nessus vulnerability scanner on my devuan , and i notice that after the instalation no icons were created on the menu to start the service or stop it , this is important not only for this app but also for many others apps that load many computer resources and you are not already working on it .<br />This topic was created for those that use a specific app for 1 or 2 hours and then does not use it on that day for many more hours ahead and want to kill the services of that app to save computer resources .</p><p>I created a script for start for each app , and another script for stop for each app and have put them on (/usr/local/sbin) directory .</p><p>In case of&#160; nessus , the scripts are called &quot;nessus-start&quot; &amp; &quot;nessus-stop&quot;<br />for nexpose i used the same principle , witch is &quot;nexpose-start&quot; and &quot;nexpose-stop&quot;</p><p><strong>The script to start nessus</strong></p><div class="codebox"><pre><code>#!/bin/bash
service nessusd start
echo &quot; Nessus service has started , reedirecting to nessus loginpage in 3 seconds&quot;
sleep 3
open firefox &quot;https://127.0.0.1:8834/&quot;</code></pre></div><p>this last script initiates nessus script and redirect the user to nessus login page witch is on localmacine &quot;127.0.0.1&quot; and the default port 8834 using https .</p><p> <strong>The script to stop nessus </strong></p><div class="codebox"><pre><code>#!/bin/bash
echo &quot;Stopping Nessus service&quot;
service nessusd stop
echo &quot;Service stopped&quot;
sleep 3s</code></pre></div><p><strong> NOTE: you can add the shortucts to the main menu using this other topic i created </strong><br /><a href="https://dev1galaxy.org/viewtopic.php?id=124" rel="nofollow">https://dev1galaxy.org/viewtopic.php?id=124</a><br /> <strong> but using this code for command : </strong></p><div class="codebox"><pre><code>sh -c &quot;cd /usr/local/sbin &amp;&amp; ./nessus-start;${SHELL:bash}&quot;</code></pre></div><p>with this code the shell window will close automatically after all commands are done in the script , but if you want the shell opened after the script finish , then use this code :</p><div class="codebox"><pre><code>sh -c &quot;cd /usr/local/sbin &amp;&amp; ./nessus-start;${SHELL:-bash}&quot;</code></pre></div><p>For Nexpose the scripts are diffent because nexpose starts multiple services , (postgresql , couchdb , etc...) .</p><p><strong> The script to start nexpose in case was made in its default instalation directory (the default is : /opt/rapid7/nexpose) </strong></p><div class="codebox"><pre><code>#!/bin/bash
echo &quot; Starting Nexpose Service ,and redirecting you to nexpose login page https://127.0.0.1:3780&quot;
echo &quot;Nexpose services takes a minute to be operational , so refresh your browser in 1 minute&quot;
service nexposeconsole start
sleep 4s
open firefox &quot;https://127.0.0.1:3780/&quot;
cd /opt/rapid7/nexpose/nsc &amp;&amp; ./nsc.sh</code></pre></div><p>Nexpose is a very heavy app that takes sometime to load , around here it takes 1 minute until i get access to web login interface , so that was the reason i left that message in the bash script o user reload the page in one minute , and i started a 4 seconds pause after that so user can read the message .</p><p><strong> The script to stop nexpose services </strong></p><div class="codebox"><pre><code>#!/bin/bash
echo &quot; Killing all processes related to nexpose&quot;
service nexposeconsole stop
killall -u nxpgsql
kill $(ps aux | grep &#039;nsc.sh&#039; | awk &#039;{print $2}&#039;)</code></pre></div><p>This stop script kills all processes related to username created by rapid 7 installation for services &quot;nxpgsql&quot; , and kills the active terminal window where startup script is running (that must not be closed) .</p><p>You should aldo install chkconfig tool to remove those boot services from boot startup</p><div class="codebox"><pre><code> apt-get install chkconfig</code></pre></div><p>and issue the command on terminal :</p><div class="codebox"><pre><code>chkconfig nessusd off &amp;&amp; chkconfig nexposeconsole off</code></pre></div><p><strong> Note2: I believe that this topic is not much related to devuan normal users , however system administrators use this tools to check vulnerabilities on their servers before someone outside do some harm to company web services . <br />I also post it because i may need it in a few months or years and i may not remember at that time how did i do it. </strong></p>]]></description>
			<author><![CDATA[dummy@example.com (pedropt)]]></author>
			<pubDate>Mon, 30 Jan 2017 21:32:21 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=535#p535</guid>
		</item>
	</channel>
</rss>
