Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Post Exploitation Tool #
- # information gathering tool #
- import platform
- import time
- import urllib.request
- import json
- import subprocess
- import os
- def correctTime(time):
- time = time.split()
- return time[3]
- def extractTime(time):
- time = time.split(':')
- if int(time[0]) < 12:
- return "{0}:{1} am".format(time[0], time[1])
- else:
- return "{0}:{1} pm".format(time[0], time[1])
- # cpu time #
- cpu_time = extractTime(correctTime(time.ctime()))
- # location #
- fp = urllib.request.urlopen("http://freegeoip.net/json")
- web_content = fp.read()
- web_content = web_content.decode('utf-8')
- data = json.loads(web_content)
- sendDetail = "Region:{0}=>TimeZone:{1}=>Location:(latitude:{2}:longitude:{3})=>IP:{4}".format(data['region_name'], data['time_zone'], data['latitude'], data['longitude'], data['ip'])
- fp.read()
- if platform.system() == "Linux":
- isp_info = subprocess.check_output('curl ipinfo.io', shell=True)
- isp_info = isp_info.decode('utf-8')
- isp_info = json.loads(isp_info)
- sendDetail += "=>ISP:" + isp_info['org']
- sendDetail += "=>Distribution:(" + platform.platform() + ")"
- print(cpu_time)
- print(sendDetail)
Add Comment
Please, Sign In to add comment