Track the Desktop or Laptop

Hi,

I have done the Script which tracks the Location i.e (Country, State, City, Longitude, and Latitude) and Also gives the system information.

Note :

The script will get information from the open source website.



import urllib2,re,ssl,os,socket,sys,platform,uuid
print  "Computer Name: " +socket.gethostname()
print "FQDN: " +socket.getfqdn()
print "System Platform: "+sys.platform
print "Machine: " +platform.machine()
print "Node " +platform.node()
print "Platform: "+platform.platform()
print "Pocessor: " +platform.processor()
print "System OS: "+platform.system()
print "Release: " +platform.release()
print "Version: " +platform.version()
print "
"
req = urllib2.Request('https://iplocation.net/')
context = ssl._create_unverified_context()
c=0
res = urllib2.urlopen(req,context=context)
data = res.read()
patterns =  re.findall('href="\/go\/ip2location(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)
(.*)',data)
values = ','.join(str(v) for v in patterns)
ki=re.findall('<td>(.*)<',values)
list1=[]
Data=ki[0].split('<')
Data[2]=Data[2].strip('td>')
Data[5]=Data[5].strip('td>')
Data[7]=Data[7].strip('td>')
Data[25]=Data[25].strip('td>')
Data[29]=Data[29].strip('td>')
Data[31]=Data[31].strip('td>')
dict={'IP Address':Data[0],'Country':Data[2],'State':Data[5],'City':Data[7],'organization':Data[25],'longitude':Data[29],'lattitude':Data[31]}
for keys,values in dict.items():
    print keys +"=   "+values
    list1.append(keys +"=   "+values)
file_data1=str(list1)


Please Refer the following link for your reference:
https://scripts.comodo.com/backend/w…ktop-or-laptop

!(upload://z6xoU0LvSb5PsdbyYTvwdDT5te2.png)

!(upload://z6xoU0LvSb5PsdbyYTvwdDT5te2.png)

!(upload://z6xoU0LvSb5PsdbyYTvwdDT5te2.png)

Hi,

Can you let me know how you are locating the coordinates? Is this just via IP lookup?

The reason i ask is because this really isnt a reliable way to track the location of a laptop, if its connected to a VPN or on a 3/4G connection you often find that the IP breaks out in to an entirely different location to where the laptop actually is.

For example our ISP breaks out in Ireland, we are located just outside of London as a result an IP trace would bring back results for a location in Ireland.

thanks!

Hi @Joners

Yes, The script works with IP Lookup

This script has Limitations which work with the Stable setup in IP Address. It gets the Standard IP-Address of Organisation or Computer registered with the public network.

In order to work with coordinates, the Desktop or Laptop should support the GPS device.

Thought that was the case, might just want to make a short disclaimer in the original post that states what the limitations are.