I need to send a username , password and message to a tcp server to get an output that I need for a code challenge that i'm working on. I have been given this set of instructions:
Connect to alien server ('localhost', 10000),
Then send USER followed by aliensignal,
Then send PASS followed by unlockserver,
Next SEND followed by moonbase.
Then send END and if all followed key will provided.
I have written a python code that does exactly what it says:
import socket
clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clientsocket.connect(('localhost', 10000))
clientsocket.send('USER: aliensignal')
clientsocket.send('PASS: unlockserver')
clientsocket.send('SEND: moonbase')
clientsocket.send('END')
data = clientsocket.recv(4096)
print(data)
But i get an output that says:
############# DARKSTORE KEY SERVER SPEC ############################
Set username then password. Once set send name then end connection
and you access key will be sent.
USER: Tell server you will be sending username
PASS: Tell server you will be sending password
SEND: Tell server you will be sending data. (Must be authenticated)
END: Tell server to end transaction.
######################################################
It gives me this output whether or not I send the username and password. Does anyone know why this is happening?