Metasploit安装及使用教程(非常详细)从零基础入门到精通,看完这一篇就够了。

2024-01-09

通过本篇文章,我们将会学习以下内容:

1、在Windows上安装Metasploit

2、在Linux和MacOS上安装Metasploit

3、在Kali Linux中使用 Metasploit

4、升级Kali Linux

5、使用虚拟化软件构建渗透测试实验环境

6、配置SSH连接

7、使用SSH连接Kali

8、配置PostgreSQL数据库

9、创建工作区

10、使用数据库

11、使用hosts命令

12、理解services命令

简介

Metasploit是目前世界上领先的渗透测试工具,也是信息安全与渗透测试领域最大的开源项目之一。它彻底改变了我们执行安全测试的方式。

Metasploit之所以流行,是因为它可以执行广泛的安全测试任务,从而简化渗透测试的工作。Metasploit 适用于所有流行的操作系统,本文中,主要以Kali Linux为主。因为Kali Linux预装了 Metasploit 框架和运行在框架上的其他第三方工具。

框架和相关术语简介:

Metasploit Framewor****k :这是一个免费的、开源的渗透测试框架,由 H.D.Moore 在 2003 年发布,后来被 Rapid7 收购。当前稳定版本是使用 Ruby 语言编写的。它拥有世界上最大的渗透测试攻击数据库,每年超过100万次的下载。它也是迄今为止使用 Ruby构建的最复杂的项目之一。

Vulnerability :允许攻击者入侵或危害系统安全性的弱点称为漏洞,漏洞可能存在于操作系统,应用软件甚至网络协议中。

Exploit :攻击代码或程序,它允许攻击者利用易受攻击的系统并危害其安全性。每个漏洞都有对应的漏洞利用程序。Metasploit有超过 1700 个漏洞利用程序。

Payload :攻击载荷。它主要用于建立攻击者和受害者机器直接的连接,Metasploit有超过 500个有效攻击载荷。

Module :模块是一个完整的构件,每个模块执行特定的任务,并通过几个模块组成一个单元运行。这种架构的好处是可以很容易的将自己写的利用程序和工具集成到框架中。

Metasploit框架具有模块化的体系结构,exploits、payload、encoders都是独立的模块:

Metasploit提供两种不同的UI,msfconsole和WebUI,本书中主要使用msfconsole接口。因为msfconsole对Metasploit支持最好,可以使用所有功能。

一、在Windows上安装Metasploit

