Debian8添加kali源並安裝metasploit

應朋友需求,他要在vps上面安裝metasploit,因爲kali2.0 是基於debian8的,所以我建議他使用debian8。但是他說使用debian8 添加kali源,更新時出現404 Not Found錯誤。於是乎,我就親自嘗試了一下。

先看一下環境

root@localhost:~# cat /etc/issue.net && uname -a
Debian GNU/Linux 8
Linux localhost 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux


  • 在/etc/apt/sources.list添加kali源:

root@localhost:~# cat >> /etc/apt/sources.list << EOF
#Kali Source
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib
EOF
root@localhost:~# apt-get update

##如果出現GPG error,參考這裏

##注意,有的網站的教程,kali-rolling這個位置使用kali或者sana。這個位置表示發行代號。我去官方源站點中看了一下,並沒有kali這個代號,而且官方網站已經停止對sana源的支持,推薦使用20161月推出的kali-rolling代號,這也應該是我朋友上面的404 錯誤的原因。以後讀到這篇文章的小夥伴,出現404錯誤的話,記得注意一下你的發行代號是否已經沒有或者停止支持了。


後面的部分就和其它網站上的教程如出一轍了

  • 安裝postgresql數據庫

root@localhost:~# apt-get install postgresql
root@localhost:~# su - postgres -c "psql"              #切換到postgres用戶並登陸數據庫
##有的教程中使sudo -u postgres psql也是可以的
postgres=# alter user postgres with password 'postgrespass';   #修改數據庫密碼爲postgrespass
postgres=# \q           #退出數據庫


  •  安裝metasploit

root@localhost:~# apt-get install metasploit-framework

# 這裏會裝一大堆東西,而且會更新libc之類軟件,如果你的系統還裝有其它軟件,請謹慎安裝


  • 配置metasploit

root@localhost:~# msconfig
msf > db_connect postgres:[email protected]/msfbook    #使msf連接到postgresql數據庫
[*] Rebuilding the module cache in the background...      #這句話的意思是在後臺重建模塊緩存。
msf > db_status                #查看數據庫連接狀態
[*] postgresql connected to msfbook       #這個時候就可以正常使用msf了。

msf > search smb
[!] Module database cache not built yet, using slow search
##如果出現了這個信息,意思是說數據庫中沒有模塊的緩存,使用緩慢的搜索(直接搜索磁盤)。
##出現這個情況有可能是後臺重建緩存未完成,只需稍等片刻再嘗試,也可能是數據庫連接不正常,
##導致無法重建/讀取緩存。



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章