Skip to content

Commit cc80e62

Browse files
committed
Update README with procedures.
1 parent 0e37cad commit cc80e62

3 files changed

Lines changed: 62 additions & 16 deletions

File tree

README.md

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ This project creates provides a couple utilities that culminate in a shrunken-do
44

55
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.
66

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+
```
818

919
## NessusAPI
1020

@@ -13,13 +23,27 @@ An extension of the [pyTenable](https://github.com/tenable/pyTenable) library fo
1323
### [`nessusapi.py`](src/NessusAPI/nessusapi.py)
1424
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.
1525

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.
27+
1628
### [`nessus-configure.py`](src/NessusAPI/nessus-configure.py)
1729
Creates a `Nessus` API instance using [`pyTenable`](https://github.com/tenable/pyTenable) and loads Policies/Credentials and scans in using a passed `config.json`
1830

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:
40+
$ nessus-configure --interactive /path/to/config.json
41+
```
42+
**TODO:** Update nessus-configure to pass args to allow exporting as pdf and csv with all columns.
2043

2144
***NOTE:*** I have a TODO to document the code properly later -- this was a rush job needed for another project of mine.
2245

46+
2347
## "TenableCore" Imitation
2448

2549
This is broken into a couple parts.
@@ -31,8 +55,23 @@ This is broken into a couple parts.
3155
## NetworkCtl
3256

3357
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+
3462
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.
3563

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+
3675
***
3776

3877
## Build Process
@@ -42,15 +81,13 @@ This is currently in process to be **fully** automated
4281
Recreate distribution files and `scp` them to the VM:
4382
```sh
4483
$ ./build.sh
45-
$ scp ./dist/installer/* root@192.168.56.101:/tmp
84+
$ scp ./dist/installer/* root@192.168.56.101:/opt
4685
```
4786

4887
Log into the VM and install/configure ACAS:
4988
```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
5491
```
5592

5693
Watch the prompts in the output to:
@@ -70,10 +107,25 @@ Remove the build script:
70107
Once complete, copy the VM virtual disk into `./dist/vm/`. Pack this entire folder to make the portable installation. </br>
71108
You can compress the VM and copy the archive instead using this example:
72109
```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
74111
```
75112

76113
***
77114
***
78115

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+
79131
**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*

build.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function usage_all(){
4444
echo ' ./build.sh install TODO'
4545
}
4646

47-
function build_tar_dist(){
47+
function build_tar_local_installer(){
4848
# The final TGZ and install script is outputted into the ./dist folder
4949
mkdir -p ./dist/installer
5050

@@ -66,12 +66,6 @@ function build_tar_dist(){
6666
cp ./install/utils/build_tenablecore.sh ./dist/installer
6767
}
6868

69-
function build_vmdk(){
70-
# build vm with base image option
71-
# mkdir -p ./dist/vm
72-
echo 'TODO: NOT IMPLEMENTED'
73-
}
74-
7569
function build_vm_dist(){
7670
# cp ./install/utils/TenableCore.sh ./dist/vm/
7771
# tar -czvf ./dist/vm/TenableCore.tar.gz -C "~/VirtualBox VMs/TenableCore" TenableCore.vmdk
@@ -102,4 +96,4 @@ function build_vm_dist(){
10296
# esac
10397

10498

105-
build_tar_dist
99+
build_tar_local_installer

0 commit comments

Comments
 (0)