# deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot i386 LIVE/INSTALL Binary 20141002-12:53]/ kali contrib main non-free
# deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot i386 LIVE/INSTALL Binary 20141002-12:53]/ kali contrib main non-free
## Kali官方更新源
# deb http://http.kali.org/kali kali main non-free contrib
# deb-src http://http.kali.org/kali kali main non-free contrib
# deb http://security.kali.org/kali-security kali/updates main contrib non-free
## Kali中科大更新源
deb http://mirrors.ustc.edu.cn/kali kali main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali main non-free contrib
deb http://mirrors.ustc.edu.cn/kali-security kali/updates main contrib non-free
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
auto eth0
iface eth0 inet static # static表示使用固定ip,dhcp表示使用动态ip
address 192.168.1.10 # 设置ip地址:192.168.1.10
netmask 255.255.255.0 # 设置子网掩码:255.255.255.0
gateway 192.168.1.1 # 设置网关:192.168.1.1
root@c2unix:~# cd /etc/ssh/
root@c2unix:/etc/ssh# mkdir default_kali_1.0.9_keys
root@c2unix:/etc/ssh# mv ssh_host_* default_kali_1.0.9_keys/
root@c2unix:/etc/ssh# dpkg-reconfigure openssh-server
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
[ ok ] Restarting OpenBSD Secure Shell server: sshd.
04.设置Kali Linux SSH MOTD编辑:/etc/motd(http://patorjk.com/software/taag/#p=display&f=Standard&t=)。
14.Kali Linux设置Msf服务开机自启动
Kali Linux渗透测试系统中的metpasploit工具相关服务(postgresql,metasploit)默认是不开启的,我们需要手动开启并设置为自启动 。在不开启postgresql服务使用msfconsole命令启动metasploit会出现以下提示,可以使用db_status命令查看数据库连接状态,如果在数据库未连接状态下使用metasploit不会生成保存渗透测试数据所需数据表 。
root@c2unix:~# msfconsole
Starting the Metasploit Framework console.../
[-] Failed to connect to the database: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
......
msf > db_status
root@c2unix:~# service postgresql start
[ ok ] Starting PostgreSQL 9.1 database server: main.
root@c2unix:~# service metasploit start
[ ok ] Starting Metasploit rpc server: prosvc.
[ ok ] Starting Metasploit web server: thin.
[ ok ] Starting Metasploit worker: worker.
root@c2unix:~# service postgresql status
Running clusters: 9.1/main
root@c2unix:~# service metasploit status
[ ok ] Metasploit rpc server is running.
[ ok ] Metasploit web server is running.
[ ok ] Metasploit worker is running.
root@c2unix:~# update-rc.d -f postgresql remove && update-rc.d -f postgresql defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
root@c2unix:~# update-rc.d -f metasploit remove && update-rc.d -f metasploit defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
root@c2unix:~# reboot
root@c2unix:~# msfconsole
Starting the Metasploit Framework console...|
Metasploit Park, System Security Interface
Version 4.0.5, Alpha E
Trouble managing data? List, sort, group, tag and search your pentest data
in Metasploit Pro -- learn more on http://rapid7.com/metasploit
=[ metasploit v4.10.2-2014111901 [core:4.10.2.pre.2014111901 api:1.0.0]]
+ -- --=[ 1379 exploits - 850 auxiliary - 233 post ]
+ -- --=[ 340 payloads - 37 encoders - 8 nops ]
+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]
msf > db_status
postgresql connected to msf3
15.Kali Linux KEYEXPIRED 1425567400
问题描述:Kali Linux系统由于太长时间没有更新,而会出现GPG错误 KEYEXPIRED 1425567400。经检查更新源未出现问题,可以正常解析,deb也不冲突,就是密钥过期了。
16.Kali VirtualBox增强功能失效解决方法
Kali Liunx系统的Virtualbox增强功能突然失效,导致复制、全屏等功能无法使用 。在需要用Kali Linux系统的时候很不方便,尝试重装Virtualbox增强功能(出错了)。具体原因请看错误信息中提示的日志文件: /var/log/vboxadd-install.log
root@c2unix:~# sudo ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.1.12 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.1.12 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
Building the main Guest Additions module ...fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions ...done.
Installing the Window System drivers
Warning: unknown version of the X Window System installed. Not installing
X Window System drivers.
Installing modules ...done.
Installing graphics libraries and desktop services components ...done.