mirror of https://github.com/dirtbags/moth.git
Fix register.cgi to work outside dbtl
This commit is contained in:
parent
618f00e2a8
commit
668b466414
|
@ -1,5 +1,21 @@
|
||||||
#! /bin/sh -e
|
#! /bin/sh -e
|
||||||
|
|
||||||
|
# Change to CTF_BASE
|
||||||
|
cd ${CTF_BASE:-.}
|
||||||
|
for i in $(seq 5); do
|
||||||
|
[ -d packages ] && break
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
if ! [ -d packages ]; then
|
||||||
|
cat <<EOF
|
||||||
|
Content-type: text/html
|
||||||
|
|
||||||
|
Cannot find CTF_BASE
|
||||||
|
EOF
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Read CGI parameters
|
||||||
param () {
|
param () {
|
||||||
ret=$(echo "$QUERY_STRING" | tr '=&' ' \n' | awk -v "k=$1" '($1==k) {print $2;}')
|
ret=$(echo "$QUERY_STRING" | tr '=&' ' \n' | awk -v "k=$1" '($1==k) {print $2;}')
|
||||||
ret=$(busybox httpd -d "$ret" || echo "$ret")
|
ret=$(busybox httpd -d "$ret" || echo "$ret")
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
echo 'Content-type: application/octet-stream'
|
|
||||||
echo
|
|
||||||
|
|
||||||
tar czf - /var/lib/ctf | KEY=crashmaster arc4
|
|
Loading…
Reference in New Issue