def __init__(self):
global KeyPath
debug("context", "Started CTX with key path: %s" % KeyPath)
self.store = PSSTMessageStore()
self.keystore = Keystore(KeyPath)
self.unseen = Unseen(KeyPath)
self.internal = socket.gethostbyname(socket.gethostname())
# Calculate ID
self.clientID = win32api.GetComputerName().lower() + "." + win32api.GetDomainName().lower()
self.isAdmin = ctypes.windll.shell32.IsUserAnAdmin()
# Get external IP address
try:
# Get External IP Address
opener = urllib2.build_opener()
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
target = "http://www.icanhazip.com/"
response = opener.open(target).read()
self.external = response.strip()
except Exception as e:
print(str(e))
# Calculate corp and DC
#TODO
Context.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录