当前位置: 首页>>代码示例>>Python>>正文


Python Utils.getIP方法代码示例

本文整理汇总了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
开发者ID:firebitsbr,项目名称:SPF,代码行数:30,代码来源:web.py

示例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
开发者ID:Sh3llSh0ck3d,项目名称:SPF,代码行数:27,代码来源:web.py

示例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
开发者ID:BahtiyarB,项目名称:SPF,代码行数:17,代码来源:report.py

示例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
开发者ID:jiangzhw,项目名称:SPF,代码行数:38,代码来源:web.py


注:本文中的core.utils.Utils.getIP方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。