1、//加載OpenVAS插件
msf > load openvas
2、//鏈接openvas引擎的語法
msf > openvas_connect
[*] Usage:
[*] openvas_connect username password host port <ssl-confirm>
msf > openvas_connect admin admin 10.10.10.128 9390 ok
3、//設置掃描目標
msf > openvas_target_create 2k03 10.10.10.130 metasploitable
4、//選擇掃描策略
msf > openvas_config_list
[+] OpenVAS list of configs
ID Name
-- ----
0 Full and fast
1 Full and fast ultimate
2 Full and very deep
3 Full and very deep ultimate
4 empty
5、//創建掃描任務並選擇相應掃描策略
msf > openvas_task_create
[*] Usage: openvas_task_create <name> <comment> <config_id> <target_id>
msf > openvas_task_create 2k03-scan "saomiao ba ji " 0 2
6、//執行掃描任務
msf > openvas_task_start
[*] Usage: openvas_task_start <id>
msf > openvas_task_start 2
7、//查看任務進度
msf > openvas_task_list
msf > openvas_task_list
[+] OpenVAS list of tasks
ID Name Comment Status Progress
-- ---- ------- ------ --------
0 unnamed Done -1
1 jwc-scan Scan of JWC Done -1
2 2k03-scan saomiao ba ji Requested 1
8、//下載掃描報告
而後使用openvas_report_download<掃描報告ID><報告格式ID><存儲路徑><文件名>下載掃描報告。如代碼清單3-26所示。
msf > openvas_report_list //找到須要下載的掃描報告ID
msf > openvas_format_list
//列出可供下載的掃描報告格式
msf > openvas_report_download
[*] Usage: openvas_report_download <report_id> <format_id> <path> <report_name>
msf > openvas_report_download 2 1 /root 2k03_scan_report.html
注意:下載時,報告名稱後面要手動添加後綴,否則獲得文件打開是一團亂碼。