理解 services 命令
services命令作用是显示目标主机上可用的服务
查看命令帮助:
- msf > services -h
- Usage: services [-h] [-u] [-a] [-r <proto>] [-p <port1,port2>] [-s <name1,name2>] [-o <filename>] [addr1 addr2 ...]
- -a,--add Add the services instead of searching
- -d,--delete Delete the services instead of searching
- -c <col1,col2> Only show the given columns
- -h,--help Show this help information
- -s <name1,name2> Search for a list of service names
- -p <port1,port2> Search for a list of ports
- -r <protocol> Only show [tcp|udp] services
- -u,--up Only show services 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
- Available columns: created_at, info, name, port, proto, state, updated_at
作者:
锦凡歆在酷狗直播唱歌最好听
怎么做
1、显示所有可用服务
- msf > services
- Services
- ========
- host port proto name state info
- ---- ---- ----- ---- ----- ----
- 192.168.177.142 22 tcp ssh open OpenSSH 5.3p1 Debian 3ubuntu4 Ubuntu Linux; protocol 2.0
- 192.168.177.142 80 tcp http open Apache httpd 2.2.14 (Ubuntu) mod_mono/2.4.3 PHP/5.3.2-1ubuntu4.30 with Suhosin-Patch proxy_html/3.0.1 mod_python/3.3.1 Python/2.6.5 mod_ssl/2.2.14 OpenSSL/0.9.8k Phusion_Passenger/4.0.38 mod_perl/2.0.4 Perl/v5.10.1
- 192.168.177.142 139 tcp netbios-ssn open Samba smbd 3.X - 4.X workgroup: WORKGROUP
- 192.168.177.142 143 tcp imap open Courier Imapd released 2008
- 192.168.177.142 443 tcp ssl/https open
- 192.168.177.142 445 tcp netbios-ssn open Samba smbd 3.X - 4.X workgroup: WORKGROUP
- 192.168.177.142 5001 tcp java-rmi open Java RMI
- 192.168.177.142 8080 tcp http open Apache Tomcat/Coyote JSP engine 1.1
- 192.168.177.142 8081 tcp http open Jetty 6.1.25
- msf >
2、过滤服务
- msf > services -s http
- Services
- ========
- host port proto name state info
- ---- ---- ----- ---- ----- ----
- 192.168.177.142 80 tcp http open Apache httpd 2.2.14 (Ubuntu) mod_mono/2.4.3 PHP/5.3.2-1ubuntu4.30 with Suhosin-Patch proxy_html/3.0.1 mod_python/3.3.1 Python/2.6.5 mod_ssl/2.2.14 OpenSSL/0.9.8k Phusion_Passenger/4.0.38 mod_perl/2.0.4 Perl/v5.10.1
- 192.168.177.142 8080 tcp http open Apache Tomcat/Coyote JSP engine 1.1
- 192.168.177.142 8081 tcp http open Jetty 6.1.25
3、过滤端口
- msf > services -p 22
- Services
- ========
- host port proto name state info
- ---- ---- ----- ---- ----- ----
- 192.168.177.142 22 tcp ssh open OpenSSH 5.3p1 Debian 3ubuntu4 Ubuntu Linux; protocol 2.0
- msf >
4、搜索特定字符
- msf > services -S Apache
- Services
- ========
- host port proto name state info
- ---- ---- ----- ---- ----- ----
- 192.168.177.142 80 tcp http open Apache httpd 2.2.14 (Ubuntu) mod_mono/2.4.3 PHP/5.3.2-1ubuntu4.30 with Suhosin-Patch proxy_html/3.0.1 mod_python/3.3.1 Python/2.6.5 mod_ssl/2.2.14 OpenSSL/0.9.8k Phusion_Passenger/4.0.38 mod_perl/2.0.4 Perl/v5.10.1
- 192.168.177.142 8080 tcp http open Apache Tomcat/Coyote JSP engine 1.1
5、多条件过滤
- msf > services -c name,port,info -S Apache 192.168.177.142
- Services
- ========
- host name port info
- ---- ---- ---- ----
- 192.168.177.142 http 80 Apache httpd 2.2.14 (Ubuntu) mod_mono/2.4.3 PHP/5.3.2-1ubuntu4.30 with Suhosin-Patch proxy_html/3.0.1 mod_python/3.3.1 Python/2.6.5 mod_ssl/2.2.14 OpenSSL/0.9.8k Phusion_Passenger/4.0.38 mod_perl/2.0.4 Perl/v5.10.1
- 192.168.177.142 http 8080 Apache Tomcat/Coyote JSP engine 1.1