challenge changes

This commit is contained in:
Pin
2022-12-27 21:10:29 -05:00
parent 97580ab120
commit f99d4d6a01
5 changed files with 27 additions and 44 deletions

View File

@@ -1,10 +1,6 @@
#!/bin/bash
TEAM_NUM=${TEAM_NUM:=10}
for (( i=1; i<=TEAM_NUM; i++ )); do
if [[ ! -e "${HOME}/.ssh/team-${i}" ]]; then
ssh-keygen -q -t ed25519 -N '' -f "${HOME}/.ssh/team-${i}" -C "team${i}"
fi
done
if [[ ! -e "${HOME}/.ssh/user" ]]; then
ssh-keygen -q -t ed25519 -N '' -f "${HOME}/.ssh/user" -C "user"
fi

View File

@@ -1,27 +1,16 @@
#!/bin/bash
SCORING_POD=${SCORING_POD:=client}
TEAM_NUM=${TEAM_NUM:=10}
echo "Generating scoring details"
SCORING_FLAG=${SCORING_FLAG:=defaultFlag}
/opt/scripts/gen_keys.sh
echo "Scoring Details"
cat /root/.ssh/*.pub
while true; do
echo "Testing Scoring"
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "user@${SCORING_POD}" -i "/root/.ssh/user" \
"echo ${SCORING_FLAG} >.flag"
for (( i=1; i<=${TEAM_NUM}; i++ )); do
echo "Testing Team ${i}"
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "team${i}@${SCORING_POD}" -i "/root/.ssh/team-${i}" \
'echo "flag" >.flag'
done
sleep 30
sleep 15
done