![Metasploit Penetration Testing Cookbook(Third Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/212/36700212/b_36700212.jpg)
上QQ阅读APP看书,第一时间看更新
How to do it...
- Issuing the hosts command with -h will display the help menu:
msf > hosts -h
Usage: hosts [ options ] [addr1 addr2 ...]
OPTIONS:
-a,--add Add the hosts instead of searching
-d,--delete Delete the hosts instead of searching
-c <col1,col2> Only show the given columns (see list below)
-h,--help Show this help information
-u,--up Only show hosts which are up
-o <file> Send output to a file in csv format
-O <column> Order rows by specified column number
-R,--rhosts Set RHOSTS from the results of the search
-S,--search Search string to filter by
-i,--info Change the info of a host
-n,--name Change the name of a host
-m,--comment Change the comment of a host
-t,--tag Add or specify a tag to a range of hosts
Available columns: address, arch, comm, comments, created_at, cred_count, detected_arch, exploit_attempt_count, host_detail_count, info, mac, name, note_count, os_family, os_flavor, os_lang, os_name, os_sp, purpose, scope, service_count, state, updated_at, virtual_host, vuln_count, tags
- Using the -c option, we can select which columns to display:
![](https://epubservercos.yuewen.com/74AACA/19470397601587006/epubprivate/OEBPS/Images/69def7f8-7fff-49aa-83b7-05fe812f3fe1.png?sign=1738831321-OJ5pSl3zmLqv6xemLTPU47EgaPXAatr2-0-4db1aef32f1facae43a3309db8e62716)
- With the -S option, we can search for specific strings, such as the OS name:
![](https://epubservercos.yuewen.com/74AACA/19470397601587006/epubprivate/OEBPS/Images/5b5990e5-af9d-4206-b094-155ccc63a369.png?sign=1738831321-PfRfJTsDommfbDwkGKXu6XUuLVM9rJqC-0-174f26cf4f712ee0332e97e2e83b976d)