28 lines
589 B
Python
28 lines
589 B
Python
import socket
|
|
|
|
# Fill in the right target here
|
|
HOST = 'netsec.net.in.tum.de' # 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('admin\n')
|
|
sf.flush()
|
|
print(sf.readline().rstrip('\n'))
|
|
sf.write('password\n')
|
|
sf.flush()
|
|
print(sf.readline().rstrip('\n'))
|
|
print(sf.readline().rstrip('\n'))
|
|
sf.close()
|
|
s.close()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
get_flag()
|