當前位置: 首頁>>代碼示例>>Python>>正文


Python proxy.ProxyConfig方法代碼示例

本文整理匯總了Python中mitmproxy.proxy.ProxyConfig方法的典型用法代碼示例。如果您正苦於以下問題:Python proxy.ProxyConfig方法的具體用法?Python proxy.ProxyConfig怎麽用?Python proxy.ProxyConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mitmproxy.proxy的用法示例。


在下文中一共展示了proxy.ProxyConfig方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from mitmproxy import proxy [as 別名]
# 或者: from mitmproxy.proxy import ProxyConfig [as 別名]
def __init__(self, port=12345, mode="regular", cadir="ssl/"):
        super(ProxyDaemon, self).__init__()

        if not os.path.exists(cadir):
            logger.error("%s does not exist" % cadir)
            raise ValueError("%s does not exist" % cadir)

        global HINT
        while True:
            try:
                opts = options.Options(
                    listen_port=port + HINT,
                    mode=mode,
                    cadir=cadir
                )

                config = ProxyConfig(opts)
                server = ProxyServer(config)
                self.port = port+HINT
                self.mproxy = Proxy(opts, server)
                break
            except ServerException:
                pass
            finally:
                HINT += 1 
開發者ID:CvvT,項目名稱:crawler_sqlmap,代碼行數:27,代碼來源:proxy.py

示例2: start_server

# 需要導入模塊: from mitmproxy import proxy [as 別名]
# 或者: from mitmproxy.proxy import ProxyConfig [as 別名]
def start_server(proxy_port, proxy_mode, unsave_data):
    port = int(proxy_port) if proxy_port else 8080
    mode = proxy_mode if proxy_mode else 'regular'

    if proxy_mode == 'http':
        mode = 'regular'

    opts = options.Options(
        listen_port=port,
        mode=mode,
        cadir="./ssl/",
        )

    config = proxy.ProxyConfig(opts)

    state = flow.State()
    server = ProxyServer(config)
    m = WYProxy(opts, server, state, unsave_data)
    m.run() 
開發者ID:ring04h,項目名稱:wyproxy,代碼行數:21,代碼來源:wyproxy.py

示例3: _prepare_handler

# 需要導入模塊: from mitmproxy import proxy [as 別名]
# 或者: from mitmproxy.proxy import ProxyConfig [as 別名]
def _prepare_handler(self):
        proxy_opts      = options.Options(
                                            clientcerts=self.client_cert,
                                            certs=self.certs,
                                            listen_host=self.listen_host,
                                            listen_port=self.listen_port,
                                            mode='transparent',
                                        )
        proxy_config    = proxy.ProxyConfig(proxy_opts)
        proxy_server = ProxyServer(proxy_config)
        self.master_handler = EvilInTheMiddleHandler(proxy_opts, proxy_server)

        # Initialize plugins. Same method as in WiFi-Pumpkin
        for plugin in MITMPlugin.__subclasses__():
            plugin_instance = plugin(self.configs["mitmplugins"])
            if plugin_instance.name in self.plugins:
                self.master_handler.plugins.append(plugin_instance)
                plugin_instance.setup()
                print "[+] Successfully loaded '{}' plugin.".format(plugin_instance.name) 
開發者ID:Esser420,項目名稱:EvilTwinFramework,代碼行數:21,代碼來源:etfitm.py

示例4: start_server

# 需要導入模塊: from mitmproxy import proxy [as 別名]
# 或者: from mitmproxy.proxy import ProxyConfig [as 別名]
def start_server(proxy_port, proxy_mode, unsave_data):
    port = int(proxy_port) if proxy_port else 8080
    mode = proxy_mode if proxy_mode else 'regular'

    if proxy_mode == 'http':
        mode = 'regular'

    config = proxy.ProxyConfig(
        port=port,
        mode=mode,
        cadir="./ssl/",
    )

    state = flow.State()
    server = ProxyServer(config)
    m = WYProxy(server, state, unsave_data)
    m.run() 
開發者ID:fengxuangit,項目名稱:Fox-scan,代碼行數:19,代碼來源:wyproxy.py

示例5: __init__

# 需要導入模塊: from mitmproxy import proxy [as 別名]
# 或者: from mitmproxy.proxy import ProxyConfig [as 別名]
def __init__(self, port, kb, logger, allow_domain_re, restrict_path_re):
        """
        :port:          ????
        :kb:            Universal KnowledgeBase
        :logger:        ??
        :allow_domain:  ???????????Crawler?????????????
        :restrict_path: ???????
        """
        super(ClickProxy, self).__init__()

        config = proxy.ProxyConfig(port=port)
        server = ProxyServer(config)
        self.cproxy = MasterOfProxy(
            server=server,
            kb=kb,
            allow_domain_re=allow_domain_re,
            restrict_path_re=restrict_path_re
        )

        self.logger = logger
        self.exit_flag = False
        self.seconds_wait = 2 
開發者ID:magerx,項目名稱:Eagle,代碼行數:24,代碼來源:ClickProxy.py

示例6: MainProxy

# 需要導入模塊: from mitmproxy import proxy [as 別名]
# 或者: from mitmproxy.proxy import ProxyConfig [as 別名]
def MainProxy():
    """
    The Proxy called by waunitproxy
    """
    # Configuration file
    if(os.path.isfile(args.config_file)):
    #use ~/.mitmproxy/mitmproxy-ca.pem as default CA file.
        proxyconfig = ProxyConfig(port = config.getint('Proxy', 'port'),
        cadir = "~/.mitmproxy/")
        state = flow.State()
        server = ProxyServer(proxyconfig)
        try:
            m = GoogleAnalyticsUniversal(server, state)
            m.run()
        except (KeyboardInterrupt):
            pass
    else:
        print "Invalid config file. Use --config to specify the configuration file (e.g. --config waunit.cfg)" 
