-
Notifications
You must be signed in to change notification settings - Fork 5
/
launch_nessus.py
44 lines (39 loc) · 1.04 KB
/
launch_nessus.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#! /usr/bin/env python
# Script written to launch proper daemon, and gui nessus v2.2.8 or v3.0.3
# The script expects the default install directories to have been used.
# v2.2.8 is /usr/local
# v3.0.3 is /opt/nessus
# 6/19/2006
import sys, os
def usage():
print """Usage: launch_nessus.py [OPTIONS]
With no options version 2 is default.
2 Use version 2 (/usr/local/sbin/nessusd)
3 Use version 3 (/opt/nessus/sbin/nessusd)
"""
nargs=len(sys.argv)
if nargs <= 1:
print "Using Nessus version 2."
ver='2'
else:
ver=sys.argv[1]
if ver == '2':
daemon='sudo /usr/local/sbin/nessusd -D'
gui='/usr/local/bin/nessus&'
#print "-- daemon: ", daemon
#print "-- gui: ", gui
elif ver == '3':
daemon='sudo /opt/nessus/sbin/nessusd -D'
gui='/usr/X11R6/bin/NessusClient&'
#print "-- daemon: ", daemon
#print "-- gui: ", gui
else:
#print 'That version is unsupported'
usage()
sys.exit(2)
print "Stopping currently running nessusd."
os.popen("sudo pkill nessusd")
print "Starting ", daemon
os.popen(daemon)
print "Starting ", gui
os.popen(gui)