Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.py #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions python/main.py
Original file line number Diff line number Diff line change
@@ -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
)
Expand All @@ -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)


Expand All @@ -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
Expand Down