Metasploit超详细安装及使用教程(图文版)

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

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 Framework:这是一个免费的、开源的渗透测试框架,由 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 -aLinux localhost 3.14.0 #1 SMP PREEMPT Mon Feb 6 21:59:30 PST 2017 armv7l armv7l armv7l GNU/Linuxbcook@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  CurrentDload  Upload   Total   Spent    Left  Speed100  5394  100  5394    0     0   5609      0 --:--:-- --:--:-- --:--:--  5607Switching to root user to update the package[sudo] password for bcook: Adding metasploit-framework to your repository list..OKUpdating package cache..OKChecking for and installing update..Reading package lists... DoneBuilding dependency tree      Reading state information... DoneThe following NEW packages will be installed:metasploit-framework0 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 modeupdate-alternatives: using /opt/metasploit-framework/bin/msfconsole to provide /usr/bin/msfconsole (msfconsole) in auto modeupdate-alternatives: using /opt/metasploit-framework/bin/msfd to provide /usr/bin/msfd (msfd) in auto modeupdate-alternatives: using /opt/metasploit-framework/bin/msfdb to provide /usr/bin/msfdb (msfdb) in auto modeupdate-alternatives: using /opt/metasploit-framework/bin/msfelfscan to provide /usr/bin/msfelfscan (msfelfscan) in auto modeupdate-alternatives: using /opt/metasploit-framework/bin/msfmachscan to provide /usr/bin/msfmachscan (msfmachscan) in auto modeupdate-alternatives: using /opt/metasploit-framework/bin/msfpescan to provide /usr/bin/msfpescan (msfpescan) in auto modeupdate-alternatives: using /opt/metasploit-framework/bin/msfrop to provide /usr/bin/msfrop (msfrop) in auto modeupdate-alternatives: using /opt/metasploit-framework/bin/msfrpc to provide /usr/bin/msfrpc (msfrpc) in auto modeupdate-alternatives: using /opt/metasploit-framework/bin/msfrpcd to provide /usr/bin/msfrpcd (msfrpcd) in auto modeupdate-alternatives: using /opt/metasploit-framework/bin/msfupdate to provide /usr/bin/msfupdate (msfupdate) in auto modeupdate-alternatives: using /opt/metasploit-framework/bin/msfvenom to provide /usr/bin/msfvenom (msfvenom) in auto modeRun msfconsole to get startedW: --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/dbStarting database at /home/bcook/.msf4/db...successCreating database usersCreating 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 updatesudo apt -y install autoconf bison build-essential curl git-core libapr1libaprutil1 libcurl4-openssl-dev libgmp3-dev libpcap-dev libpq-devlibreadline6-dev libsqlite3-dev libssl-dev libsvn1 libtool libxml2 libxml2-dev libxslt-dev libyaml-dev locate ncurses-dev openssl postgresqlpostgresql-contrib wget xsel zlib1g zlib1g-devcurl -sSL https://rvm.io/mpapis.asc | gpg --import -curl -L https://get.rvm.io | bash -s stablesource ~/.rvm/scripts/rvmcd /optsudo git clone https://github.com/rapid7/metasploit-framework.gitsudo chown -R `whoami` /opt/metasploit-frameworkcd metasploit-frameworkrvm --install $(cat .ruby-version)gem install bundlerbundle 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:~# passwdEnter new UNIX password: Retype new UNIX password: passwd: password updated successfullyroot@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 sshSynchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.Executing: /lib/systemd/systemd-sysv-install enable sshCreated 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 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:9f:99:bf brd ff:ff:ff:ff:ff:ffinet 192.168.177.138/24 brd 192.168.177.255 scope global dynamic noprefixroute eth0valid_lft 1784sec preferred_lft 1784secinet6 fe80::28ff:605:ed51:4ab7/64 scope link noprefixroute valid_lft forever preferred_lft forever

 使用SSH 客户端连接到Kali

 

λ ssh root@192.168.177.138The 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)? yesWarning: 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_64The programs included with the Kali GNU/Linux system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extentpermitted by applicable law.Linux osboxes 4.14.0-kali3-amd64 #1 SMP Debian 4.14.12-2kali1 (2018-01-08) x86_64The programs included with the Kali GNU/Linux system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extentpermitted by applicable law.root@osboxes:~# 

八、配置PostgreSQL数据库

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

准备工作

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

怎么做

1、启动数据库

root@osboxes:~# systemctl start postgresql

2、初始化数据库

~# msfdb initCreating 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.ymlCreating 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 msfmsf >

更多

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

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

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

msf > db_disconnect //断开连接msf > db_status //查看连接状态[*] postgresql selected, no connectionmsf > 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/metasploit3msf > db_connect -y /usr/share/metasploit-framework/config/database.yml //连接数据库[*] Rebuilding the module cache in the background...msf > db_status //查看连接状态[*] postgresql connected to msfmsf >

九、创建工作区

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

怎么做

1、默认工作区

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

msf > workspace* defaultmsf >

输入workspace -h 查看命令帮助

msf > workspace -hUsage:workspace                  List workspacesworkspace -v               List workspaces verboselyworkspace [name]           Switch workspaceworkspace -a [name] ...    Add workspace(s)workspace -d [name] ...    Delete workspace(s)workspace -D               Delete all workspacesworkspace -r <old> <new>   Rename workspaceworkspace -h               Show this help informationmsf >

2、新建工作区

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

msf > workspace -a book[*] Added workspace: bookmsf > workspacedefault* bookmsf >

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: msfmsf >

十、使用数据库

配置完数据库,我们就可以使用它了,首先我们了解如何使用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/reportmsf >

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

十一、使用 hosts 命令

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

msf > hostsHosts=====address          mac                name  os_name  os_flavor  os_sp  purpose  info  comments-------          ---                ----  -------  ---------  -----  -------  ----  --------192.168.177.139  00:0c:29:c6:a9:e5        Unknown                    devicemsf >

怎么做

1、查看命令帮助hosts -h

msf > hosts -hUsage: 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 hostsAvailable 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, tagsmsf >

十二、理解 services 命令

services命令作用是显示目标主机上可用的服务

查看命令帮助:

msf > services -hUsage: 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 byAvailable columns: created_at, info, name, port, proto, state, updated_at

怎么做

1、显示所有可用服务

msf > servicesServices========host             port  proto  name         state  info----             ----  -----  ----         -----  ----192.168.177.142  22    tcp    ssh          open   OpenSSH 5.3p1 Debian 3ubuntu4 Ubuntu Linux; protocol 2.0192.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.1192.168.177.142  139   tcp    netbios-ssn  open   Samba smbd 3.X - 4.X workgroup: WORKGROUP192.168.177.142  143   tcp    imap         open   Courier Imapd released 2008192.168.177.142  443   tcp    ssl/https    open192.168.177.142  445   tcp    netbios-ssn  open   Samba smbd 3.X - 4.X workgroup: WORKGROUP192.168.177.142  5001  tcp    java-rmi     open   Java RMI192.168.177.142  8080  tcp    http         open   Apache Tomcat/Coyote JSP engine 1.1192.168.177.142  8081  tcp    http         open   Jetty 6.1.25msf >

2、过滤服务

msf > services -s httpServices========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.1192.168.177.142  8080  tcp    http  open   Apache Tomcat/Coyote JSP engine 1.1192.168.177.142  8081  tcp    http  open   Jetty 6.1.25

3、过滤端口

msf > services -p 22Services========host             port  proto  name  state  info----             ----  -----  ----  -----  ----192.168.177.142  22    tcp    ssh   open   OpenSSH 5.3p1 Debian 3ubuntu4 Ubuntu Linux; protocol 2.0msf >

4、搜索特定字符

msf > services -S ApacheServices========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.1192.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.142Services========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.1192.168.177.142  http  8080  Apache Tomcat/Coyote JSP engine 1.1

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

相关操作学习

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

网络安全零基础路线图

对于从来没有接触过网络安全的同学,我帮你们准备了详细的学习成长路线图。可以说是最科学最系统的学习路线,大家跟着这个大的方向学习准没问题。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://xiahunao.cn/news/253408.html

如若内容造成侵权/违法违规/事实不符,请联系瞎胡闹网进行投诉反馈,一经查实,立即删除!

相关文章

基于深度学习的高精度汽车自行车检测识别系统(PyTorch+Pyside6+模型)

