Building weak credential vulnerability checks
The Security Consoleincludes a framework for creating complex vulnerability checksusing a simple XML format. These vulnerability checks are split across two or more files which are parsed by the Security Console when the scan engine is started.
This article covers a basic example for a vulnerability check that looks for weak credentials, called weak_creds.pl.
This vulnerability check is community-built. This article was migrated from a separate Rapid7 community resource that has since been deprecated. Rapid7 will not be able to provide support or troubleshooting assistance for this example or other custom-built vulnerability checks.
Usage
Usage: weak_creds.pl [Options]
Input options:
-s --services [service(s)] Service(s) to generate weak creds checks for (comma-seperated)
-u --usernames [file] File of usernames (one per line)
-p --passwords [file] File of passwords (one per line)
-r --realms [file] File of realms (one per line) - (*optional*)
-d --dir [dir] Output directory (default: $service/) - (*optional*)
For databases, the realm represents the database name. If a realm file is not passed, weak_creds.pl uses the default database name.
Supported Services include db2, tds, mysql, postgres, ssh, ftp, telnet, rsh, oracle, cifs, tomcat, and as400
Example
Runningweak_creds.plwill generate the new.vckand.xmlfiles within a directory corresponding to the service for the checks.
$ ./weak_creds.pl -s ssh -u usernames.txt -p passwords.txt
$ ls ssh/*
ssh/ssh-weak-creds-account-foo-password-bar.vck
ssh/ssh-weak-creds-account-foo-password-bar.xml
Deploy your vulnerability checks
To deploy this vulnerability check into the Security Console, simply copy your.xmland.vckfiles into the following directory for the Security Console and any paired Scan Engines:
cp -vf ssh/* /opt/rapid7/nexpose/plugins/java/1/CustomScanner/1/
Next, restart the Security Console. You should see something like the following message in the log:
NSC 3/13/10 11:10 AM: Imported 1 new and 0 modified vulnerabilities in 22 seconds
How to manually load your check content
Within the the Security Console’s and Scan Engine’s command line interfaces, new vulnerability checks and descriptions may be loaded without restarting the respective services. The load content command initiates a background reload of vulnerability information.
> load content
2018-01-03T11:29:21 [INFO] > load content
2018-01-03T11:29:28 [INFO] Loading vulnerability and solution managers.
2018-01-03T11:29:35 [INFO] [Started: 2018-01-03T16:29:28] [Duration: 0:00:07.102] Completed loading vulnerability and solution managers
2018-01-03T11:29:35 [INFO] Loading vulnerability check manager.
... content trimmed for this article ...
2018-01-03T11:35:02 [INFO] Load Content command complete.