Fishing with Raspberry Pi, Kali, Auto connect to VPN, Auto register domain with GoDaddy, Automatic SSL cert with Letsencrypt, Run Golang, Run Gophish @letsencrypt @golang @kalilinux @GoDaddy #kali #raspberrypie #linux #infosec #hacking #pentest #pentesting #redteam #gophish

This is just for demo, I used root as user, you should perhaps consider other user to do this.

Installation of Kali
Download Kali Image

Flash the SDCARD with etcher on you Kali box or any other burning program.

Put the sdcard in the PI and boot

OpenVPN Autostart
Download opvpn conf file from you choosing
copy the vpn file to /etc/openvpn/client.conf (not the client directory)

Specify in conf file
auth-user-pass login.conf
Create login.conf put username and password in that

chmod 400 ./login.conf

To get this service up and runing at boot

vi /etc/default/openvpn

uncomment AUTOSTART=”all”

sudo systemctl enable openvpn@client.service
sudo systemctl daemon-reload
sudo service openvpn@client start

To Check

Register a domain I tested godaddy

Get API keys

/etc/init.d/apache2 start

Certbot to renew letsencrypt

apt install python-certbot-apache
certbot --apache

Create a file

vi /root/config/letsencrypt/
#! /bin/bash
certbot renew

Create a file

vi /root/config/godaddy-ddns/
#! /bin/bashpython3 /root/config/godaddy-ddns/ %/root/config/godaddy-ddns/godaddy-ddns.config

Crontab job for Lets encrypt and SSL renew
Every 12 hours and every 5 minutes
0 */12 * * * /root/config/letsencrypt/ >> /var/log/crontab-ssl.log 2>&1
*/5 * * * * /root/config/godaddy-ddns/ >> /var/log/crontab-go.log 2>&1

Install php

sudo apt-get -y install php

Install Firewall

apt-get install ufw
sudo systemctl enable ufw
sudo ufw logging on
sudo ufw allow from admin-pc to any port 22
sudo ufw allow to any port 443

Set nameserver hard even if dhcp is in use

vi /etc/dhcp/dhclient.conf
supersede domain-name-servers;

Install Golang on Rasberry PI

sudo tar -C /usr/local -xvf go1.11.8.linux-armv6l.tar.gz
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
source ~/.bashrc


apt-get install gccgo

go get
cd $GOPATH/src/
go build

Run and have fun!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.