摘要&#xff1a;基于深度学习的高精度汽车自行车检测识别系统可用于日常生活中检测与定位汽车自行车目标&#xff0c;利用深度学习算法可实现图片、视频、摄像头等方式的汽车自行车目标检测识别&#xff0c;另外支持结果可视化与图片或视频检测结果的导出。本系统采用YOLOv5目…

Kotlin笔记(零)简介

百度百科简介 2017年&#xff0c;google公司在官网上宣布Kotlin成为Android的开发语言&#xff0c;使编码效率大增。Kotlin 语言由 JetBrains 公司推出&#xff0c;这是一个面向JVM的新语言 参考资料 官网&#xff1a;https://kotlinlang.org/中文官网&#xff1a;https://w…

【测试基础02】

测试基础02 一、HTML基础二、Python导入三方模块三、安装webgrock驱动四、元素定位(1)、元素定位工具(2)、元素定位方式(3)、XPATH路径(3)、CSS选择器 五、Selenium WebDriver初步应用(1)、基本方法(2)、测试案例1(3)、测试案例2(3)、测试案例3 六、获取元素信息的方法七、fram…

黑马Redis视频教程实战篇(三)

目录 一、优惠券秒杀 1.1 全局唯一ID 1.2 Redis实现全局唯一ID 1.3 添加优惠卷 1.4 实现秒杀下单 1.5 库存超卖问题分析 1.6 代码实现乐观锁解决超卖问题 1.7 优惠券秒杀-一人一单 1.8 集群环境下的并发问题 二、分布式锁 2.1 基本原理和实现方式对比 2.2 Redis分布…

QQ截屏快速获取像素颜色

QQ截屏快速获取像素颜色 qq截屏的快捷键是 CTRL ALT A qq截屏除了截屏 还有个很不错的小功能 获取像素的颜色 是大家都容易忽略的 具体方法很简单 第一步 按下 Ctrl Alt A 快捷键 但是 不要点击鼠标 第二步 移动鼠标 到你想要像素点的颜色 如图所示 按C 即可复制 RGB十进…

计算机如何共享桌面,怎么共享电脑屏幕?

在平时的工作生活中&#xff0c;有的时候我们需要把自己的电脑屏幕共享到另一台电脑上&#xff0c;来方便给同事或者朋友演示一些操作。今天在这里给大家分享2个电脑屏幕共享的方法&#xff0c; 2种电脑屏幕共享的方法 幕享电脑投屏 幕享&#xff0c;英文名叫Letsview&#xff…

超简单友盟分享(微信、QQ)+ 原生微信分享

超简单友盟分享&#xff08;微信、QQ&#xff09; 原生微信分享 友盟分享&#xff08;微信、QQ&#xff09;原生微信分享QQ分享&#xff08;使用Android原生的api跳转QQ&#xff09; 友盟分享&#xff08;微信、QQ&#xff09; 之前写的项目好好的&#xff0c;后来打开就报这个…

手机端 html 怎么分享到朋友圈,【Web前端问题】移动web页面如何实现分享到微信、QQ等分享功能?...

