modified the changes

This commit is contained in:
2024-11-01 00:07:17 +09:00
parent 65986c1ca5
commit 2858c522ef
5 changed files with 197 additions and 138 deletions

View File

@ -0,0 +1,23 @@
import socket
# Fill in the right target here
HOST = 'localhost' # TODO
PORT = 20001 # TODO
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
print(sf.readline().rstrip('\n'))
sf.write('Hello World\n')
sf.flush()
sf.close()
s.close()
if __name__ == '__main__':
get_flag()