From a9c43f5a20f2b96d781059f9903fcd9cdac80b4f Mon Sep 17 00:00:00 2001 From: arielkru <63583491+arielkru@users.noreply.github.com> Date: Tue, 16 Jan 2024 14:15:14 +0200 Subject: [PATCH 1/3] Update main.py --- python/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/main.py b/python/main.py index 2e7b1c0..992ff76 100644 --- a/python/main.py +++ b/python/main.py @@ -4,6 +4,7 @@ from socket import socket, AF_INET, SOCK_STREAM, SOCK_NONBLOCK # Set a file write by others. + temp_file = "/tmp/foo.txt" os.chmod(temp_file, stat.S_IWOTH) @@ -12,6 +13,7 @@ os.chmod("/tmp/foo.txt", stat.S_IXGRP) tar_file = '/file.tax*' + os.system(tar_file) KEY_SIZE = 1024 @@ -20,6 +22,7 @@ key_size=KEY_SIZE ) + private_dsa_key = dsa.generate_private_key( key_size=KEY_SIZE, ) @@ -29,10 +32,12 @@ assert(private_dsa_key_2 == private_dsa_key) + program = 'a = 5\nb=10\nprint("Sum =", a+b)' exec(program) + def is_real_user(user="user123", password="Password1"): return True @@ -41,17 +46,20 @@ def is_real_user(user="user123", password="Password1"): AF_INET, SOCK_STREAM | SOCK_NONBLOCK) + # Bind the socket to the internet with a port number sock.bind(("::", 32007)) def add_server_port(sg, server_name, port): server = _get_server(sg, server_name, port) + if server is not None: return False set_port(port) return server + add_server_port('security-group', 'server', 80) From e65fab47c803a1994c9988c700088194fdce3a57 Mon Sep 17 00:00:00 2001 From: arielkru <63583491+arielkru@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:21:41 +0200 Subject: [PATCH 2/3] Update main.py --- python/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/main.py b/python/main.py index 992ff76..d5276e3 100644 --- a/python/main.py +++ b/python/main.py @@ -10,19 +10,24 @@ with open(temp_file, 'r') as f: print(f) + os.chmod("/tmp/foo.txt", stat.S_IXGRP) + tar_file = '/file.tax*' os.system(tar_file) + KEY_SIZE = 1024 private_rsa_key = rsa.generate_private_key( + public_exponent=65537, key_size=KEY_SIZE ) + private_dsa_key = dsa.generate_private_key( key_size=KEY_SIZE, ) From 42f60173d2ff821087564c88b0ed993f16cdf156 Mon Sep 17 00:00:00 2001 From: arielkru <63583491+arielkru@users.noreply.github.com> Date: Tue, 16 Jan 2024 22:41:21 +0200 Subject: [PATCH 3/3] Update main.py --- python/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/main.py b/python/main.py index d5276e3..de9d4a6 100644 --- a/python/main.py +++ b/python/main.py @@ -5,15 +5,19 @@ # Set a file write by others. + temp_file = "/tmp/foo.txt" + os.chmod(temp_file, stat.S_IWOTH) + with open(temp_file, 'r') as f: print(f) os.chmod("/tmp/foo.txt", stat.S_IXGRP) + tar_file = '/file.tax*' os.system(tar_file) @@ -21,6 +25,7 @@ KEY_SIZE = 1024 private_rsa_key = rsa.generate_private_key( + public_exponent=65537, key_size=KEY_SIZE