本文整理汇总了Python中core.utils.Utils.getIP方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.getIP方法的具体用法?Python Utils.getIP怎么用?Python Utils.getIP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.utils.Utils
的用法示例。
在下文中一共展示了Utils.getIP方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start
# 需要导入模块: from core.utils import Utils [as 别名]
# 或者: from core.utils.Utils import getIP [as 别名]
def start(self):
self.loadSites()
if self.config["ip"] == "0.0.0.0":
self.config["ip"]=Utils.getIP()
#define phishing sites
for key in self.websites:
self.phishingsites[key] = PhishingSite(self.config, key, self.websites[key]['path'], self.logpath, "logs/" + self.websites[key]['logfile'], self.db, self.websites[key]['redirecturl']).getResource()
site_length = 0
for key in self.phishingsites:
if (len(key) > site_length):
site_length = len(key)
# if we are doing port based
print
for key in self.phishingsites:
for port in range(self.MINPORT, self.MAXPORT):
try:
site = Site(self.phishingsites[key], logPath=self.logpath + "logs/" + self.websites[key]['logfile']+".access")
# site.logRequest = True
reactor.listenTCP(port, site)
print "Started website [%s] on [http://%s:%s]" % (('{:<%i}' % (site_length)).format(key), self.config["ip"], port)
self.websites[key]['port'] = port
break
except twisted.internet.error.CannotListenError, ex:
continue
示例2: start
# 需要导入模块: from core.utils import Utils [as 别名]
# 或者: from core.utils.Utils import getIP [as 别名]
def start(self):
self.loadSites()
ip = Utils.getIP()
#define phishing sites
for key in self.websites:
self.phishingsites[key] = PhishingSite(self.config, key, self.websites[key]['path'], self.logpath, self.websites[key]['logfile'], self.websites[key]['redirecturl']).getResource()
site_length = 0
for key in self.phishingsites:
if (len(key) > site_length):
site_length = len(key)
# if we are doing port based
print
for key in self.phishingsites:
for port in range(self.MINPORT, self.MAXPORT):
try:
reactor.listenTCP(port, Site(self.phishingsites[key]))
print "Started website [%s] on [http://%s:%s]" % (('{:<%i}' % (site_length)).format(key), ip, port)
self.websites[key]['port'] = port
break
except twisted.internet.error.CannotListenError, ex:
continue
示例3: process_campaign
# 需要导入模块: from core.utils import Utils [as 别名]
# 或者: from core.utils.Utils import getIP [as 别名]
def process_campaign(self, campaign):
self.campaigns[campaign] = {}
# load screenshot
self.campaigns[campaign]["screenshots"] = []
self.campaigns[campaign]["screenshots"].append(self.directory + campaign + "." + self.config["phishing_domain"] + ".png")
files = self.find_files(self.directory + Utils.getIP() + ":*_" + campaign + ".png")
if (files):
self.campaigns[campaign]["screenshots"].append(files[0])
# load email template and email targets
self.process_email_template(campaign)
# load phishing statistics
self.process_statistics(campaign)
return
示例4: start
# 需要导入模块: from core.utils import Utils [as 别名]
# 或者: from core.utils.Utils import getIP [as 别名]
def start(self):
self.loadSites()
ip = Utils.getIP()
# define phishing sites
for key in self.websites:
self.phishingsites[key] = PhishingSite(
self.config,
key,
self.websites[key]["path"],
self.logpath,
self.websites[key]["logfile"],
self.websites[key]["redirecturl"],
).getResource()
site_length = 0
for key in self.phishingsites:
if len(key) > site_length:
site_length = len(key)
# if we are doing port based
print
for key in self.phishingsites:
for port in range(self.MINPORT, self.MAXPORT):
try:
site = Site(
self.phishingsites[key], logPath=self.logpath + "/" + self.websites[key]["logfile"] + ".access"
)
# site.logRequest = True
reactor.listenTCP(port, site)
print "Started website [%s] on [http://%s:%s]" % (("{:<%i}" % (site_length)).format(key), ip, port)
self.websites[key]["port"] = port
break
except twisted.internet.error.CannotListenError, ex:
continue