開發者ID:joaolcorreia,項目名稱:WAUnit,代碼行數:20,代碼來源:main.py

示例7: start_master

# 需要導入模塊: from mitmproxy import proxy [as 別名]
# 或者: from mitmproxy.proxy import ProxyConfig [as 別名]
def start_master(self, dump_file_path, op_mode):
        logger.info('Starting master')
        config = proxy.ProxyConfig(
            port = self.port,
            mode = op_mode
        )

        dump_options = dump.Options(
            verbosity = 3,
            eventlog = True,
            flow_detail = True,
            showhost = True,
            outfile = (dump_file_path, 'wb')
        )

        server = proxy.ProxyServer(config)
        proxy_master = ProxyMaster(server, dump_options)
        proxy_master.run() 
開發者ID:ucsb-seclab,項目名稱:agrigento,代碼行數:20,代碼來源:proxy_server.py

示例8: main

# 需要導入模塊: from mitmproxy import proxy [as 別名]
# 或者: from mitmproxy.proxy import ProxyConfig [as 別名]
def main():
    opts, args = getopt.getopt(sys.argv[1:], "hp:w:")
    strPort=8888
    fnamescript='__crisschan_TEMP'+str(time.time())
    for op, value in opts:
        if op == "-p":
            strPort = value
        elif op == "-w":
            fnamescript = value
        elif op == "-h":
            #usage()
            print '-p the proxy port\r\n-w the script_solution  name'
            sys.exit()

    config = proxy.ProxyConfig(
        cadir=os.path.expanduser("~/.mitmproxy/"),
        port=int(strPort)
    )
    server = proxy.ProxyServer(config)
    print 'the porxy port is '+str(strPort)
    m = FriedRing(server, fnamescript)
    m.run() 
開發者ID:crisschan,項目名稱:FriedRing,代碼行數:24,代碼來源:fr.py

示例9: onDNSEvent

# 需要導入模塊: from mitmproxy import proxy [as 別名]
# 或者: from mitmproxy.proxy import ProxyConfig [as 別名]
def onDNSEvent(self, event):
        if self.proxy_master is not None:
            self.proxy_master.shutdown()
        
        if event.message.startswith('api-na'):
            region = 'NA'
        else:
            region = 'JP'
        
        config = wx.ConfigBase.Get()
        host = config.Read("host") or socket.gethostbyname(socket.gethostname())
        httpsport = config.Read("httpsport") or "443"

        try:
            proxy_config = proxy.ProxyConfig(port=int(httpsport), host=host, mode='reverse', upstream_server=cmdline.parse_server_spec('https://%s:443/' % event.message))
            proxy_server = ProxyServer(proxy_config)
        except Exception as e:
            evt = custom_events.wxStatusEvent(message='Error starting HTTPS proxy: %s' % e)
            wx.PostEvent(self.main_tab, evt)
            return

        self.proxy_master = PadMaster(proxy_server, self, region)
        thread.start_new_thread(self.proxy_master.run, ()) 
開發者ID:jgoldshlag,項目名稱:padherder_proxy,代碼行數:25,代碼來源:padherder_proxy.py

示例10: main

# 需要導入模塊: from mitmproxy import proxy [as 別名]
# 或者: from mitmproxy.proxy import ProxyConfig [as 別名]
def main():
    app = wx.App(False)
    if len(sys.argv) >= 2 and sys.argv[1] == '-test':
        config = wx.Config("padherder_proxy_test")
        print "In test mode"
    else:
        config = wx.Config("padherder_proxy")
    wx.ConfigBase.Set(config)
    frame = MainWindow(None, "Padherder Proxy v%s" % PH_PROXY_VERSION)
    
    host = config.Read("host") or socket.gethostbyname(socket.gethostname())
    
    logger = dnsproxy.MyDNSLogger(frame.dns_tab)
    thread.start_new_thread(dnsproxy.serveDNS, (logger, frame.main_tab, frame))
    
    try:
        app_config = proxy.ProxyConfig(port=8080, host=host)
        app_server = ProxyServer(app_config)
        app_master = dump.DumpMaster(app_server, dump.Options(app_host='mitm.it', app_port=80, app=True))
        frame.app_master = app_master
        thread.start_new_thread(app_master.run, ())
    except:
        evt = custom_events.wxStatusEvent(message='Error initalizing mitm proxy:\n' + traceback.format_exc() + '\n\nYou probably put in an incorrect IP address in Settings')            
        wx.PostEvent(frame.main_tab, evt)

    app.MainLoop() 
開發者ID:jgoldshlag,項目名稱:padherder_proxy,代碼行數:28,代碼來源:padherder_proxy.py

示例11: start_server

# 需要導入模塊: from mitmproxy import proxy [as 別名]
# 或者: from mitmproxy.proxy import ProxyConfig [as 別名]
def start_server(port, mode, domain):
    if mode == "http":
        mode = "regular"
    opts = options.Options(
        cadir="~/.mitmproxy/",
        listen_port=int(port) or 8080,
        mode=mode
    )
    if domain:
        global _domain
        _domain = domain
    config = ProxyConfig(opts)
    server = ProxyServer(config)
    m = MyMaster(opts, server)
    m.run() 
開發者ID:jjf012,項目名稱:PassiveScanner,代碼行數:17,代碼來源:proxy.py


注:本文中的mitmproxy.proxy.ProxyConfig方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。