Not Just for Vulnerabilities
Nessus can run audit files, which are XML-based and can execute PowerShell commands. In this post, we’ll break down the functionality of these audit files.
The first tag is to identify the audit file type. In our case a Windows audit file.
After this comes the group tag. This helps organize the audit file in Nessus.
Now, we get into the more interesting tags. The IF, THEN, ELSE tags. These tags are optional. However, I highly recommend utilizing them. This allows for a conditional check(s) to be performed before proceeding with the rest of the checks.
In our case, we’re the Windows registry to ensure that the system is running Windows, and IF it is, THEN proceed with the rest of the checks; ELSE record “NOTE: Nessus has not identified that the chosen audit applies to the target device.”
The condition tag in the IF tag is optional and not necessary in this example. However, this can be used in to add Boolean logic with an AND/OR type. This allows for multiple checks before proceeding with the rest of the checks.The next tag is where the real work is done. The check occurs in a custom item. Seven values are needed for a successful check. First, “type”. Instead of explaining all the types of custom items, here’s a link to Tenable’s custom items.
In our example, the custom item type is “REGISTRY_SETTING”, which checks if our system is running Windows. The value “description” is just that. It will also be the Plugin Name within Nessus. The “value_type” value “POCILY TEXT” check with “value_data” value, comparing against the “reg_key” and “reg_item” with the “check_type” value “CHECK_REGEX”. Basically, we’re using a regex to check is a Windows registry is running Windows.
If the custom item check passes then move on the next custom item, and in our case that our be ADUIT_POWERSHELL. This check runs powershell.exe on the remote server along with the arguments supplied with powershell_args. Yes, any Powershell argument. In our case we are listing out all the file in the folder “C:\Users\”.





Comments
Post a Comment