在Windows上安装Metasploit非常简单,直接从官方下载(http://www.metasploit.com/download).安装文件进行安装即可。

准备工作

Metasploit的四个版本:

Pro :适用于渗透测试人员和IT安全团队

Express :适用于一般IT人员

Community :适用于小公司和学生

Framework :适用于开发人员和安全研究人员

请从官网下载最新版的 Metasploit Framework

(https://windows.metasploit.com/metasploitframework-latest.msi) 它包含控制台程序和其他依赖程序。

如何安装

下载完之后,运行即可,它将自动安装相关所有组件。

Tip:在Windows上安装Metasploit时候,应该禁用防护软件,因为可能会检测到一些安装文件为恶意程序,从而阻止安装过程。安装完后将 Metasploit加入到防护软件的白名单。

二、在Linux和MacOS上安装Metasploit

通过以下快速安装脚本导入Rapid7签名密钥并为受支持的Linux和macOS系统设置程序包:

curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \

  chmod 755 msfinstall && \

  ./msfinstall

软件包将集成到系统的包管理器中,可以使用 msfupdate 命令或包管理器进行更新。

安装过程差不多是这样的:

bcook@localhost:~$ uname -a

Linux localhost 3.14.0 #1 SMP PREEMPT Mon Feb 6 21:59:30 PST 2017 armv7l armv7l armv7l GNU/Linux

bcook@localhost:~$ curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \

>   chmod 755 msfinstall && \

>   ./msfinstall

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100  5394  100  5394    0     0   5609      0 --:--:-- --:--:-- --:--:--  5607

Switching to root user to update the package

[sudo] password for bcook: 

Adding metasploit-framework to your repository list..OK

Updating package cache..OK

Checking for and installing update..

Reading package lists... Done

Building dependency tree      

Reading state information... Done

The following NEW packages will be installed:

  metasploit-framework

0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.

Need to get 148 MB of archives.

After this operation, 358 MB of additional disk space will be used.

Get:1 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid/main armhf metasploit-framework armhf 4.13.23+20170217143300.git.1.85dca6a~1rapid7-1 [148 MB]

Fetched 148 MB in 19s (7743 kB/s)                                                                                                    

Selecting previously unselected package metasploit-framework.

(Reading database ... 28449 files and directories currently installed.)

Preparing to unpack .../metasploit-framework_4.13.23+20170217143300.git.1.85dca6a~1rapid7-1_armhf.deb ...

Unpacking metasploit-framework (4.13.23+20170217143300.git.1.85dca6a~1rapid7-1) ...

Setting up metasploit-framework (4.13.23+20170217143300.git.1.85dca6a~1rapid7-1) ...

update-alternatives: using /opt/metasploit-framework/bin/msfbinscan to provide /usr/bin/msfbinscan (msfbinscan) in auto mode

update-alternatives: using /opt/metasploit-framework/bin/msfconsole to provide /usr/bin/msfconsole (msfconsole) in auto mode

update-alternatives: using /opt/metasploit-framework/bin/msfd to provide /usr/bin/msfd (msfd) in auto mode

update-alternatives: using /opt/metasploit-framework/bin/msfdb to provide /usr/bin/msfdb (msfdb) in auto mode

update-alternatives: using /opt/metasploit-framework/bin/msfelfscan to provide /usr/bin/msfelfscan (msfelfscan) in auto mode

update-alternatives: using /opt/metasploit-framework/bin/msfmachscan to provide /usr/bin/msfmachscan (msfmachscan) in auto mode

update-alternatives: using /opt/metasploit-framework/bin/msfpescan to provide /usr/bin/msfpescan (msfpescan) in auto mode

update-alternatives: using /opt/metasploit-framework/bin/msfrop to provide /usr/bin/msfrop (msfrop) in auto mode

update-alternatives: using /opt/metasploit-framework/bin/msfrpc to provide /usr/bin/msfrpc (msfrpc) in auto mode

update-alternatives: using /opt/metasploit-framework/bin/msfrpcd to provide /usr/bin/msfrpcd (msfrpcd) in auto mode

update-alternatives: using /opt/metasploit-framework/bin/msfupdate to provide /usr/bin/msfupdate (msfupdate) in auto mode

update-alternatives: using /opt/metasploit-framework/bin/msfvenom to provide /usr/bin/msfvenom (msfvenom) in auto mode

Run msfconsole to get started

W: --force-yes is deprecated, use one of the options starting with --allow instead.

bcook@localhost:~$ msfconsole  //启动msfconsole

 ** Welcome to Metasploit Framework Initial Setup **

    Please answer a few questions to get started.

Would you like to use and setup a new database (recommended)? y //是否设置数据库

Creating database at /home/bcook/.msf4/db

Starting database at /home/bcook/.msf4/db...success

Creating database users

Creating initial database schema

 ** Metasploit Framework Initial Setup Complete **

       =[ metasploit v4.13.23-dev-584850f1f8a1a74b69b5cea16c700c9fd1b8e4c6]

+ -- --=[ 1622 exploits - 924 auxiliary - 282 post        ]

+ -- --=[ 472 payloads - 39 encoders - 9 nops             ]

+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]

msf >

在MacOS中手动安装Metasploit

最新的OS X安装程序包也可以直接在这里下载:https://osx.metasploit.com/metasploitframework-latest.pkg

下载完后安装即可,安装完后,使用/opt/metasploit-framework/bin/msfconsole启动msfconsole。

三、 在Kali Linux上使用Metasploit

Kali Linux是最受安全从业人员欢迎的操作系统,第一、它预装了几乎所有流行的渗透测试工具,降低了使用成本,其次它是基于Linux的操作系统,具有可靠的稳定性和安全性。

准备工作

你可以在物理机上安装Kali Linux,也可以在虚拟机中安装它,安装过程非常简单。

在Kali Linux设置Metasploit开发环境可以用以下命令:

sudo apt update

sudo apt -y install autoconf bison build-essential curl git-core libapr1

libaprutil1 libcurl4-openssl-dev libgmp3-dev libpcap-dev libpq-dev

libreadline6-dev libsqlite3-dev libssl-dev libsvn1 libtool libxml2 libxml2-

dev libxslt-dev libyaml-dev locate ncurses-dev openssl postgresql

postgresql-contrib wget xsel zlib1g zlib1g-dev

curl -sSL https://rvm.io/mpapis.asc | gpg --import -

curl -L https://get.rvm.io | bash -s stable

source ~/.rvm/scripts/rvm

cd /opt

sudo git clone https://github.com/rapid7/metasploit-framework.git

sudo chown -R `whoami` /opt/metasploit-framework

cd metasploit-framework

rvm --install $(cat .ruby-version)

gem install bundler

bundle install

如何安装

你可以从Kali官网下载(https://www.kali.org)Kali Linux ISO镜像文件,用来制作USB启动盘或者制作DVD-ROM光盘。你可以将Kali Linux安装到硬盘上或者直接使用 Live CD模式。也可以在虚拟机中安装Kali Linux。

本书中,我们将使用 Kali Linux 虚拟机。

1、从官网下载 Kali Vmware 虚拟机文件,导入到Vmware Workstation中,启动系统,输入用户名和密码即可登录到Kali中,root默认密码是toor。

2、成功登录后,直接从 应用程序 菜单中启动 Metasploit

Tip:从应用程序菜单启动 Metasploit后,将自动设置PostgreSQL数据库,它将创建数据库用户,创建msf和msf_test数据库,配置Metasploit使用数据库,并通过以下命令启动msfconsole:(这是自动的,不需要手动执行下面的命令)

service postgresql start && msfdb init && msfconsole

过程如下:

其他

或者你可以直接在终端中运行msfconsole启动Metasploit

四、升级Kali Linux

升级Kali Linux非常简单,建议定期升级以获得最新的安全更新。若要升级,可以使用 apt update,然后使用 apt upgrade进行升级,这种方法是在不删除任何包的情况下升级已安装的包。如果要升级大的版本和重要更新。可以使用apt full-upgrade进行完全升级,这种方式将会删除过时的软件包和安装新的依赖。

五、构建渗透测试实验环境

构建一个渗透测试实验环境是非常有必要的。它允许你在一个安全的环境中练习和测试,因为直接针对真实系统攻击测试是违法的。使用虚拟机构建渗透测试实验环境具有可移植性,灵活性和低维护成本。并且可以构建多种操作系统,设置复杂的网络场景,并在多个目标上执行渗透测试。

准备工作

选择你喜欢的虚拟化软件,比如 Vmware Workstation、VirtualBox、Hyper-V等

我们需要构建的渗透测试实验环境拓扑如下:

包含 Kali Linux,Linux服务器和Windows服务器以及一台Windows 10客户机。

当然你可以根据自己的喜好来构建。

如何构建

Kali Linux :直接从Kali官网下载安装就行

Linux服务器 :可以从 SourceForge下载 Metasploitable2 : https://sourceforge.net/projects/ metasploitable/files/Metasploitable2/

Windows 10 客户机 :可以从微软开发者网站下载 90天评估版: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

Windows Server :我们通过Metasploitable 3来构建。在Windows上运行build_win2008.sh进行构建。

Metasploitable 3 安装过程在此不做描述

构建过程不做详细描述

六、配置SSH连接

准备工作

要配置远程登录Kali Linux,首先我们需要更改默认的root密码并生成新的SSH密钥。

怎么做

使用passwd命令修改root密码

root@osboxes:~# passwd

Enter new UNIX password: 

Retype new UNIX password: 

passwd: password updated successfully

root@osboxes:~# 

重新配置SSH主机密钥非常简单,首先删除当前的SSH主机密钥,然后使用dpkg-reconfigure openssh-server命令重新生成密钥即可。​​​​​​​

root@osboxes:~# rm /etc/ssh/ssh_host_*

root@osboxes:~# dpkg-reconfigure openssh-server 

Creating SSH2 RSA key; this may take some time ...

2048 SHA256:1FN10l0k50Ng/dpeLIXTPmFGyupZB22hk4JNQC1aKcI root@osboxes (RSA)

Creating SSH2 ECDSA key; this may take some time ...

256 SHA256:37c9q4AwOW4wEwUoEpQ1Jz/KXIYJfV53ORWeGBzONdI root@osboxes (ECDSA)

Creating SSH2 ED25519 key; this may take some time ...

256 SHA256:ky1bOQlbMFIMB0si0w7Msv32fpSeza6lZeHn8OevGdU root@osboxes (ED25519)

rescue-ssh.target is a disabled or a static unit, not starting it.

我们还需要编辑OpenSSH服务配置文件:/etc/ssh/sshd_config,将#PermitRootLogin without-password 更改为PermitRootLogin yes,从而运行root远程登录。

若要设置SSH服务开机启动,则执行systemctl enable ssh即可​​​​​​​

root@osboxes:~# systemctl enable ssh

Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.

Executing: /lib/systemd/systemd-sysv-install enable ssh

Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service.

Tip:最好是将远程登录配置为密钥登录,而不是使用密码。

七、使用SSH连接到Kali

要连接到Kali Linux,我们只需要使用SSH客户端即可,大多数Unix,Linux和MacOS都已经安装了SSH客户端。如果使用的是Windows,可以安装PuTTY等SSH客户端软件。

怎么做

查看Kali的IP地址

root@osboxes:~# ip a 

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

       valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host 

       valid_lft forever preferred_lft forever

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 00:0c:29:9f:99:bf brd ff:ff:ff:ff:ff:ff

    inet 192.168.177.138/24 brd 192.168.177.255 scope global dynamic noprefixroute eth0

       valid_lft 1784sec preferred_lft 1784sec

    inet6 fe80::28ff:605:ed51:4ab7/64 scope link noprefixroute 

       valid_lft forever preferred_lft forever

使用SSH 客户端连接到Kali

λ ssh root@192.168.177.138

The authenticity of host '192.168.177.138 (192.168.177.138)' can't be established.

ECDSA key fingerprint is SHA256:37c9q4AwOW4wEwUoEpQ1Jz/KXIYJfV53ORWeGBzONdI.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.177.138' (ECDSA) to the list of known hosts.

root@192.168.177.138's password:

Linux osboxes 4.14.0-kali3-amd64 #1 SMP Debian 4.14.12-2kali1 (2018-01-08) x86_64

The programs included with the Kali GNU/Linux system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.

Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent

permitted by applicable law.

Linux osboxes 4.14.0-kali3-amd64 #1 SMP Debian 4.14.12-2kali1 (2018-01-08) x86_64

The programs included with the Kali GNU/Linux system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.

Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent

permitted by applicable law.

root@osboxes:~# 

八、配置PostgreSQL数据库

Metasploit的一个重要特性是支持PostgreSQL数据库,使用它来存储渗透测试结果和漏洞信息。

准备工作

启动服务,然后使用 Metasploit msfdb 初始化数据库

怎么做

1、启动数据库

root@osboxes:~# systemctl start postgresql

2、初始化数据库

~# msfdb init

Creating database user 'msf'

Enter password for new role:

Enter it again:

Creating databases 'msf' and 'msf_test'

Creating configuration file in /usr/share/metasploit-framework/config/database.yml

Creating initial database schema

msfdb 还可以用来管理Metasploit Framework数据库

root@osboxes:~# msfdb                                              

Manage the metasploit framework database                          

  msfdb init     # start and initialize the database              

  msfdb reinit   # delete and reinitialize the database            

  msfdb delete   # delete database and stop using it              

  msfdb start    # start the database                              

  msfdb stop     # stop the database                              

  msfdb status   # check service status                            

  msfdb run      # start the database and run msfconsole          

3、修改数据库配置文件

我们可以直接编辑 database.yml文件,文件位于/usr/share/metasploit-framework/config/database.yml

root@osboxes:~# cat /usr/share/metasploit-framework/config/database.yml  

development:                                                             

  adapter: postgresql                                                    

  database: msf                                                          

  username: msf                                                          

  password: 9JHbuu/CdoGT0kvBiSXf+VLDRQ9dKKpMYyWKY6Ui2jc=                 

  host: localhost                                                        

  port: 5432                                                             

  pool: 5                                                                

  timeout: 5                                                             

production:                                                              

  adapter: postgresql                                                    

  database: msf                                                          

  username: msf                                                          

  password: 9JHbuu/CdoGT0kvBiSXf+VLDRQ9dKKpMYyWKY6Ui2jc=                 

  host: localhost                                                        

  port: 5432                                                             

  pool: 5                                                                

  timeout: 5                                                             

test:                                                                    

  adapter: postgresql                                                    

  database: msf_test                                                     

  username: msf                                                          

  password: 9JHbuu/CdoGT0kvBiSXf+VLDRQ9dKKpMYyWKY6Ui2jc=                 

  host: localhost                                                        

  port: 5432                                                             

  pool: 5                                                                

  timeout: 5       

里面的usrname和password是默认配置的,你可以根据自己的喜好进行更改

4、确定是否连接到数据库

启动msfconsole,然后执行db_status,检查数据库连接情况。

msf > db_status

[*] postgresql connected to msf

msf >

更多

如果要手动连接到数据库,可以使用如下命令:

db_connect <user:pass>@<host:port>/<database>

我们可以使用databse.yml文件测试db_connect命令

msf > db_disconnect //断开连接

msf > db_status //查看连接状态

[*] postgresql selected, no connection

msf > db_connect

[*]    Usage: db_connect <user:pass>@<host:port>/<database>

[*]       OR: db_connect -y [path/to/database.yml]

[*] Examples:

[*]        db_connect user@metasploit3

[*]        db_connect user:pass@192.168.0.2/metasploit3

[*]        db_connect user:pass@192.168.0.2:1500/metasploit3

msf > db_connect -y /usr/share/metasploit-framework/config/database.yml //连接数据库

[*] Rebuilding the module cache in the background...

msf > db_status //查看连接状态

[*] postgresql connected to msf

msf >

九、创建工作区

Metasploit中有工作区的概念,可以用来隔离不同的渗透测试任务,从而避免混淆不同的测试。

怎么做

1、默认工作区

默认工作区是default,输入workspace查看

msf > workspace

* default

msf >

输入workspace -h 查看命令帮助

msf > workspace -h

Usage:

    workspace                  List workspaces

    workspace -v               List workspaces verbosely

    workspace [name]           Switch workspace

    workspace -a [name] ...    Add workspace(s)

    workspace -d [name] ...    Delete workspace(s)

    workspace -D               Delete all workspaces

    workspace -r <old> <new>   Rename workspace

    workspace -h               Show this help information

msf >

2、新建工作区

使用workspace -a命令添加新的工作区

msf > workspace -a book

[*] Added workspace: book

msf > workspace

  default

* book

msf >

3、删除工作区

使用workspace -d命令删除工作区

msf > workspace -d book

[*] Deleted workspace: book

[*] Switched workspace: default

4、更改工作区

使用workspace命令更改工作区

msf > workspace book

[*] Workspace: book

5、重命名工作区

使用workspace -r命令更改工作区

msf > workspace -r book msf

[*] Switched workspace: msf

msf >

十、使用数据库

配置完数据库,我们就可以使用它了,首先我们了解如何使用db_import导入外部工具数据。

准备工作

在msfconsole中运行db_import命令,查看支持的文件类型

msf > db_import                                                                            

Usage: db_import <filename> [file2...]                                                      

Filenames can be globs like *.xml, or **/*.xml which will search recursively                

Currently supported file types include:                                                     

    Acunetix                                                                                

    Amap Log                                                                                

    Amap Log -m                                                                            

    Appscan                                                                                

    Burp Session XML                                                                        

    Burp Issue XML                                                                          

    CI                                                                                      

    Foundstone                                                                              

    FusionVM XML                                                                            

    ...                                                              

    Wapiti XML                                                                              

msf >     

怎么做

1、导入nmap扫描结果

先完成扫描,保存结果为 XML 文档

root@osboxes:~# nmap -Pn -A -oX report 192.168.177.139

2、然后执行 db_import PATH进行导入

msf > db_import /root/report

[*] Importing 'Nmap XML' data

[*] Import: Parsing with 'Nokogiri v1.8.5'

[*] Importing host 192.168.177.139

[*] Successfully imported /root/report

msf >

3、当然也可以直接在msfconsole中运行dbnmap进行扫描,这样结果就直接保存到当前数据库中了,dbnmap 命令的参数与nmap 命令相同。

十一、使用 hosts 命令

既然数据库中有了数据,就可以使用hosts命令来显示当前工作区中存储的所有主机了。

msf > hosts

Hosts

=====

address          mac                name  os_name  os_flavor  os_sp  purpose  info  comments

-------          ---                ----  -------  ---------  -----  -------  ----  --------

192.168.177.139  00:0c:29:c6:a9:e5        Unknown                    device

msf >

怎么做

1、查看命令帮助hosts -h

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)

  -C <col1,col2>    Only show the given columns until the next restart (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

msf >

十二、理解 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

Tip:在后续的章节我们将学习更多的数据库命令,比如 loot、cred、vulns、notes。

相关操作学习

Metasploit之PostgreSQL及Scanner实践:通过该实验学会metasploit与postgresql的配合使用,metasploit中主机扫描模块的使用以及集成的web应用扫描框架使用,数据库和扫描器的配合使用。

网络安全零基础路线图


我一共划分了六个阶段,但并不是说你得学完全部才能上手工作,对于一些初级岗位,学到第三四个阶段就足矣~

这里我整合并且整理成了一份【282G】的网络安全从零基础入门到进阶资料包,需要的小伙伴可以扫描下方CSDN官方合作二维码免费领取哦,无偿分享!!!

如果你对网络安全入门感兴趣,那么你需要的话可以

如果你对网络安全入门感兴趣,那么你需要的话可以点击这里 ????

①网络安全学习路线
②上百份渗透测试电子书
③安全攻防357页笔记
④50份安全攻防面试指南
⑤安全红队渗透工具包
⑥HW护网行动经验总结
⑦100个漏洞实战案例
⑧安全大厂内部视频资源
⑨历年CTF夺旗赛题解析

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Metasploit安装及使用教程(非常详细)从零基础入门到精通,看完这一篇就够了。 的相关文章

  • 广告竞价策略:激发广告变现潜能的关键

    在数字化时代 广告已经成为企业推广品牌 产品和服务的关键手段之一 为了最大程度地发挥广告的效果 广告竞价策略成为广告主和数字营销专业人士关注的焦点 通过巧妙运用竞价策略 广告主可以在激烈的市场竞争中脱颖而出 实现广告变现的潜能 admaoy
  • 【一份老网工珍藏多年的网络配置笔记,很重要!】

    01 交换机 路由器的几种配置模式及模式转换 1 用户模式 登录到交换机 路由器 时会自动进入用户模式 提示符为 switchname gt 在该模式下只能够查看相关信息 对 IOS的运行不产生任何影响 2 特权模式 用户模式下 键入 en
  • “性能压测揭密:关键指标分析!“

    在进行全链路压测和性能测试时 需要关注多个关键性能指标 KPIs 来评估系统的性能表现 以下是一些常见的性能测试指标 1 吞吐量 Throughput 系统在单位时间内能够处理的请求数量或事务数量 通常以每秒请求数 RPS TPS 来衡量
  • 改善python程序的91建议记录

    使用else子句简化循环 异常处理 案例1 执行sql异常时处理 def save db obj try save attr1 db execute a sql stmt obj attr1 save attr2 db execute an
  • CMAKE_MAKE_PROGRAM is not set 解读

    目录 CMAKE MAKE PROGRAM 未设置 错误原因 解决方案 示例1 GNU Make 示例2 Ninja CMakeLists txt 的结构 示例 CMakeLists txt 文件 总结 CMAKE MAKE PROGRAM
  • 网络空间安全女生就业,怎么学?

    我实验室的学长们基本都是以红队和复现为主 如果学校好点可能还有更多的选择 如果想在这个方向深入下去 推荐流程是先打两年CTF 把大概的技术方向摸一摸 大一的话 如果学校还不错 那就优先建议打好基础 包括C语言 Python一类 建议把CTF
  • 服务器集群是如何提高计算性能的?

    服务器集群是一种将多台服务器连接起来协同工作的技术 通过集群配置 可以提高计算性能 可靠性和可扩展性 以下是服务器集群如何提高计算性能的详细解释 一 并行处理能力 服务器集群的核心优势在于其并行处理能力 通过将多个服务器组成一个集群 可以将
  • 基于成本和服务质量考虑的不确定性下,电动汽车充电网络基础设施需求预测和迭代优化的分层框架研究(Python代码实现)

    欢迎来到本博客 博主优势 博客内容尽量做到思维缜密 逻辑清晰 为了方便读者 座右铭 行百里者 半于九十 本文目录如下 目录 1 概述 2 运行结果 3 参考文献 4 Python代码 数据
  • 如何解决Mybatis-plus与Mybatis不兼容的问题:An attempt was made to call a method that does not exist. The attempt

    博主猫头虎的技术世界 欢迎来到 猫头虎的博客 探索技术的无限可能 专栏链接 精选专栏 面试题大全 面试准备的宝典 IDEA开发秘籍 提升你的IDEA技能 100天精通Golang Go语言学习之旅 领域矩阵 猫头虎技术领域矩阵 深入探索各技
  • 前端必备的 web 安全知识手记

    前言 安全这种东西就是不发生则已 一发生则惊人 作为前端 平时对这方面的知识没啥研究 最近了解了下 特此沉淀 文章内容包括以下几个典型的 web 安全知识点 XSS CSRF 点击劫持 SQL 注入和上传问题等 下文以小王代指攻击者 话不多
  • messages,CentOS 7不收集日志或不存在 /var/log/messages

    var log message var log secure等都不记录了 并且都是空文件 重启机器 reboot 无效 重启日志 systemctl start rsyslog 无效 怀疑空间不足 删除 var log messages 重
  • 如何使用Imagewheel搭建一个简单的的私人图床无公网ip也能访问

    文章目录 1 前言 2 Imagewheel网站搭建 2 1 Imagewheel下载和安装 2 2 Imagewheel网页测试 2 3 cpolar的安装和注册 3 本地网页发布 3 1 Cpolar临时数据隧道
  • socket网络编程几大模型?看看CHAT是如何回复的?

    CHAT回复 网络编程中常见的有以下几种模型 1 阻塞I O模型 Blocking I O 传统的同步I O模型 一次只处理一个请求 2 非阻塞I O模型 Non blocking I O 应用程序轮询调用socket相关函数检查请求 不需
  • 国外拨号VPS指南:开启你的全球网络之旅

    在当今数字化时代 互联网已经成为了我们生活的一部分 而要在全球范围内畅通无阻地访问互联网 拥有一个可靠的国外拨号VPS是非常重要的 无论您是为了工作 学习还是娱乐 国外拨号VPS都可以为您提供更广泛的网络体验 本文将为您提供国外拨号VPS的
  • 短信系统搭建主要因素|网页短信平台开发源码

    短信系统搭建主要因素 网页短信平台开发源码 随着移动互联网的快速发展 短信系统已成为企业和个人进行信息传递的重要工具 建立一个高效可靠的短信系统对于企业来说非常重要 下面我们将介绍一些影响短信系统搭建的主要因素 1 平台选择 在搭建短信系统
  • 网络安全(黑客)自学启蒙

    一 什么是网络安全 网络安全是一种综合性的概念 涵盖了保护计算机系统 网络基础设施和数据免受未经授权的访问 攻击 损害或盗窃的一系列措施和技术 经常听到的 红队 渗透测试 等就是研究攻击技术 而 蓝队 安全运营 安全运维 则研究防御技术 作
  • 为什么我强烈推荐大学生打CTF!

    前言 写这个文章是因为我很多粉丝都是学生 经常有人问 感觉大一第一个学期忙忙碌碌的过去了 啥都会一点 但是自己很难系统的学习到整个知识体系 很迷茫 想知道要如何高效学习 这篇文章我主要就围绕两点 减少那些罗里吧嗦的废话 直接上干货 CTF如
  • 【无标题】

    大家都知道该赛项的规程和样题向来都是模棱两可 从来不说具体的内容 导致选手在备赛时没有头绪 不知道该怎么训练 到了赛时发现题目和备赛的时候完全不一样 那么本文将以往年信息安全管理与评估赛项经验来解读今年2023年国赛的规程 帮助选手们指明方
  • DSCA190V 57310001-PK

    DSCA190V 57310001 PK DSCA190V 57310001 PK 具有两个可编程继电器功能 并安装在坚固的 XP 外壳中 DSCA190V 57310001 PK 即可使用 只需最少的最终用户校准 DSCA190V 573
  • 【安全】网络安全态势感知

    文章目录 一 态势感知简介 1 概念 2 形象举例 3 应具备的能力 二 为什么要态势感知 为什么网络安全态势感知很重要 三 态势感知系统的功能 四 如何评估态势感知的建设结果 五 什么是态势感知的三个层级 四 业界的态势感知产品 1 安全

随机推荐