Home Pentesting Lab - JimKnee-Champ/Ethical-Hacking-Journal GitHub Wiki

VMWare Virtual Network setup

vmnet4 - 10.0.4.0

vmnet5 - 10.0.5.0

vmnet6 - 10.0.6.0

vmnet8 - 192.168.229.0 - NAT network

Kali Installation:

Hardware: mem 4gb, proc 2, hard drive 40gb, 1 network adapter: NAT

perform installation process

at the end of the installation process, when it prompts you to restart, shut the machine off using vmware. Create a linked clone from this vm.

vyOS installation:

Hardware: mem 1gb, proc 1, hard drive 8 gb, 2 network adapters: NAT, VMNET 5

CentOS installation:

Hardware: mem 1gb, proc 1, hard drive 20 gb, 1 network adapters: VMNET 5 guest OS centOS 6 64 bit

install operating system later, choose iso as content for cd drive.

Boot, skip tests, choose defaults except: hostname centos, use all space, web server + customize now, development + development tools + server platform development.

useradd (username)

passwd (username)

usermod -aG wheel (username)

nano /etc/sudoers - Uncomment the line under "Allows users in wheel group to run all commands"

nano /etc/sysconfig/network-scripts/ifcg-eth0 - delete hardware(MAC) address. the entire line should be gone. also UUID. set ONBOOT to yes

cd /etc/udev/rules.d/

rm 70-persistent-net.rules

INSTALL VMWARE TOOLS USING THE VMWARE INTERFACE/GUI

mount /dev/cdrom /mnt

cd/mnt

cp vmware tools tar.gz file to /tmp folder

cd /tmp

tar xf VMWARE tools tar.gz

cd /vmwaretools

chmod +x vmware-install.pl

./vmware-install.pl - select all defaults, just hit enter all the way through

cd /tmp

rm -rf vmware-tools-distrib/

rm -rf vmwaretoolstar.gz

shutdown -h now

remove ISO from CD drive using vmware, change "connect at power on" setting

Capture snapshot

Create linked clone from snapshot, name the new centOS vm "cupcake"

Swap to VYOS vm to enable dhcp

set service ssh listen-address 192.168.229.10

set service dhcp-server global-parameters 'local-address 10.0.5.2;'

set service dhcp-server shared-network-name DHCPPOOL authoritative

set service dhcp-server shared-network-name DHCPPOOL subnet 10.0.5.0/24 default-router '10.0.5.2'

set service dhcp-server shared-network-name DHCPPOOL subnet 10.0.5.0/24 dns-server '10.0.5.2'

set service dhcp-server shared-network-name DHCPPOOL subnet 10.0.5.0/24 domain-name 'range.local'

set service dhcp-server shared-network-name DHCPPOOL subnet 10.0.5.0/24 lease '86400'

set service dhcp-server shared-network-name DHCPPOOL subnet 10.0.5.0/24 range POOL1 start '10.0.5.50'

set service dhcp-server shared-network-name DHCPPOOL subnet 10.0.5.0/24 range POOL1 stop '10.0.5.100'

commit

save

On Kali VM

sudo apt install wireguard

sudo -i

cd /etc/wireguard

umask 077

wg genkey | tee privatekey | wg pubkey > publickey

On VYOS VM

generate wireguard default-keypair

configure

set interfaces wireguard wg0 private-key default

set interfaces wireguard wg0 address '10.0.99.1/24'

set interfaces wireguard wg0 peer (namegoeshere) allowed-ips '10.0.99.100/32'

set interfaces wireguard wg0 peer (namegoeshere) pubkey (keygoeshere) - copy the key from the file 'publickey' on the kali vm after doing the previous steps.

set interfaces wireguard wg0 port '51820'

commit

save

exit

exit

show interfaces wireguard wg0 public-key - copy this key value back to kali as '

On KALI VM

nano wg0.conf (in /etc/wireguard)

[Interface] PrivateKey = Private key of the machine this file is on, the kali vm Address = 10.0.99.100/24 [Peer] PublicKey = public key of the peer, in this case the vyos vm. EndPoint = 192.168.229.10:51820 AllowedIPs = 10.0.99.1/32, 10.0.5.0/24

sudo wg-quick up wg0