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
https://www.offensive-security.com/kali-linux-arm-images/

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
curl ifconfig.co
reboot
curl ifconfig.co

Register a domain I tested godaddy
fishing.site

Get API keys
https://developer.godaddy.com/keys/

Apache
/etc/init.d/apache2 start

Certbot to renew letsencrypt

apt install python-certbot-apache
certbot --apache

Create a file

vi /root/config/letsencrypt/ssl.sh
#! /bin/bash
certbot renew

Create a file

vi /root/config/godaddy-ddns/ggo.sh
#! /bin/bashpython3 /root/config/godaddy-ddns/godaddy_ddns.py %/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/ssl.sh >> /var/log/crontab-ssl.log 2>&1
*/5 * * * * /root/config/godaddy-ddns/go.sh >> /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 1.1.1.1;

Install Golang on Rasberry PI

wget https://storage.googleapis.com/golang/go1.11.8.linux-armv6l.tar.gz
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
EOF
source ~/.bashrc

Then

apt-get install gccgo

go get github.com/gophish/gophish
cd $GOPATH/src/github.com/gophish/gophish
go build

Run and have fun!

Advertisement

2 thoughts on “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

Add yours

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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.

Blog at WordPress.com.

Up ↑

%d bloggers like this: