- Determine which new Nessus plugins where downloaden during the last sync
- Determine what has changed in the Nessus plugins
- Having a backup of all the Nessus plugins before synchronization
Create a copy of the Nessus Plugin Directory.
On linux the source location is /opt/nessus/lib/nessus/plugins
cp -rp /opt/nessus/lib/nessus/plugins /home/user/plugins
Update Nessus Plugins
/opt/nessus/sbin/nessuscli update --plugins-only
Verify difference between source and copy
Which files differ:
diff --brief --recursive /opt/nessus/lib/nessus/plugins/ /home/user/plugins Files /opt/nessus/lib/nessus/plugins/antivirus.inc and /home/user/plugins/antivirus.inc differ Files /opt/nessus/lib/nessus/plugins/MD5 and /home/user/plugins/MD5 differ Files /opt/nessus/lib/nessus/plugins/plugin_feed_info.inc and /home/user/plugins/plugin_feed_info.inc differ
What has changed:
git diff --no-index /home/user/plugins/ /opt/nessus/lib/nessus/plugins/ diff --git a/home/user/plugins/MD5 b/opt/nessus/lib/nessus/plugins/MD5 index bca5f8e..08cae3c 100644 --- a/home/user/plugins/MD5 +++ b/opt/nessus/lib/nessus/plugins/MD5 @@ -1 +1 @@ -04af5932253756b89932c32e1829b6ec +69e36ffb1f548de051b39af689310654 diff --git a/home/user/plugins/antivirus.inc b/opt/nessus/lib/nessus/plugins/antivirus.inc index 1f94052..1953c1a 100644 --- a/home/user/plugins/antivirus.inc +++ b/opt/nessus/lib/nessus/plugins/antivirus.inc @@ -8,7 +8,7 @@ # @[email protected] # # antivirus.inc -# $Revision: 1.998 $ +# $Revision: 1.999 $ <output truncated>
Save the output to a file
To automate this a step further we can save the output to a file
diff --brief --recursive /opt/nessus/lib/nessus/plugins/ /home/user/plugins > diff$(date +"%Y%m%d")
Added –color-words to preserve the color coding.
To make the file readable again we can convert it to a html file with ansifilter.
ansifilter -i diff_details$(date +"%Y%m%d") -H -o diff_details$(date +"%Y%m%d").html
Now we have all the steps to put it into a simple script and schedule it.