Skip to content

Instantly share code, notes, and snippets.

@elijahc
Last active August 12, 2017 10:12
Show Gist options
  • Save elijahc/b81d5e8b4fb6cd5655a26ba7448d926f to your computer and use it in GitHub Desktop.
Save elijahc/b81d5e8b4fb6cd5655a26ba7448d926f to your computer and use it in GitHub Desktop.
Kali Raspberry Pi Setup over Ethernet

Hardcode IP address into the boot sequence on the SD card (cmdline.txt)

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 elevator=deadline root=/dev/mmcblk0p2 rootfstype=ext4 rootwait ip=169.254.113.200

Try pinging the raspi

$ ping 169.254.113.200

SSH to it

$ ssh [email protected]

Update Software

$ apt-get update
#$ apt-get -y dist-upgrade (optional)
$ apt-get install -y build-essential

Install Tools

$ apt-get install -y vim screen tmux tshark tcpdump git stunnel

Fix Python and Pip

$ apt-get install -y python-dev
$ wget https://bootstrap.pypa.io/get-pip.py
$ python get-pip.py

Confirm pip installed to /usr/local

$ which pip
/usr/local/bin/pip

Fix SSH Keys

$ apt-get install openssh-server

Change runlevel settings

# Kali 1.x
$ update-rc.d -f ssh remove
$ update-rc.d -f ssh defaults

# Kali 2.x
$ systemctl enable ssh.service

Replace default and insecure ssh keys

$ cd /etc/ssh
$ mkdir insecure_original_default_kali_keys
$ mv ssh_host_* insecure_original_default_kali_keys

Make new SSH keys for the pi

$ dpkg-reconfigure openssh-server

Add a Non-root User

$ adduser elijah -p deepsecret0
$ adduser elijah sudo

# Confirm setup correctly
$ id elijah

Don't allow root login and restrict logins to ipv4

$ nano /etc/ssh/sshd_config
[...]
AddressFamily inet
[...]
PermitRootLogin No
[...]

Disable ipv6

$ su
$ vim /etc/sysctl.conf
# Add these lines to the bottom:
[...]
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment