I have a problem with my python script.
I want to send information when the client is connected to the server.
I have 9 lists for saving data:
PLATFORM = []
PLATFORM_RELEASE = []
PLATFORM_ARCH = []
USER_ACCOUNT = []
COMPUTER_ACCOUNT = []
COUNTRY = []
CITY = []
LATITUDE_LONGITUDE = []
ORG = []
In my client:
URL = "http://ipinfo.io/json"
Response = urllib2.urlopen(URL)
Reading_data = json.load(Response)
COUNTRY = str(Reading_data['country'])
CITY = str(Reading_data['city'])
LATITUDE_LONGITUDE = str(Reading_data['loc'])
ORG = str(Reading_data['org'])
PLATFORM = platform.uname()[0]
PLATFORM_RELEASE = platform.uname()[2]
PLATFORM_ARCH = platform.uname()[4]
USER_ACCOUNT = os.getlogin()
COMPUTER_ACCOUNT = platform.uname()[1]
try:
server.send(str.encode(PLATFORM))
server.send(str.encode(PLATFORM_RELEASE))
server.send(str.encode(PLATFORM_ARCH))
server.send(str.encode(USER_ACCOUNT))
server.send(str.encode(COMPUTER_ACCOUNT))
server.send(str.encode(COUNTRY))
server.send(str.encode(CITY))
server.send(str.encode(LATITUDE_LONGITUDE))
server.send(str.encode(ORG))
print "sending complete"
except:
print "sending information error"
In my server:
try:
PLATFORM.append(Connection.recv(1024))
PLATFORM_RELEASE.append(Connection.recv(1024))
PLATFORM_ARCH.append(Connection.recv(1024))
USER_ACCOUNT.append(Connection.recv(1024))
COMPUTER_ACCOUNT.append(Connection.recv(1024))
COUNTRY.append(Connection.recv(1024))
CITY.append(Connection.recv(1024))
LATITUDE_LONGITUDE.append(Connection.recv(1024))
ORG.append(Connection.recv(1024))
return
except:
print "error"
My server output:
['Linux4.16.0-kali2-amd64x86_64']
['rootBobby']
['NLPenningsveer52.3922,4.6786AS13213 UK-2 Limited']
[]
[]
[]
[]
[]
[]
I need this output:
['Linux']
['4.16.0-kali2-amd64']
['x86_64']
['root']
['Bobby']
['NL']
['Penningsveer']
['52.3922,4.6786']
['AS13213 UK-2 Limited']
What is my problem? Why is this happening?
NOTE: I am using VPN
Thank you