移动web页面(浏览器打开的web应用&#xff0c;非App内置的Web页面)内有分享按钮&#xff0c;点击可分享到朋友圈&#xff0c;微信好友&#xff0c;QQ...... 据说是使用相关插件&#xff0c;求指导&#xff01; 回答&#xff1a; 如果不是app内置web页面,只能使用js的一键分享.具…

QQ空间说说批量删除

怎么批量删除QQ空间说说&#xff1f; 第一步&#xff1a;用电脑打开浏览器登录你的QQ空间 第二步&#xff1a;点击你的说说栏目 第三步&#xff1a;按下电脑的F12键或者点击右上角的菜单一栏&#xff0c;点击开发者工具 第四步&#xff1a;看到右半边屏幕&#xff0c;找到…

Android实现截图分享qq,微信

代码地址如下&#xff1a;http://www.demodashi.com/demo/13292.html 前言 现在很多应用都有截图分享的功能&#xff0c;今天就来讲讲截图分享吧 今天涉及到以下内容&#xff1a; 1. android权限设置及申请 2. 截图分享功能解析 3. 截图分享功能的调用 4. 项目结构图和效…

分享qq报错Only fullscreen opaque activities can request orientation

这两天突然发现了一个项目中分享链接到qq时崩溃但分享到微信却啥事没有的问题&#xff0c;然后连上usb&#xff0c;查看error发现报了这样一个错&#xff1a;Only fullscreen opaque activities can request orientation。然后就在网上搜答案&#xff0c;原来是安卓8才出现的问…

超级便捷精巧绿色的屏幕分享小软件IntelexEMC

摘要&#xff1a;因需求特殊&#xff0c;即需要在关闭QQ、微信或其他通讯软件的情况下进行屏幕分享。于是&#xff0c;整理好思路&#xff0c;开始写一个简易的屏幕分享软件&#xff0c;打了鸡血似的写了两天&#xff0c;突然&#xff0c;在查资料时发现网上有一款名叫InletexE…

Flutter 项目实战 截图分享到微信|QQ|微博 十二

/ 截图功能演示 / / 跨进程通信案例 / 调用三方app进行支付 : 支付宝支付、微信支付、银行app支付 ........ 调用三方app进行分享 : 微信分享、QQ分享、微博分享、钉钉分享、分享邮箱、打印、蓝牙....... 调用三方app进行登录 : 微信登录、QQ登录、微博登录、支付宝登录、Twit…

直接在屏幕上,选取区域进行截屏分享到QQ、微信

在手机屏幕上&#xff0c;选择某个区域进行截屏。 1&#xff0c;借用网络上一张图片&#xff0c;说明每个点的位置&#xff0c;主要是左上角和右下角这两个点。中间那块浅蓝色的就是我们的目标区域了 /*** 将一个view保存成图片* param view 传入的目标view* return*/public…

android qq悬浮窗口,qq悬浮窗口在哪里打开?怎么设置QQ悬浮窗?qq悬浮窗口设置方法分享...

QQ悬浮窗口在哪打开 qq悬浮 1.打开手机设置应用&#xff0c;点击进入设置界百面。 2.在设置应用中&#xff0c;选择“其他度应用管理”选问项。 3.打开选择答已经安装的应用&#xff0c;选择“QQ”。 4.点击“权限回管理”&#xff0c;进入权限管理界面。 5.点击“显示悬浮窗”…

qq三国行脚商脚本思路分享

qq三国行脚商玩法基于按键精灵脚本写作思路分享 欢迎和我一起学习讨论游戏脚本的写作过程游戏玩法简介脚本写作思路知易行难后续痛点和优化自我介绍后记 欢迎和我一起学习讨论游戏脚本的写作过程 你好呀&#xff01; 这是你第一次来到我的主页。如果你想学习如何使用按键精灵等…

QQ微信等分享链接时系统提取的标题和图片代码

有的时候&#xff0c;在我们写好网页后&#xff0c;需要通过QQ/微信等即时通讯工具分享出去&#xff0c;这时候&#xff0c;系统会提取网页的标题和图片&#xff0c;默认提取title和网页的第一张图片。 当然&#xff0c;我们也可以指定分享的文字和图片。以图片为例&#xff0…

远程屏幕共享软件哪个比较好用

我们远程开会需要共享屏幕来讨论会议内容&#xff0c;我们远程培训需要共享屏幕让学生一目了然自己要讲的内容&#xff1b;我们远程运维需要共享屏幕让工程师可以协同远程运维。那么共享屏幕软件哪个比较好用&#xff1f; 相信提到共享屏幕软件&#xff0c;我们首先想到的就是q…

QQ分享功能实现-Android

这篇主要介绍实现QQ的分享图片功能&#xff0c;这里用QQ官方提供的SDK。QQ的分享功能直接使用&#xff0c;不需要授权软件&#xff0c;所以比较方便。 一、准备工作 1、创建应用 腾讯QQ互联官网进行注册登录&#xff0c;并且创建应用管理&#xff0c;&#xff0c;获取到你的…

计算机桌面文件如何发送给qq好友,QQ怎么与好友分享屏幕 如何共享电脑屏幕给好友...

手机QQ有屏幕共享吗&#xff1f; 如果有 怎么共享呢 手机qq现在还有共享屏幕的功能对不起现在只有电脑版的才能共享屏幕 手机qq中的分享屏幕怎么用 还在为好友寻求帮助而烦恼吗&#xff1f;来试试屏幕分享吧&#xff0c;它可以让你的好友亲临其境的观看你的电脑屏幕发生的事情。…