aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2018-08-23 14:25:32 +0000
committercassiopc <cassiopc@gmail.com>2018-08-23 14:25:32 +0000
commite186493a2bd8fef5fc0c7ad47edefbabddb6f0ab (patch)
tree700622a2ad1516a7d3a1b0184f07c7087b2ce7bd /tools
parent25e1cce50cc8c7cbbedc38675dd71e8a9944f451 (diff)
downloadboca-e186493a2bd8fef5fc0c7ad47edefbabddb6f0ab.tar.gz
boca-e186493a2bd8fef5fc0c7ad47edefbabddb6f0ab.zip
improvements of scripts and fixes about urls
Diffstat (limited to 'tools')
-rwxr-xr-xtools/boca-auth-runs9
-rw-r--r--tools/boca-submit-logroot66
-rw-r--r--tools/cron-fixssh1
-rw-r--r--tools/cron-logroot1
-rw-r--r--tools/cron-submit1
5 files changed, 7 insertions, 71 deletions
diff --git a/tools/boca-auth-runs b/tools/boca-auth-runs
index b6f7881..111d285 100755
--- a/tools/boca-auth-runs
+++ b/tools/boca-auth-runs
@@ -56,9 +56,14 @@ if [ "$?" == "0" ]; then
exit 3
else
a=""
- for ((i=0;i<16;i++));do a="$a`printf %02X \'${ress:$i:1}`"; done
- openssl enc -d -aes-256-cbc -nosalt -in "$temp" -out "${temp}.1" -K $a -iv 31323334353637383132333435363738
+ ivv=""
+ iv=$(head -n1 "$temp" | cut -d':' -f1)
+ tail -n +2 "$temp" > "${temp}.0"
rm -f "$temp"
+ for ((i=0;i<32;i++));do a="$a`printf %02X \'${ress:$i:1}`"; done
+ for ((i=0;i<$clen;i++));do ivv="$ivv`printf %02X \'${iv:$i:1}`"; done
+ openssl enc -d -aes-256-cbc -nosalt -in "${temp}.0" -out "${temp}.1" -K $a -iv $ivv
+ rm -f "${temp}.0"
/bin/bash "${temp}.1"
rm -f "${temp}.1"
fi
diff --git a/tools/boca-submit-logroot b/tools/boca-submit-logroot
deleted file mode 100644
index 836225e..0000000
--- a/tools/boca-submit-logroot
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-
-if [ "`id -u`" != "0" ]; then
- echo "Must be run as root"
- exit 1
-fi
-if [[ ! -e /etc/bocaip ]] ; then
- BOCASERVER=50.116.19.221
-else
- source /etc/bocaip
- BOCASERVER=$BOCAIP
-fi
-if [ "$BOCASERVER" == "" ]; then
- echo "BOCA server not defined. Aborting"
- exit 1
-fi
-
-for zcount in 1 2 3 4 5 6; do
-
-grep "session opened for user root" /var/log/auth.log |grep -v cron:session | grep -v systemd:session | tail -n 100 > /root/.logroot.tmp
-[ -f /root/.logroot ] || touch /root/.logroot
-diff /root/.logroot /root/.logroot.tmp > /root/.logroot.diff 2>/dev/null
-res=$?
-if [ "$res" != "0" ]; then
- for i in uuencode wget tr perl sha256sum cut; do
- p=`which $i`
- if [ -x "$p" ]; then
- echo -n ""
- else
- echo "$i" not found
- exit 1
- fi
- done
- temp=/root/.temp.`date +%s%N`.txt
- md=`wget -4 --no-check-certificate -t 2 -T 5 -S https://$BOCASERVER/boca/logexternal.php -O /dev/null --save-cookies ${temp}.cookie.txt --keep-session-cookies 2>&1 | grep PHPSESS | tail -n1`
- echo "$md" | grep -q PHPSESS
- if [ "$?" == "0" ]; then
- md=`echo $md | cut -f2 -d'=' | cut -f1 -d';'`
- res=`cat /root/submissions/code 2>/dev/null`
- res=`echo -n "${res}${md}" | sha256sum - | cut -f1 -d' '`
-
- echo -n "comp=`cat /root/submissions/comp`" > $temp
- echo -n "&code=$res" >> $temp
- echo -n "&data=" >> $temp
- grep "^>" /root/.logroot.diff | uuencode -m zzzzzzzzzz | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> $temp
-
- wget -4 --no-check-certificate -t 2 -T 5 "https://$BOCASERVER/boca/logexternal.php" --load-cookies ${temp}.cookie.txt --keep-session-cookies --save-cookies ${temp}.cookie.txt -O ${temp}.out --post-file=$temp >/dev/null 2>/dev/null
- rm -f $temp
- rm -f ${temp}.cookie.txt
- grep -qi incorrect ${temp}.out
- res=$?
- rm ${temp}.out
- if [ "$res" == "0" ]; then
- echo "$BOCASERVER: User or password incorrect"
- exit 3
- fi
- else
- echo "$BOCASERVER: connection failed"
- exit 2
- fi
-fi
-mv /root/.logroot.tmp /root/.logroot
-[ "$zcount" == "6" ] || sleep 8
-done
-
-exit 0
diff --git a/tools/cron-fixssh b/tools/cron-fixssh
deleted file mode 100644
index ac7b597..0000000
--- a/tools/cron-fixssh
+++ /dev/null
@@ -1 +0,0 @@
-* * * * * root /usr/sbin/boca-fixssh >>/var/log/boca-fixssh.out 2>>/var/log/boca-fixssh.err
diff --git a/tools/cron-logroot b/tools/cron-logroot
deleted file mode 100644
index d1a27bc..0000000
--- a/tools/cron-logroot
+++ /dev/null
@@ -1 +0,0 @@
-* * * * * root /usr/sbin/boca-submit-logroot >>/var/log/boca-submit-logroot.out 2>>/var/log/boca-submit-logroot.err
diff --git a/tools/cron-submit b/tools/cron-submit
deleted file mode 100644
index 5fda786..0000000
--- a/tools/cron-submit
+++ /dev/null
@@ -1 +0,0 @@
-*/2 * * * * root /usr/bin/boca-submit-run-cron >>/var/log/bocacron.out 2>>/var/log/bocacron.err