I could not find any match for the vulnerabilities with their CVE numbers found from OpenVAS scanner with exploits using sites such as Rapid 7 Vulnerability DB and Exploit DB, or by using a command like 'search cve-xxxx-xxxx'. Do you have any suggestions/commands for msfconsole or other ideas for finding matching exploits?
You can search within metasploit using the search command for example :
you can also search by the name of the program that has a vulnerability using:
Not all vulnerabilities have a public exploit, some of them just have some POC code that will give you a direction about how to trigger the flaw.
You can search on metasploit, exploit-db, immunity canvas, core impact and make a little bit of research on internet. Web application flaws, usually can be exploited "by hand", other flaws like shellshock can be exploited by hand too. For local/privilege escalation flaws, metasploit have some modules, but you usually will need to find an exploit on the internet for that.
For linux/windows, there is several discussion lists, exploit-db and you can use Linux exploit suggester Windows exploit suggester. For other platforms like AIX, Solaris, HPUX, you will have to take some time to search for exploits.
As said before, for web exploitation, sql injection can be done by hand easily, for blind/timebased I suggest that you write a small script for that task, or use sqlmap. Check OWASP top 10 list, there is a plenty of documentation about how to exploit every kind of flaw.
search cve:xxxx-xxxx. For example:
msf> search cve:2012-1823 Matching Modules ================ Name Disclosure Date Rank Description ---- --------------- ---- ----------- exploit/multi/http/php_cgi_arg_injection 2012-05-03 00:00:00 UTC excellent PHP CGI Argument Injection msf> use exploit/multi/http/php_cgi_arg_injection msf exploit(php_cgi_arg_injection) > msf exploit(php_cgi_arg_injection) > set RHOST 192.168.1.219 RHOST => 192.168.1.219 msf exploit(php_cgi_arg_injection) > show payloads Compatible Payloads =================== Name Disclosure Date Rank Description ---- --------------- ---- ----------- generic/shell_bind_tcp normal Generic Command Shell, Bind TCP Inline generic/shell_reverse_tcp normal Generic Command Shell, Reverse TCP Inline