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)