Files
agtuser 16a3fd1e1b init
2024-11-11 17:56:00 +08:00

47 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
tmptty=`tty`
tmptty=`basename $tmptty`
tmpname=`whoami`
ip="$1"
inp1="ems
"
inp2="Ems123!
"
inputfile="inabc"
outputfile="out.log"
chmodbak_0="chmod -R 777 /usr/local/backup/"
chmodbak="chmod -R 666 /usr/local/backup/*"
chmodcnf_0="chmod -R 777 /usr/local/wxc2/bin/conf/"
chmodcnf="chmod -R 666 /usr/local/wxc2/bin/conf/*"
rm -fr $inputfile
rm -fr $outputfile
mknod $inputfile p
touch $outputfile
exec 7<>$outputfile
exec 8<>$inputfile
telnet $ip <&8 >&7 &
sleep 2; echo $inp1 >>$inputfile
sleep 2; echo $inp2 >>$inputfile
#tail -f $outputfile &
sleep 3; echo "su -" >>$inputfile
sleep 2; echo "rootaa" >>$inputfile
sleep 2; echo "wxc2d stop" >>$inputfile
sleep 2; echo $chmodbak_0 >>$inputfile
sleep 2; echo $chmodbak >>$inputfile
sleep 2; echo $chmodcnf_0 >>$inputfile
sleep 2; echo $chmodcnf >>$inputfile
sleep 2; echo "exit" >>$inputfile
sleep 2; echo "exit" >>$inputfile
rm -fr $inputfile
rm -fr $outputfile
#ps -ef | grep telnet | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh
#ps -ef | grep tail | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh