From 8081a5520a441b43a8a7a73f3a90c7aacfaa8e10 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 24 Feb 2019 21:05:27 +0100 Subject: Move everything one level up --- .../tasks/mock_entrance_exam/howtos/en/index.html | 0 .../howtos/images/SimpleArbiter-interface1.jpg | Bin 211527 -> 0 bytes .../howtos/images/SimpleArbiter-interface2.jpg | Bin 213524 -> 0 bytes .../howtos/images/SimpleArbiter.jpg | Bin 217218 -> 0 bytes .../howtos/images/student-entrance-interface1.jpg | Bin 193759 -> 0 bytes .../howtos/images/student-entrance-interface2.jpg | Bin 195110 -> 0 bytes .../howtos/images/student-entrance.jpg | Bin 217218 -> 0 bytes .../tasks/mock_entrance_exam/howtos/si/index.html | 82 ------ kpov_judge/tasks/mock_entrance_exam/task.py | 313 --------------------- 9 files changed, 395 deletions(-) delete mode 100644 kpov_judge/tasks/mock_entrance_exam/howtos/en/index.html delete mode 100644 kpov_judge/tasks/mock_entrance_exam/howtos/images/SimpleArbiter-interface1.jpg delete mode 100644 kpov_judge/tasks/mock_entrance_exam/howtos/images/SimpleArbiter-interface2.jpg delete mode 100644 kpov_judge/tasks/mock_entrance_exam/howtos/images/SimpleArbiter.jpg delete mode 100644 kpov_judge/tasks/mock_entrance_exam/howtos/images/student-entrance-interface1.jpg delete mode 100644 kpov_judge/tasks/mock_entrance_exam/howtos/images/student-entrance-interface2.jpg delete mode 100644 kpov_judge/tasks/mock_entrance_exam/howtos/images/student-entrance.jpg delete mode 100644 kpov_judge/tasks/mock_entrance_exam/howtos/si/index.html delete mode 100644 kpov_judge/tasks/mock_entrance_exam/task.py (limited to 'kpov_judge/tasks/mock_entrance_exam') diff --git a/kpov_judge/tasks/mock_entrance_exam/howtos/en/index.html b/kpov_judge/tasks/mock_entrance_exam/howtos/en/index.html deleted file mode 100644 index e69de29..0000000 diff --git a/kpov_judge/tasks/mock_entrance_exam/howtos/images/SimpleArbiter-interface1.jpg b/kpov_judge/tasks/mock_entrance_exam/howtos/images/SimpleArbiter-interface1.jpg deleted file mode 100644 index 8953de7..0000000 Binary files a/kpov_judge/tasks/mock_entrance_exam/howtos/images/SimpleArbiter-interface1.jpg and /dev/null differ diff --git a/kpov_judge/tasks/mock_entrance_exam/howtos/images/SimpleArbiter-interface2.jpg b/kpov_judge/tasks/mock_entrance_exam/howtos/images/SimpleArbiter-interface2.jpg deleted file mode 100644 index 4eeb5e0..0000000 Binary files a/kpov_judge/tasks/mock_entrance_exam/howtos/images/SimpleArbiter-interface2.jpg and /dev/null differ diff --git a/kpov_judge/tasks/mock_entrance_exam/howtos/images/SimpleArbiter.jpg b/kpov_judge/tasks/mock_entrance_exam/howtos/images/SimpleArbiter.jpg deleted file mode 100644 index 4df497e..0000000 Binary files a/kpov_judge/tasks/mock_entrance_exam/howtos/images/SimpleArbiter.jpg and /dev/null differ diff --git a/kpov_judge/tasks/mock_entrance_exam/howtos/images/student-entrance-interface1.jpg b/kpov_judge/tasks/mock_entrance_exam/howtos/images/student-entrance-interface1.jpg deleted file mode 100644 index 3174913..0000000 Binary files a/kpov_judge/tasks/mock_entrance_exam/howtos/images/student-entrance-interface1.jpg and /dev/null differ diff --git a/kpov_judge/tasks/mock_entrance_exam/howtos/images/student-entrance-interface2.jpg b/kpov_judge/tasks/mock_entrance_exam/howtos/images/student-entrance-interface2.jpg deleted file mode 100644 index 5679dae..0000000 Binary files a/kpov_judge/tasks/mock_entrance_exam/howtos/images/student-entrance-interface2.jpg and /dev/null differ diff --git a/kpov_judge/tasks/mock_entrance_exam/howtos/images/student-entrance.jpg b/kpov_judge/tasks/mock_entrance_exam/howtos/images/student-entrance.jpg deleted file mode 100644 index 4df497e..0000000 Binary files a/kpov_judge/tasks/mock_entrance_exam/howtos/images/student-entrance.jpg and /dev/null differ diff --git a/kpov_judge/tasks/mock_entrance_exam/howtos/si/index.html b/kpov_judge/tasks/mock_entrance_exam/howtos/si/index.html deleted file mode 100644 index f10bcf1..0000000 --- a/kpov_judge/tasks/mock_entrance_exam/howtos/si/index.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Preparation_mock_entrance_exam_HowTo - - -

MOCK ENTRANCE EXAM - HOWTO

- -

1) POSTAVITEV VIRTUALK

- -Najprej prenesi obe sliki za virtualki iz sistema kpov-judge, 2. naloga. Če se sliki ne naložita takoj, malo počakaj in osveži stran. -Ustvari novo virtualko imenovano "Student", tip je načeloma "Linux" ter verzija "Ubuntu (64-bit)" - lahko pa je tudi karkoli drugega. Določi ustrezno količino pomnilnika, ki bo na voljo napravi, izberi možnost rabe obstoječe slike navidezne naprave ter izberi prenešeno datoteko "student-entrance.vdi". Klikni ustvari.
ni slike
-Prejšnji postopek ponovi še za "SimpleArbiter", "Linux", "Ubuntu (64-bit)", "simplearbiter.vdi".
ni slike
- -

2) OMREŽNE NASTAVITVE VIRTUALK

- -V navodilih naloge lahko vidimo, da morata biti obe virtualki povezani v internet ter povezani med seboj prek nekega notranjega omrežja. -Na "SimpleArbiter" nastavimo pod Settings->Network->Adapter 1; Enable network adapter "check", Attached to: NAT. ->Adapter 2; Enable network adapter "check", Atached to: Internal Network.
ni slike ni slike
-Na "Student" je postopek nastavitve enak kot na "SimpleArbiter".
ni slike ni slike
- -OPOMBA: Pozoren je treba biti, da sta oba vmesnika, ki sta povezana na notranje omrežje (Internal Nerwork) povezana preko istega omrežja, npr. "intnet". - -

3) ZAGON VIRTUALK IN POSOTPEK NALOGE

- -SA - SimpleArbiter -STUD - Student - -Najprej zaženemo obe vritualki, to storimo s klikom na gumb start. -Na SA se prijavimo z uporabniškim imenom "tester" ter geslom "tester" - -

3.1) POSKRBIMO ZA MREŽO

- -

3.1.1) SPREMEMGA GESLA ZA ROOT

- -Z uporabo ukaza /sbin/ifconfig preverimo, ali so vmesniki pravilno nastavljeni. Kaj kmalu ugotovimo, da je na SA aktiven samo en vmesnik. Za nastavljanje omesnikov moramo najprej postati "root", torej uporabnik, ki ima pooblastila za urejanje sistemskih nastavitev. -Najprej ponovno zaženemo virtualko: "sudo reboot", potrdimo z geslom "tester". -V GRUB meniju (zagonski meni) nato pritisnemo tipko "e", ki omogoča spreminjanje ukazov pred zagonom. Vrstico "53d ro" spremenimo v "53d rw init=/bin/bash". Pritisnemo "F10" in sprožimo zagon naprave. -Sedaj lahko kot super uporabnik zamenjaš geslo za root, to storiš z ukazom "passwd", sistem te nato vpraša za novo geslo, po vnosu pa še za potrditev gesla. Geslo je uspešno spremenjeno, spremembe pa je potrebno še shraniti na disk, to storiš z ukazom "mount -o remount,ro /", izvedi še ukaz "sync", da se podatki res zapišejo na disk. Sedaj lahko virtualko ponovno zaženeš kar iz Machine->Reset. - -

3.1.2) NASTAVIMO OMREŽNE VMESNIKE

- -V virtualko SA se sedaj prijavimo kot uporabnik "root" ter s spremenjenim geslom "karsinastavil". -Sedaj spremenimo nastavitve omrežnih vmesnikov tako, da bodo naslovi ustrezali tistim v navodilih. Izvedemo ukaz "ifconfig enp0s8 10.0.2.129 netmask 255.255.255.128 up" -Preklopimo na virtualko STUD (uporabnik "root", geslo "kaboom") ter izvedemo podoben ukaz "ifconfig enp0s8 10.0.2.X netmassk 255.255.255.128", kjer je X podatek iz navodil naloge. -Notranje omrežje testiramo tako, da pošljemo ping iz SA do STUD z ukazom "ping NASLOV", kjer je NASLOV omrežni naslov na STUD, ki je povezan na notranje omrežje (nastavitev iz prejšnjega koraka). -SUPER, omrežje deluje, gremo naprej. Če ne deluje, preveri pravilnost naslovov na SA in STUD, bodi pozoren na dolžino maske ter na morebitne zatipke. - -

3.2) "ZLONAMERNI" PROGRAM

- -V navodilih naloge je podano ime programa, ki naj bi ob svojem zagonu pokvaril nastavitve omrežnih vmesnikov na STUD. Z ukazom "ps xa | grep IMEPROGRAMA" preverimo, če se program izvaja. V izpisu ugotovimo, da se najvrjetneje ne izvaja, zato lahko zadevo ignoriramo. Če bi se program izvajal, bi bilo potrebno ukrepati ter ga na nek način izbrisati oz. mu onemogočiti spreminjanje omrežnih vmesnikov (najlažje bi bilo uporabiti ukaz "kill", ki kot argument prejme PID (prvi stolpec prejšnjega izpisa) ter konča izvajanje tega procesa). Več o ukazu "kill" si preberi na spletu! - -

3.3) PREVAJANJE PROGRAMA

- -Najprej si odpremo novo konzolo na STUD "alt+F2" ter se prijavimo kot "student" z geslom "vaje". -Z ukazom "ls" preverimo vsebino domačega direktorija uporabnika student. Izpisati bi se morala datoteka, ki jo imamo podano v navodilih. To datoteko moramo najprej odpreti z ukazom "vim IMEDATOTEKE". Datoteko moramo sedaj popraviti tako, da odstranimo odvečne črke, to storimo tako, da izvedemo ukaz ":%s/[QXW]*//g", sedaj izvedemo še ":syn on" in si obarvamo kodo. Izhod iz urejevalnika ":wq". -Ta program sedaj z ukazom "gcc IMEPREVEDENEGAPROGRAMA IMEDATOTEKE" prevedemo v nov program, kjer je IMEPREVEDENEGAPROGRAMA izhodni program, katerega ime je prav tako podano v navodilih, IMEDATOTEKE pa ime pravkar popravljene datoteke. - -

3.4) SKRIPTA

- -Sedaj bomo napisali nov program/skripto, uporabimo urejevalnik nano; "nano IMESKRIPTE", kjer je IMESKRIPTE podano v navodilih naloge. -V skripto zapišemo sledeče;
-
-----BREZ TE VRSTICE-------
-
-#!/bin/bash
-
-echo -n $SPREMENLJIVKA | /home/student/IMEPREVEDENEGAPROGRAMA "argument" 2> /home/student/IMEDATOTEKE_STDERR | grep "ma" > /home/student/IMEDATOTEKE_STDOUT
-
-----BREZ TE VRSTICE-------
-
-Datoteko shranimo "ctrl+x" ter potrdimo z "y" in enter. -Datoteko sedaj spremenimo v program "chmod +x IMESKRIPTE" - -

4) TESTIRANJE NALOGE

- -Preklopimo nazaj na SA ter odpremo novo konzolo "alt+F2", vpišemo se kot uporabnik "tester" z geslom "tester" in poženemo program "./test_task.py" -Izpolnimo vsa polja; URL "https://kpov.fri.uni-lj.si/kpov_judge/tasks", vpišemo svoje uporabniško ime in geslo (za dostop do KPOV-JUDGE preko učilnice) npr. "jn1234@student.uni-lj.si geslozaucilnico", ime naloge "02-preparation-mock_entrance_exam". Sedaj se pojavijo še vaši vhodni in izhodni podatki za nalogo, preverite, če so pravilni; datoteka z izhodom, IP naslov SA, ime spremenljivke, ime "zlonamernega" programa, datoteka z napakami ter neko naljučno seme itd. -Če program vrne 10 OK je naloga uspešno opravljena, sicer pa vrne število doseženih točk ter napako. -
- - diff --git a/kpov_judge/tasks/mock_entrance_exam/task.py b/kpov_judge/tasks/mock_entrance_exam/task.py deleted file mode 100644 index ad51c2a..0000000 --- a/kpov_judge/tasks/mock_entrance_exam/task.py +++ /dev/null @@ -1,313 +0,0 @@ -# TODO: -# - check if everything is filled in (computers, params, preparation) -# - improve scoring -# - test -# - switch to a real SSH/SFTP client to properly handle filenames - -instructions = { - 'si': '''\ -

-Postavite dva navidezna računalnika - SimpleArbiter in Student. Oba naj bosta povezana na internet. Poleg tega mora biti Student na naslovu {{student_IP}} dostopen s SimpleArbiter. - -

-Računajte, da se na Student ob zagonu zažene program {{net_prog_name}}, ki vam spreminja nastavitve mrežne kartice. - -

-V domačem imeniku uporabnika student obstaja program {{P_c}} v programskem jeziku C. -Prevedite ga v program z imenom {{P_executable}}. Izvorna koda je namenoma pokvarjena tako, da so vanjo vrinjeni nepotrebni znaki. Pred prevajanjem jo morate popraviti. - -

-Napišite skripto ali program {{P_script}} v domačem imeniku uporabnika student, ki: - -

- -

-Lastnik vseh ustvarjenih datotek mora biti uporabnik student. Gesla uporabnika student (vaje) ne smete spreminjati. -''', - 'en': '''\ -

-Set up two virtual machines - SimpleArbiter and Student. Both should be connected to the internet. Student should also be accessible from SimpleArbiter at the address {{student_IP}}. - -

-Keep in mind that a program called {{net_prog_name}} starts on Student on each boot. This program may change your network settings. - -

-There is a program called {{P_c}} in student’s home directory. Compile it into a program called {{P_executable}}. The source code is intentionally broken so that unneccessarry characters are inserted into the file. You have to fix the file before compiling. - -

-Also, write a script or program called {{P_script}} in student’s home directory. The script should: - -

- -

-The owner of all created files should be student. You are not allowed to change student’s password (vaje). -''', -} - -computers = { - 'SimpleArbiter': { - 'disks': [ - { - 'name': 'simpleArbiter', - }, - ], - 'network_interfaces': [ - {'network': 'net1'}, - {'network': 'net2'}, - ], - 'flavor': 'm1.tiny', - 'config_drive': True, - }, - 'Student': { - 'disks': [ - {'name': 'student-entrance'} - ], - 'flavor': 'm1.tiny', - 'network_interfaces': [{'network': 'net1'}, {'network': 'net3'}], - 'config_drive': True, - } -} - -networks = { - 'net1': { - 'public': False, - }, - 'net2': { - 'public': True, - }, - 'net3': { - 'public': True, - } -} - -params_meta = { - 'student_IP': { - 'descriptions': { 'si': 'IP naslov SimpleStudent', 'en': 'IP address of SimpleStudent', - }, 'w': False, 'public': True, 'type': 'IP', 'generated': True, - }, - 'net_prog_name': { - 'descriptions': { 'si': 'Ime programa, ki ponastalvlja naslov', 'en': 'The name of the program resetting the network' - }, 'w': False, 'public': True, 'type': 'filename', 'generated': True, - }, - 'P_c': { - 'descriptions': { 'si': 'Datoteka s programom v C', 'en': 'Filename of the program in C', - }, 'w': False, 'public': True, 'type': 'filename', 'generated': True, - }, - 'P_executable': { 'descriptions': { 'si': 'Ime prevedenega programa v C', 'en': 'Filename of the compiled C program' - }, 'w': False, 'public': True, 'type': 'filename', 'generated': True, - }, - 'arg_c': { - 'descriptions': { 'si': 'Vrednost argumenta', 'en': 'Argument value', - }, 'w': False, 'public': True, 'type': 'short_text', 'generated': True, - }, - 'env_c': { - 'descriptions': { 'si': 'Ime okoljske spremenljivke', 'en': 'The name of the environment environment', - }, 'w': False, 'public': True, 'type': 'short_text', 'generated': True, - }, - 'out_stderr_c': { - 'descriptions': { 'si': 'Datoteka z napakami', 'en': 'File to store errors', - }, 'w': False, 'public': True, 'type': 'filename', 'generated': True, - }, - 'P_script': { - 'descriptions': { 'si': 'Ime skripte', 'en': 'Filename of the script', - }, 'w': False, 'public': True, 'type': 'filename', 'generated': True, - }, - 'out_stdout_c': { - 'descriptions': { 'si': 'Datoteka z izhodom', 'en': 'File to store the output', - }, 'w': False, 'public': True, 'type': 'filename', 'generated': True, - }, - 'param_gen_seed': { - 'descriptions': { 'si': 'Nakljucno seme', 'en': 'Random seed', - }, 'w': False, 'public': True, 'type': None, 'generated': True, - }, - 'c_destroy_gen_seed': { - 'descriptions': { 'si': 'Nakljucno seme za kvarjenje kode v C', 'en': 'Random seed for destroying the C code', - }, 'w': False, 'public': False, 'type': None, 'generated': True, - } - -} - -def task(student_IP, net_prog_name, - P_c, P_executable, arg_c, env_c, out_stderr_c, out_stdout_c, P_script, - param_gen_seed): - import random - - r = random.Random(int(param_gen_seed)) - env_val = "".join([r.choice('ABCDEFGHIJKLMNPRSTUVZ012345') for i in range(11)]) - arg_val = "".join([r.choice('ABCDEFGHIJKLMNPRSTUVZ012345') for i in range(13)]) - stdin_val = "".join([r.choice('ABCDEFGHIJKLMNPRSTUVZ012345') for i in range(17)]) - - return kpov_util.ssh_test(student_IP, 'student', 'vaje', ( - ('script_ls', 'ls -l {}'.format(P_script)), - ('executable_ls', 'ls -l {}'.format(P_executable)), - ('script_run', 'export {}={}; {}'.format(env_c, env_val, P_script)), - ('script_stderr', 'cat {}'.format(out_stderr_c)), - ('script_stdout', 'cat {}'.format(out_stdout_c)), - ('prog_stdout', 'echo "{}" | {} "{}" 2> /dev/null'.format(stdin_val, P_executable, arg_val)), - ('prog_stderr', 'echo "{}" | {} "{}" > /dev/null'.format(stdin_val, P_executable, arg_val)), - )) - -def gen_params(user_id, params_meta): - import random - r = random.Random(user_id+'evil cornholio') - params = kpov_util.default_gen(user_id, params_meta) - homedir = '/home/student/' - params['env_c'] = "".join([r.choice('ABCDEFGHIJKLMNPRSTUVZ') for i in range(5)]) - params['P_c'] = "".join([r.choice('abcdefghijklmnoprst') for i in range(5)]) + ".c" - params['param_gen_seed'] = str(r.randint(0, 2**24)) - params['c_destroy_gen_seed'] = str(r.randint(0, 2**24)) - dest_net = kpov_util.IPv4_subnet_gen(r, '10.0.2.128/26', 26) - params['student_IP'] = kpov_util.IPv4_addr_gen(r, dest_net)[0] - for k in ['P_c', 'P_executable', 'out_stderr_c', 'P_script', 'out_stdout_c']: - params[k] = homedir + params[k] - return params - -def task_check(results, params): - import os - def test_out_gen(arg, var): - s_out = "" - s_err = "" - r = 0 - arg_len = len(arg) - env_len = len(var) - for i in range(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 % 17 == 0): - s_out += "RAUS\r\n"; - if (i % 29 == 0): - s_out += 'ma' - s_err += chr((r % 31) + ord('A')); - if (i % 23 == 0): - s_err += "PATACIS\r\n" - retval = r % 16 - s_err += '\r\n' - s_out += '\r\n' - return(s_out, s_err, retval) - score = 0 - hints = [] - if results['ssh'] is not True: - hints += ['ssh failed: ' + results['ssh']] - r = random.Random(int(params['param_gen_seed'])) - env_val = "".join([r.choice('ABCDEFGHIJKLMNPRSTUVZ012345') for i in range(11)]) - arg_val = "".join([r.choice('ABCDEFGHIJKLMNPRSTUVZ012345') for i in range(13)]) - stdin_val = "".join([r.choice('ABCDEFGHIJKLMNPRSTUVZ012345') for i in range(17)]) - expected_script_stdout, expected_script_stderr, rval = test_out_gen( - params['arg_c'], env_val - ) - expected_script_stderr = 'cat {}\r\n'.format(params['out_stderr_c']) + expected_script_stderr - # hints += [expected_script_stderr, results['script_run'], results['script_stderr'], params['arg_c'], env_val] - if expected_script_stderr != results['script_stderr']: - hints += ['wrong script stderr'] - else: - score += 2 - split_stdout = expected_script_stdout.split('\r\n') - expected_script_stdout = "\r\n".join([ i for i in split_stdout if i.find('ma') >= 0]) - expected_script_stdout = 'cat {}\r\n'.format(params['out_stdout_c']) + expected_script_stdout + "\r\n" - if expected_script_stdout != results['script_stdout']: - hints += ['wrong script stdout'] - else: - score += 2 - expected_prog_stdout, expected_prog_stderr, rval = test_out_gen( - arg_val, stdin_val - ) - if expected_prog_stderr != results['prog_stderr'][-len(expected_prog_stderr):]: - hints += ['wrong program stderr'] - else: - score += 2 - if expected_prog_stdout != results['prog_stdout'][-len(expected_prog_stdout):]: - hints += ['wrong program stdout'] - else: - score += 2 - if results['script_ls'].find('-r') < 0: - hints += ['script not found'] - else: - score += 1 - if results['executable_ls'].find('xr') < 0: - hints += ['C executable not found'] - else: - score += 1 - return score, hints - -def prepare_disks(templates, task_params, global_params): - c_source = '''#include -#include -#include -/* Odstranite vse odvecne velike crke Q, W ali X in program se bo prevedel. */ - -int main(int argc, char **argv){ - unsigned char *arg; - unsigned char var[255]; - int i, arg_len, env_len, r; - scanf("%s", var); - arg = argv[1]; - arg_len = strlen(argv[1]); - env_len = strlen(var); - r = 0; - for (i = 0; i<100; i++){ - printf("%c", 32 + (arg[i % arg_len] ^ var[i % env_len]) % 64); - r += (int)arg[i % arg_len] + (int)var[i % env_len] + i; - if (i % 17 == 0){ - printf("RAUS\\n"); - } - if (i % 29 == 0){ - printf("ma"); - } - fprintf(stderr, "%c", (r % 31) + 'A'); - if (i % 23 == 0){ - fprintf(stderr, "PATACIS\\n"); - } - } - printf("\\n"); - fprintf(stderr, "\\n"); - return r % 16; -} -''' - evil_shell_source = """#!/bin/bash -e - -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; -""" - import random - d = templates['student-entrance'] - r = random.Random(task_params['c_destroy_gen_seed']) - destroyed_c_source = c_source[:110] - for c in c_source[110:]: - i = r.randint(0, 5) - if i == 1: - destroyed_c_source += 'QW' - if i == 2: - destroyed_c_source += 'XW' - if i == 3: - destroyed_c_source += 'QX' - destroyed_c_source += c - d.write(task_params['P_c'], destroyed_c_source) - d.chown(1000, 1000, task_params['P_c']) - sh_path = r.choice(['/usr/share/doc', '/var/lib', '/usr/local/share', '/etc/alternatives']) - sh_file = sh_path + '/' + task_params['net_prog_name'] - d.write(sh_file, evil_shell_source) - d.chmod(0o775, sh_file) - d.write("/etc/rc.local", """#!/bin/sh -e -export PATH=$PATH:{} -nohup {} & - -exit 0 -""".format(sh_path, task_params['net_prog_name'])) - - write_default_config(templates['simpleArbiter'], global_params) -- cgit v1.2.1