n0va_sa

information_gathering [Post Exploitation Tool]

Aug 25th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.17 KB | None | 0 0
  1. # Post Exploitation Tool #
  2. # information gathering tool #
  3.  
  4. import platform
  5. import time
  6. import urllib.request
  7. import json
  8. import subprocess
  9. import os
  10.  
  11. def correctTime(time):
  12.     time = time.split()
  13.     return time[3]
  14.  
  15. def extractTime(time):
  16.     time = time.split(':')
  17.     if int(time[0]) < 12:
  18.         return "{0}:{1} am".format(time[0], time[1])
  19.     else:
  20.         return "{0}:{1} pm".format(time[0], time[1])
  21.  
  22.  
  23. # cpu time #
  24. cpu_time = extractTime(correctTime(time.ctime()))
  25. # location #
  26. fp = urllib.request.urlopen("http://freegeoip.net/json")
  27. web_content = fp.read()
  28.  
  29. web_content = web_content.decode('utf-8')
  30.  
  31. data = json.loads(web_content)
  32. 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'])
  33. fp.read()
  34.  
  35. if platform.system() == "Linux":
  36.     isp_info = subprocess.check_output('curl ipinfo.io', shell=True)
  37.     isp_info = isp_info.decode('utf-8')
  38.     isp_info = json.loads(isp_info)
  39.     sendDetail += "=>ISP:" + isp_info['org']
  40.  
  41. sendDetail += "=>Distribution:(" + platform.platform() + ")"
  42. print(cpu_time)
  43. print(sendDetail)
Add Comment
Please, Sign In to add comment