Last active
July 12, 2019 12:28
-
-
Save royharoush/732ba1ae0b9ca094ba1abc1abda7a38b to your computer and use it in GitHub Desktop.
Prepare Kali for SSH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#make ssh run on boot | |
update-rc.d -f ssh enable 2 3 4 5 | |
#allow root to login through ssh | |
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config | |
service ssh restart | |
#fix sources list | |
printf 'deb http://http.kali.org/kali kali-rolling main non-free contrib' > /etc/apt/sources.list | |
#echo curl https://ipinfo.io/ip > /usr/bin/myip && chmod +x /usr/bin/myip | |
apt-get update | |
printf 'if [ -f /etc/bash_completion ] && ! shopt -oq posix; then \n | |
. /etc/bash_completion \n | |
fi' >> /root/.bashrc | |
#make all installation always yes - hopefully | |
rm /etc/apt/apt.conf.d/90forceyes | |
touch /etc/apt/apt.conf.d/90forceyes | |
printf 'APT::Get::Assume-Yes "true";\n' >> /etc/apt/apt.conf.d/90forceyes | |
printf 'APT::Get::force-yes "true";\n' >> /etc/apt/apt.conf.d/90forceyes | |
cat /etc/apt/apt.conf.d/90forceyes | |
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get -q -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" upgrade | |
#fix kali certificate error | |
gpg --keyserver pgpkeys.mit.edu --recv-key ED444FF07D8D0BF6 | |
gpg -a --export ED444FF07D8D0BF6 | apt-key add - | |
apt install libcurl4-openssl-dev libssl-dev | |
#install msfpc | |
curl -k -L "https://raw.githubusercontent.com/g0tmi1k/mpc/master/msfpc.sh" > /usr/local/bin/msfpc | |
chmod 0755 /usr/local/bin/msfpc | |
wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add | |
apt-get update | |
apt --fix-broken install | |
dpkg --configure -a | |
apt-get update | |
#basics | |
apt-get install git python-pip locate metasploit-framework -y | |
apt-get install python-pip | |
curl https://bootstrap.pypa.io/get-pip.py | python | |
#setup XFCE | |
#apt-get install kali-defaults kali-root-login desktop-base xfce4 xfce4-places-plugin xfce4-goodies | |
#sudo apt-get install xfce4-whiskermenu-plugin | |
#xfce4-popup-whiskermenu | |
#wget http://download.opensuse.org/repositories/home:gottcode/Debian_7.0/Release.key | |
#sudo apt-key add - < Release.key | |
#sudo apt-get update | |
#sudo apt-get install xfce4-whiskermenu-plugin | |
#delete kali default ssh keys - if running on kali you should uncomment this | |
#cd /etc/ssh | |
#mkdir default_kali_keys | |
#mv ssh_host_* default_kali_keys/ | |
#dpkg-reconfigure openssh-server | |
#install xfce4 and terminator | |
#apt-get install terminator -y # note needed, using tmux | |
#tmux setup | |
#wget https://gist.githubusercontent.com/royharoush/a04a8d0c182c3157868cc876cf8d864b/raw/3c0e3fec1e04b66d1374c0c650947ed785c3036c/getTmux.sh -O - -o /dev/null|bash | |
wget https://raw.githubusercontent.com/royharoush/rtools/master/tmuxSetup.sh -O - -o /dev/null|bash | |
git clone https://github.com/maurosoria/dirsearch.git ~/dirsearch && ln -sf ~/dirsearch/dirsearch.py /usr/bin/dirsearch && chmod +x /usr/bin/dirsearch | |
updatedb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment