一、安裝過程
在/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,參考這里
或執行下面的命令
wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add
##注意,有的網站的教程,kali-rolling這個位置使用kali或者sana。這個位置表示發行代號。我去官方源站點中看了一下,並沒有kali這個代號,而且官方網站已經停止對sana源的支持,推薦使用2016年1月推出的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:postgrespass@127.0.0.1/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 ##如果出現了這個信息,意思是說數據庫中沒有模塊的緩存,使用緩慢的搜索(直接搜索磁盤)。 ##出現這個情況有可能是后台重建緩存未完成,只需稍等片刻再嘗試,也可能是數據庫連接不正常, ##導致無法重建/讀取緩存。
以上部分來自:http://www.bubuko.com/infodetail-1760180.html&&http://www.bubuko.com/infodetail-1760180.html
二、關於出現公鑰錯誤的解決辦法
當使用非官方debian源的時候,會出現gpg error的問題:
W: GPG error: http://ftp.sjtu.edu.cn ./ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 73E6B0FAA42A6CF5
W: You may want to run apt-get update to correct these problems
(1)倒數第二行的73E6B0FAA42A6CF5即為缺失的公鑰,使用如下命令獲得公鑰:
gpg --keyserver pgp.mit.edu --recv-keys 73E6B0FAA42A6CF5
公鑰服務器可更換為其他,如wwwkeys.eu.pgp.net,視自己的網絡狀況決定。
獲得公鑰后的輸出如下:
Juno:/etc/apt# gpg --keyserver pgp.mit.edu --recv-keys 73E6B0FAA42A6CF5
gpg: requesting key A42A6CF5 from hkp server pgp.mit.edu
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key A42A6CF5: public key "shame (beryl repository) <shame@sidux>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1
(2)將公鑰導入apt
gpg --armor --export A42A6CF5 | apt-key add -
(3)再次運行apt-get update
以上部分來自:http://blog.chinaunix.net/uid-16938570-id-2841664.html
三、其他問題
我安裝的過程中,在處理公鑰的時候遇到一個報錯:
gpg: directory '/root/.gnupg' created gpg: can't open '/usr/share/gnupg/dirmngr-conf.skel': No such file or directory gpg: new configuration file '/root/.gnupg/gpg.conf' created gpg: keybox '/root/.gnupg/pubring.kbx' created gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory gpg: connecting dirmngr at '/run/user/0/gnupg/S.dirmngr' failed: No such file or directory gpg: keyserver receive failed: No dirmngr
是因為沒有安裝dirmngr,只要進行安裝就好了
apt-get install dirmngr