This commit is contained in:
2024-12-09 18:22:38 +09:00
parent ab0cbebefc
commit c4c4547706
959 changed files with 174888 additions and 6 deletions

26
week06/easy/client.py Normal file
View File

@ -0,0 +1,26 @@
import socket
# Fill in the right target here
HOST = 'this.is.not.a.valid.domain' # TODO
PORT = 0 # TODO
def int_to_bytes(m):
return m.to_bytes((m.bit_length() + 7) // 8, 'big').decode()
def get_flag():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
sf = s.makefile('rw') # we use a file abstraction for the sockets
message1 = sf.readline().rstrip('\n')
# TODO
sf.close()
s.close()
if __name__ == '__main__':
get_flag()