diff --git a/python/main.py b/python/main.py index 2e7b1c0..581dc01 100644 --- a/python/main.py +++ b/python/main.py @@ -1,21 +1,25 @@ import os, stat from cryptography.hazmat.primitives.asymmetric import rsa, dsa from Crypto.PublicKey import DSA + 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) + 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 ) @@ -27,9 +31,11 @@ private_dsa_key_2 = DSA.generate(bits=KEY_SIZE) + assert(private_dsa_key_2 == private_dsa_key) program = 'a = 5\nb=10\nprint("Sum =", a+b)' + exec(program) @@ -46,6 +52,9 @@ def is_real_user(user="user123", password="Password1"): def add_server_port(sg, server_name, port): + + + server = _get_server(sg, server_name, port) if server is not None: return False