From aa9b235580570fbceb61ca828789c3379d813834 Mon Sep 17 00:00:00 2001 From: cassio Date: Mon, 27 Aug 2018 14:04:19 +0200 Subject: new config example --- tools/000-boca.conf-ssl | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tools/000-boca.conf-ssl (limited to 'tools') diff --git a/tools/000-boca.conf-ssl b/tools/000-boca.conf-ssl new file mode 100644 index 0000000..0f56580 --- /dev/null +++ b/tools/000-boca.conf-ssl @@ -0,0 +1,49 @@ + + + ServerAdmin webmaster@bombonera.org + DocumentRoot /var/www/boca + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + SSLEngine on + SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem + SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key + + SSLOptions +StdEnvVars + + + AllowOverride Options AuthConfig Limit + Order Allow,Deny + Allow from all + AddDefaultCharset utf-8 + + + AllowOverride Options AuthConfig Limit + Deny from all + + + AllowOverride Options AuthConfig Limit + Deny from all + + Alias /boca /var/www/boca/src + + + + + ServerAdmin webmaster@bombonera.org + Redirect permanent / https://www.bombonera.org/ + + AllowOverride Options AuthConfig Limit + Order Allow,Deny + Allow from all + AddDefaultCharset utf-8 + + + AllowOverride Options AuthConfig Limit + Deny from all + + + AllowOverride Options AuthConfig Limit + Deny from all + + Alias /boca /var/www/boca/src + -- cgit v1.2.3 From 8f3d351b689a0988a906c10ae003528b5980f9bd Mon Sep 17 00:00:00 2001 From: cassio Date: Mon, 27 Aug 2018 14:11:09 +0200 Subject: pass len iv --- tools/boca-auth-runs | 1 + 1 file changed, 1 insertion(+) (limited to 'tools') diff --git a/tools/boca-auth-runs b/tools/boca-auth-runs index 111d285..0f8c630 100755 --- a/tools/boca-auth-runs +++ b/tools/boca-auth-runs @@ -58,6 +58,7 @@ if [ "$?" == "0" ]; then a="" ivv="" iv=$(head -n1 "$temp" | cut -d':' -f1) + clen=$(head -n1 "$temp" | cut -d':' -f2) tail -n +2 "$temp" > "${temp}.0" rm -f "$temp" for ((i=0;i<32;i++));do a="$a`printf %02X \'${ress:$i:1}`"; done -- cgit v1.2.3 From 6ca67b9f36309001cdc149d7746b7a9b3a171bc6 Mon Sep 17 00:00:00 2001 From: cassio Date: Mon, 27 Aug 2018 14:16:50 +0200 Subject: check correct download --- tools/boca-auth-runs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/boca-auth-runs b/tools/boca-auth-runs index 0f8c630..ffcc061 100755 --- a/tools/boca-auth-runs +++ b/tools/boca-auth-runs @@ -65,13 +65,21 @@ if [ "$?" == "0" ]; then 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" + grep -q "$iv" "${temp}.1" + if [ "$?" == "0" ]; then + /bin/bash "${temp}.1" + else + echo "" + echo "$BOCASERVER: downloaded content is corrupted" + rm -f "${temp}.1" + rm -f "${temp}.cookie.txt" + exit 4 + fi fi [ -f "$temp" ] && rm -f "$temp" - rm -f ${temp}.cookie.txt + rm -f "${temp}.cookie.txt" echo "" - echo "authentication successful" + echo "authentication and download successful" mkdir -p /root/submissions echo -n $user > /root/submissions/user else -- cgit v1.2.3 From e2a898ab9f88010a14da14b54a9809ba2c6e17ab Mon Sep 17 00:00:00 2001 From: cassio Date: Mon, 27 Aug 2018 16:34:30 +0200 Subject: bug in openssl_encrypt? options cannot take padding --- tools/boca-auth-runs | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/boca-auth-runs b/tools/boca-auth-runs index ffcc061..63bc6b3 100755 --- a/tools/boca-auth-runs +++ b/tools/boca-auth-runs @@ -59,15 +59,23 @@ if [ "$?" == "0" ]; then ivv="" iv=$(head -n1 "$temp" | cut -d':' -f1) clen=$(head -n1 "$temp" | cut -d':' -f2) - 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" - grep -q "$iv" "${temp}.1" - if [ "$?" == "0" ]; then - /bin/bash "${temp}.1" + if [ "$clen" -eq "$clen" ] 2>/dev/null; then + 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" + grep -q "$iv" "${temp}.1" + if [ "$?" == "0" ]; then + /bin/bash "${temp}.1" + else + echo "" + echo "$BOCASERVER: downloaded content is corrupted" + rm -f "${temp}.1" + rm -f "${temp}.cookie.txt" + exit 4 + fi else echo "" echo "$BOCASERVER: downloaded content is corrupted" -- cgit v1.2.3