inquisitor/inquisitor/entrypoint.sh
2025-07-11 13:02:20 +02:00

57 lines
1.8 KiB
Bash

#!/bin/bash
echo "Starting Inquisitor ARP spoofing tool..."
# Function to get IP and MAC from a container
get_container_info() {
local container_name=$1
local ip_var=$2
local mac_var=$3
echo "Getting network info for $container_name..."
# Get MAC and IP address from Docker network
local ip=$(docker inspect $container_name --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}')
local mac=$(docker inspect $container_name --format '{{range .NetworkSettings.Networks}}{{.MacAddress}}{{end}}')
if [ -z "$ip" ] || [ -z "$mac" ]; then
echo "Error: Could not get network info for $container_name"
exit 1
fi
echo "$container_name: IP=$ip, MAC=$mac"
export $ip_var=$ip
export $mac_var=$mac
}
# Get network information from FTP containers
get_container_info "ftp-client" "TARGET_IP" "TARGET_MAC"
get_container_info "ftp-server" "GATEWAY_IP" "GATEWAY_MAC"
echo ""
echo "Environment variables set:"
echo "TARGET_IP=$TARGET_IP"
echo "TARGET_MAC=$TARGET_MAC"
echo "GATEWAY_IP=$GATEWAY_IP"
echo "GATEWAY_MAC=$GATEWAY_MAC"
echo ""
# Activate virtual environment and run the Python script
echo "Activating virtual environment..."
source /opt/venv/bin/activate
echo "Starting ARP spoofing attack..."
# Run Python with unbuffered output and force line buffering
# PYTHONUNBUFFERED=1 python3 -u /app/src/inquisitor.py $TARGET_IP $TARGET_MAC $GATEWAY_IP $GATEWAY_MAC
# echo "Python script exited with code: $?"
echo "Starting interactive shell..."
echo "You can now run:"
echo " python3 /app/src/inquisitor.py $TARGET_IP $TARGET_MAC $GATEWAY_IP $GATEWAY_MAC"
echo " Or use Python interactively with: python3 -i /app/src/inquisitor.py"
echo ""
# Start an interactive bash shell
tail -f /dev/null & # Keep the script running