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 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 -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應用掃描框架使用,數據庫和掃描器的配合使用。

網絡安全零基礎路線圖


我一共劃分了六個階段,但并不是說你得學完全部才能上手工作,對于一些初級崗位,學到第三四個階段就足矣~

這里我整合并且整理成了一份【282G】的網絡安全從零基礎入門到進階資料包,需要的小伙伴可以掃描下方CSDN官方合作二維碼免費領取哦,無償分享!!!

:黑客&網絡安全的零基礎攻防教程

今天只要你給我的文章點贊,我私藏的網安學習資料一樣免費共享給你們,來看看有哪些東西。

在這里領取:

這個是我花了幾天幾夜自整理的最新最全網安學習資料包免費共享給你們,其中包含以下東西:

1.學習路線&職業規劃

在這里插入圖片描述
在這里插入圖片描述

2.全套體系課&入門到精通

在這里插入圖片描述

3.黑客電子書&面試資料

在這里插入圖片描述

4.漏洞挖掘工具和學習文檔

在這里插入圖片描述

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:
http://www.pswp.cn/news/710869.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/710869.shtml
英文地址,請注明出處:http://en.pswp.cn/news/710869.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

如何學習自然語言處理之語言模型

自然語言處理&#xff08;NLP&#xff09;是一種人工智能技術&#xff0c;它使計算機能夠理解和處理人類語言。而語言模型是NLP中的一個重要概念&#xff0c;主要是用來估測一些詞的序列的概率&#xff0c;即預測p(w1, w2, w3 … wn)&#xff0c;其中一個應用就是句子的生成。 …

JVM運行流程

? 作者&#xff1a;小胡_不糊涂 &#x1f331; 作者主頁&#xff1a;小胡_不糊涂的個人主頁 &#x1f4c0; 收錄專欄&#xff1a;JavaEE &#x1f496; 持續更文&#xff0c;關注博主少走彎路&#xff0c;謝謝大家支持 &#x1f496; JVM 1. 運行流程2. 運行時數據區2.1 堆&am…

ubuntu新建ap熱點并分享

測試環境ubuntu16,只有一臺筆記本電腦&#xff0c;不插網線&#xff0c;無線網卡既連wifi&#xff0c;又作為熱點 1.方法1 直接手動新建ap熱點 參考https://jingyan.baidu.com/article/ea24bc39b03fc6da62b331f0.html https://jingyan.baidu.com/article/363872ecd8f35d6e4ba…

機試指南:Ch5:線性數據結構 Ch6:遞歸與分治

文章目錄 第5章 線性數據結構1.向量 vector2.隊列 queue(1)隊列的特點、應用(2)基本操作(3)例題例題1&#xff1a;約瑟夫問題2 &#xff08;難度&#xff1a;中等&#xff09; (4)習題習題1&#xff1a;排隊打飯 &#xff08;難度&#xff1a;中等&#xff09; 3.棧 stack(1)棧…

前端 JS 經典:Content-type 詳解

1. 什么是 Content-Type Content-Type 是 HTTP 協議中的一個請求頭或響應頭字段&#xff0c;用于指示發送或接收的實體的媒體類型&#xff0c;告訴服務器或客戶端如何解析和處理請求或響應的主體部分。 2. Content-Type 的構成 Content-Type 由兩部分組成&#xff1a;媒體類型…

視頻在線壓縮

video2edit 一款免費的在線視頻編輯軟件&#xff0c;可以進行視頻合并、視頻剪輯、視頻壓縮以及轉換視頻格式等。 鏈接地址&#xff1a;在線視頻編輯器和轉換器 - 編輯&#xff0c;轉換和壓縮視頻文件 打開視頻壓縮頁面&#xff0c;上傳想要壓縮視頻&#xff0c;支持MP4&…

收入穩步增長 助力持續發展 尼康發布截至2024年3月財年第三季度財報

近日&#xff0c;尼康截至2024年3月財年的第三季度&#xff08;2023年10月1日-2023年12月31日&#xff09;財報正式發布。數據顯示&#xff0c;尼康集團第三財季銷售收入共計1977億日元&#xff0c;較去年同期上漲300億日元&#xff0c;漲幅約17.9%。其中影像業務領域&#xff…

Java面試題:解釋Java內存模型中的內存順序規則,Java中的線程組(ThreadGroup)的工作原理,Java中的FutureTask的工作原理

引言 在Java開發領域&#xff0c;內存模型、多線程和并發是三個至關重要的概念&#xff0c;它們直接影響到程序的性能、穩定性和可擴展性。作為面試官&#xff0c;考察候選人對這些概念的理解和應用能力是評估其技術水平的重要手段。本文將提供三道涉及這些核心知識點的面試題…

視頻記錄儀_基于聯發科MT6762的智能4G記錄儀方案

智能記錄儀采用聯發科強勁八核處理器&#xff0c;12nm制程工藝的記錄儀具便是滿足這些需求的理想選擇。搭載4GB32GB內存&#xff0c;并運行Android 11.0操作系統&#xff0c;這款記錄儀具展現出強勁的性能表現。 首先&#xff0c;這款記錄儀具具備優秀的視頻錄制功能。它能完整…

WPS如何共享文件和文件夾

1 WPS共享單個文件 用WPS打開要分享的文件&#xff0c;點擊右上角的“分享”鍵&#xff0c;選擇上傳到云端。 之后點擊“創建并分享”&#xff0c;即可分享該文檔。 2 WPS創建共享文件夾 2.1 如何共享文件夾 首先打開WPS&#xff0c;點擊左上角的首頁。在首頁欄中&#…

Ubuntu系統下DPDK環境搭建

目錄 一.虛擬機配置1.添加一個網卡(橋接模式)2.修改網卡類型3.修改網卡名稱4.重啟虛擬機5.查看網卡信息6.dpdk配置內存巨型頁 三 DPDK源代碼下載和編譯1.下載源代碼2.解壓源代碼3.安裝編譯環境4.編譯5.設置dpdk的環境變量6.禁止多隊列網卡7.加載igb_uio模塊8.網卡綁定9.驗證測試…

Vue3自定義文章列表組件

一、Vue3的代碼展示 <template><div><div v-for"article in articles" :key"article.id" class"article-card"><div class"author-info"><img :src"article.avatar" alt"Author Avatar&qu…

Android 驗證啟動模式

文章目錄 Android 驗證啟動模式查看任務棧launchModestandardsingleTopsingleTasksingleInstance Intent標記FLAG_ACTIVITY_NEW_TASKFLAG_ACTIVITY_CLEAR_TASK 和 FLAG_ACTIVITY_NEW_TASKFLAG_ACTIVITY_CLEAR_TOPFLAG_ACTIVITY_SINGLE_TOP Android 驗證啟動模式 查看任務棧 可…

軟考52-上午題-【數據庫】-關系模式2

一、關系模式的回顧 見&#xff1a;軟考38-上午題-【數據庫】-關系模式 二、關系模式 2-1、關系模式的定義 示例&#xff1a; 念法&#xff1a;A——>B A決定B&#xff0c;或者&#xff0c;B依賴于A。 2-2、函數依賴 1、非平凡的函數依賴 如果X——>Y&#xff0c;&a…

Linux Shell腳本練習(三)

1、測試用戶名與密碼是否正確。 2、輸出1-1000內的素數。 3、對 100 以內的所有正整數相加求和(1234...100)。 4、輸出9*9 乘法表。 5、編寫腳本,顯示進度條。 、 6、輸入三個數并進行升序排序

RocketMQ - 深入研究一下生產者到底如何發送消息的

1. 創建Topic的時候為何要指定MessageQueue數量 首先如果要搞明白生產者的工作原理,那么就必須先明白一個概念,MessageQueue是什么? 而要明白MessageQueue是什么,就必須把他跟Topic以及Broker綜合起來看,才能搞明白。如果我們要使用RocketMQ,你先部署出來一套RocketMQ集…

C++高級面試題:解釋 C++ 中的智能指針循環引用問題,并介紹如何解決它

解釋 C 中的智能指針循環引用問題&#xff0c;并介紹如何解決它 智能指針循環引用問題指的是兩個或多個對象之間相互持有對方的智能指針&#xff0c;導致內存泄漏的情況。當使用智能指針時&#xff0c;如果對象之間存在循環引用關系&#xff0c;可能會造成內存泄漏&#xff0c…

附詳細答案,最新BAT大廠面試者整理的Android面試題目

前言 前幾年移動互聯網創業的風口&#xff0c;如今漸漸消失&#xff0c;移動互聯網被巨頭公司瓜分&#xff0c;一些創業公司倒閉了&#xff0c;Android 開發需求慢慢趨近于飽和。而當初移動互聯網處于風口時&#xff0c;自學、轉行以及培訓機構出來了大量 Android 開發從業者&…

CSS-浮動,定位

1. 浮動 (float) CSS的定位機制有三種&#xff1a;普通流(標準流)&#xff0c;浮動和定位。 普通流就是一個網頁內標簽元素正常從上到下&#xff0c;從左到右排列順序的意思&#xff0c;比如塊級元素會獨占一行&#xff0c;行內元素會按順序依次前后排列&#xff1b;按照這種大…

docker 安裝單機版 opengauss5.0.1

前言 因為官網的鏡像直接安裝不成功&#xff0c;所以才寫的這邊文章 1、下載openGauss 地址&#xff1a; https://opengauss.org/zh/download/ 下載名稱為&#xff1a;openGauss-5.0.1-CentOS-64bit.tar.bz2 1.1、 下載gosu-amd64 下載 gosu-amd64 2、制作鏡像(和官網保持一致)…