温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Debian8添加kali源并安装metasploit

发布时间:2020-04-11 13:25:09 来源:网络 阅读:11451 作者:sunlinyao1993 栏目:数据库

应朋友需求,他要在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: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
##如果出现了这个信息,意思是说数据库中没有模块的缓存,使用缓慢的搜索(直接搜索磁盘)。
##出现这个情况有可能是后台重建缓存未完成,只需稍等片刻再尝试,也可能是数据库连接不正常,
##导致无法重建/读取缓存。



向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI