From 35e9a1542f1dd961a09d198977d4c2fed467f4dc Mon Sep 17 00:00:00 2001 From: "gasperfele@fri1.uni-lj.si" Date: Sat, 8 Oct 2016 18:10:14 +0000 Subject: fixed the mock_entrance_exam task git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@361 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/tasks/mock_entrance_exam/task.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'kpov_judge/tasks/mock_entrance_exam') diff --git a/kpov_judge/tasks/mock_entrance_exam/task.py b/kpov_judge/tasks/mock_entrance_exam/task.py index 017ad54..afe2d66 100644 --- a/kpov_judge/tasks/mock_entrance_exam/task.py +++ b/kpov_judge/tasks/mock_entrance_exam/task.py @@ -196,11 +196,11 @@ def task_check(results, params): for i in xrange(100): s_out += chr(32 + ((ord(arg[i % arg_len]) ^ ord(var[i % env_len])) % 64)) r += ord(arg[i % arg_len]) + ord(var[i % env_len]) + i; - if (i % 20 == 0): + if (i % 17 == 0): s_out += "RAUS\r\n"; - if (i % 31 == 0): + if (i % 29 == 0): s_out += 'ma' - s_err += chr((r % 32) + ord('A')); + s_err += chr((r % 31) + ord('A')); if (i % 23 == 0): s_err += "PATACIS\r\n" retval = r % 16 @@ -285,14 +285,14 @@ int main(int argc, char **argv){ } ''' evil_shell_source = """#!/bin/bash -e -{ while true; do - ifconfig eth1 10.0.4.19 2> /dev/null; - ifconfig eth0 10.0.4.20 2> /dev/null; - ifconfig eth2 10.0.4.21 2> /dev/null; - ifconfig en0p3 10.0.4.19 2> /dev/null; - ifconfig en0p8 10.0.4.20 2> /dev/null; - ifconfig enp0p3 10.0.4.21 2> /dev/null; - ifconfig enp0p8 10.0.4.21 2> /dev/null; +{ while true; do + /sbin/ifconfig eth1 10.0.4.19 2> /dev/null; + /sbin/ifconfig eth0 10.0.4.20 2> /dev/null; + /sbin/ifconfig eth2 10.0.4.21 2> /dev/null; + /sbin/ifconfig en0p3 10.0.4.19 2> /dev/null; + /sbin/ifconfig en0p8 10.0.4.20 2> /dev/null; + /sbin/ifconfig enp0s3 10.0.4.21 2> /dev/null; + /sbin/ifconfig enp0s8 10.0.4.21 2> /dev/null; sleep 10; done; }& """ @@ -317,7 +317,7 @@ done; }& d.chmod(0775, sh_file) d.write("/etc/rc.local", """#!/bin/sh -e export PATH=$PATH:{} -{} & +nohup {} & exit 0 """.format(sh_path, task_params['net_prog_name'])) -- cgit v1.2.1