Execute bash script from Remote TCP (netcat)

Wait TCP connect then execute script

while true; do
  nc -l 5000 | {
    while read line; do
      case "$line" in
        key )
          command here;;
      esac
    done
  }
done

Tips: normal nc: nc -l 5000
busybox nc: nc -l -p 5000

Remotely

echo key | nc -q 0 1.1.1.1 5000
curl -XPOST -d '{"macAddress":"AA-AA-AA-AA-AA-AA"}' http://xxx.example.com:11111/api/v1/wake
powered by GitbookFile Modify: 2022-04-06 15:06:28

results matching ""

    No results matching ""