You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-8Lines changed: 60 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,17 @@ This project creates provides a couple utilities that culminate in a shrunken-do
4
4
5
5
It's annoying that without any of the paid options by Tenable, I can't have a monolithic config file that instantiates scans, and imports credentials into a policy file.
6
6
7
-
**This fixes that**
7
+
***This fixes that***
8
+
9
+
The only thing you still have to do is install or rebuild plugins (useful for troubleshooting):
10
+
11
+
```sh
12
+
# Install new plugins
13
+
$ nessuscli update PLUGINS.tar.gz
14
+
15
+
# Recompile plugins manually
16
+
$ nessusd -R
17
+
```
8
18
9
19
## NessusAPI
10
20
@@ -13,13 +23,27 @@ An extension of the [pyTenable](https://github.com/tenable/pyTenable) library fo
13
23
### [`nessusapi.py`](src/NessusAPI/nessusapi.py)
14
24
The [nessusapi](src/NessusAPI/nessusapi.py) implements a few methods, namely `import_policy()` and `add_credentials()` which send a PUT/POST request to the Nessus backend API to add credentials to a specific policy.
15
25
26
+
The [`example-config.json`](src/NessusAPI/configs/example-config.json) is an example config file. The `credentials` object inside it closely mimics the PUT request data that Nessus executes when it adds credentials to a policy file.
Creates a `Nessus` API instance using [`pyTenable`](https://github.com/tenable/pyTenable) and loads Policies/Credentials and scans in using a passed `config.json`
18
30
19
-
The [`example-config.json`](src/NessusAPI/configs/example-config.json) is an example config file. The `credentials` object inside it closely mimics the PUT request data that Nessus executes when it adds credentials to a policy file.
31
+
```sh
32
+
33
+
# Load the Policies/Configs into Nessus
34
+
$ nessus-configure -i /path/to/config.json
35
+
36
+
# Export Complete or Imported Scans
37
+
$ nessus-configure -e /path/to/config.json
38
+
39
+
# You can also programatically interact with nessus:
**TODO:** Update nessus-configure to pass args to allow exporting as pdf and csv with all columns.
20
43
21
44
***NOTE:*** I have a TODO to document the code properly later -- this was a rush job needed for another project of mine.
22
45
46
+
23
47
## "TenableCore" Imitation
24
48
25
49
This is broken into a couple parts.
@@ -31,8 +55,23 @@ This is broken into a couple parts.
31
55
## NetworkCtl
32
56
33
57
A small utility script that wraps `nmcli` to clear, list, and load network profiles.</br>
58
+
All you need to do is create a `*.nmconnection` file manually or with `nmtui` and put it in `./TenableCore/NetworkManager` and the `build.sh` will install it with permissions: `rw------- root:root /etc/NetworkManager/system-connections/*.nmconnection`
59
+
60
+
Make sure the syntax is good otherwise it won't load.
61
+
34
62
The main benefit here is `networkctl load PROFILE` will load all profiles starting with `PROFILE` -- a useful utility for loading an interface and all its VLANs simultaneously.
35
63
64
+
```sh
65
+
# list connection profiles (nmcli con show)
66
+
$ networkctl list
67
+
68
+
# restart networking only loading connections starting with the name eth0_vlan
69
+
$ sudo networkctl load eth0_vlan
70
+
71
+
# clear all network connection profiles
72
+
$ sudo networkctl clear
73
+
```
74
+
36
75
***
37
76
38
77
## Build Process
@@ -42,15 +81,13 @@ This is currently in process to be **fully** automated
42
81
Recreate distribution files and `scp` them to the VM:
43
82
```sh
44
83
$ ./build.sh
45
-
$ scp ./dist/installer/* root@192.168.56.101:/tmp
84
+
$ scp ./dist/installer/* root@192.168.56.101:/opt
46
85
```
47
86
48
87
Log into the VM and install/configure ACAS:
49
88
```sh
50
-
$ su root
51
-
# cd /tmp
52
-
# chmod 700 ./build_tenablecore.sh
53
-
# ./build_tenablecore.sh
89
+
$ cd /opt
90
+
$ sudo ./build_tenablecore.sh
54
91
```
55
92
56
93
Watch the prompts in the output to:
@@ -70,10 +107,25 @@ Remove the build script:
70
107
Once complete, copy the VM virtual disk into `./dist/vm/`. Pack this entire folder to make the portable installation. </br>
71
108
You can compress the VM and copy the archive instead using this example:
72
109
```sh
73
-
$ tar -czvf ./dist/vm/TenableCore.tar.gz -C "~/VirtualBox VMs/TenableCore" TenableCore.vmdk
110
+
$ tar -czvf ./dist/vm/TenableCore.tar.gz -C "~/VirtualBox VMs/TenableCore" TenableCore.vdi
74
111
```
75
112
76
113
***
77
114
***
78
115
116
+
## Test Setup
117
+
118
+
Note that the purpose of this VM is to scan things on-demand --- as in you plug it in, scan, export, and delete it.
119
+
120
+
- VirtualBox 7.1
121
+
- 8 GB RAM
122
+
- 4 Threads
123
+
- No usb, shared folders, or audio
124
+
- No optical/floppy drives
125
+
126
+
The VM in use is Oracle 9.4 with the Unbreakable Enterprise Kernel (UEK). <br>
127
+
I install using LVM Thin Partitioning on a 20GB disk. KDump is turned off with no security policy enabled.
128
+
129
+
***
130
+
79
131
**Side Note:***I should **probably** rename this to ACAS-API since it's more fitting and I don't want to get sued by Tenable*
0 commit comments