• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python nfqueue.queue函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中nfqueue.queue函数的典型用法代码示例。如果您正苦于以下问题:Python queue函数的具体用法?Python queue怎么用?Python queue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了queue函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: bind

    def bind(self):
	self.q = nfqueue.queue()
	self.q.open()
	self.q.bind(socket.AF_INET)
	self.q.set_callback(self.callback)
	self.q.create_queue(0)
	self.q.try_run()
开发者ID:dini,项目名称:imsniff,代码行数:7,代码来源:imsniff.py


示例2: out_queue

def out_queue():
    """setup the NF_queue to "rule" the outgoing packets"""

    q = nfqueue.queue()
    q.open()

    # need to be done once
    # performed in In.py
    #q.unbind(AF_INET6)
    #q.bind(AF_INET6)


    q.set_callback(callback)

    q.create_queue(2)


    q.set_queue_maxlen(5000)

    # send a Router Solitication to all neighboring routers
    # (only at the launch of the program)
    if not NDprotector.is_router:
        SendRTSol()

    return q
开发者ID:daveti,项目名称:NDprotector,代码行数:25,代码来源:Out.py


示例3: start_dns_queue

 def start_dns_queue(self):
     self.q = nfqueue.queue()
     self.q.set_callback(self.nfqueue_callback)
     self.q.fast_open(0, socket.AF_INET)
     self.q.set_queue_maxlen(5000)
     reactor.addReader(self)
     self.q.set_mode(nfqueue.NFQNL_COPY_PACKET)
开发者ID:spnow,项目名称:MITMf,代码行数:7,代码来源:Spoof.py


示例4: fuzzThread

    def fuzzThread(self, button, aFilter):
        self.log.info(_("Launching fuzzing process with : filter=\"{0}\"").format(aFilter.get_text()))

        ## Set Netfilter NFQUEUE
#        os.popen("sudo iptables -I OUTPUT -p tcp --dport 80  -j NFQUEUE 2>&1 > /dev/null")
#        os.popen("sudo iptables -I OUTPUT -p tcp --sport 80  -j NFQUEUE 2>&1 > /dev/null")
        q = nfqueue.queue()
        q.open()
        try:
            q.unbind(socket.AF_INET)
        except:
            pass
        q.bind(socket.AF_INET)
        q.set_callback(self.nfqueue_cb)
        q.create_queue(0)
        q.set_queue_maxlen(5000)
        try:
            ## TODO : do it in a dedicated process

            q.try_run()
        except:
            pass
        q.unbind(socket.AF_INET)
        q.close()

#        os.popen("sudo iptables -D OUTPUT -p tcp --dport 80  -j NFQUEUE 2>&1 > /dev/null")
#        os.popen("sudo iptables -D OUTPUT -p tcp --sport 80  -j NFQUEUE 2>&1 > /dev/null")
        gobject.idle_add(button.set_sensitive, True)
开发者ID:KurSh,项目名称:netzob,代码行数:28,代码来源:Network.py


示例5: run

    def run(cls, template_path=''):

        # check if root
        if not os.geteuid() == 0:
            exit("\nPlease run as root\n")
        os_pattern = get_os_pattern(template_path)

        # Flush the IP tables first
        flush_tables()
        # Configure NFQUEUE target
        # Capture incoming packets and put in nfqueue 1
        os.system('iptables -A INPUT -j NFQUEUE --queue-num 0')

        # creation of a new queue object
        q = nfqueue.queue()
        q.set_callback(ProcessPKT(os_pattern).callback)
        q.fast_open(0, socket.AF_INET)
        q.set_queue_maxlen(-1)

        # process queue for packet manipulation
        try:
            workers = list()
            for i in range(2):
                workers.append(gevent.spawn(cls.worker, q))
            gevent.joinall(workers)
        except KeyboardInterrupt:
            # on exit clean up
            q.unbind(socket.AF_INET)
            q.close()
            flush_tables()
            print 'Exiting...'
开发者ID:4sp1r3,项目名称:oschameleon,代码行数:31,代码来源:osfuscation.py


示例6: run

    def run(self):
        q = nfqueue.queue()

        if self.verbose:
            print "NFQ: open"
        q.open()

        if self.verbose:
            print "NFQ: bind"
        q.bind(AF_INET)

        if self.verbose:
            print "NFQ: setting callback"
        q.set_callback(self.cb)

        if self.verbose:
            print "NFQ: creating queue"
        q.create_queue(self.queue)

        q.set_queue_maxlen(50000)

        if self.verbose:
            print "NFQ: trying to run"
        try:
            q.try_run()
        except KeyboardInterrupt, e:
            print "NFQ: interrupted"
开发者ID:regit,项目名称:opensvp,代码行数:27,代码来源:nodpi.py


示例7: go

	def go(self):
		self.q = nfqueue.queue()
		self.q.open()
		self.q.bind(socket.AF_INET)
		self.q.set_callback(self.filter_pkt)
		self.q.create_queue(0)
		self.q.try_run()
开发者ID:tylerhjones,项目名称:pi_filter,代码行数:7,代码来源:Filter.py


示例8: __init__

	def __init__(self, callback, nqueue=0, family=socket.AF_INET, maxlen=5000, map=None):
		self.queue = nfqueue.queue()
		self.queue.set_callback(callback)
		self.queue.fast_open(nqueue, family)
		self.queue.set_queue_maxlen(maxlen)
		self.fd = self.queue.get_fd()
		asyncore.file_dispatcher.__init__(self,self.fd,map)
		self.queue.set_mode(nfqueue.NFQNL_COPY_PACKET)
开发者ID:Oriumpor,项目名称:zarp,代码行数:8,代码来源:packet_modifier.py


示例9: __init__

 def __init__(self):
     self.q = nfqueue.queue()
     self.q.set_callback(queue_cb)
     self.q.fast_open(0, socket.AF_INET)
     self.q.set_queue_maxlen(5000)
     reactor.addReader(self)
     self.q.set_mode(nfqueue.NFQNL_COPY_PACKET)
     print '[*] Waiting for data'
开发者ID:Cyber-Forensic,项目名称:cookiejack,代码行数:8,代码来源:cookiejack.py


示例10: nfq_setup

 def nfq_setup(self, queueno):
   q = nfqueue.queue()
   q.set_callback(self.cb)
   try:
     q.fast_open(queueno, AF_INET)
   except RuntimeError, e:
     log.error("cannot bind to nf_queue %d: %s. Already in use or not root?" % (queueno, e))
     return False
开发者ID:siemens,项目名称:sparring,代码行数:8,代码来源:sparring.py


示例11: __init__

	def __init__(self):
		self.q = nfqueue.queue()
		self.q.set_callback(Parser().start)
		self.q.fast_open(0, socket.AF_INET)
		self.q.set_queue_maxlen(5000)
		reactor.addReader(self)
		self.q.set_mode(nfqueue.NFQNL_COPY_PACKET)
		print '[*] Flushed firewall and forwarded traffic to the queue; waiting for data'
开发者ID:swex,项目名称:LANs.py,代码行数:8,代码来源:LANs.py


示例12: __init__

 def __init__(self, cb, nqueue=0, family=AF_INET6, maxlen=5000, map=None):
     self._q = queue()
     self._q.set_callback(cb)
     self._q.fast_open(nqueue, family)
     self._q.set_queue_maxlen(maxlen)
     self.fd = self._q.get_fd()
     asyncore.file_dispatcher.__init__(self, self.fd, map)
     self._q.set_mode(NFQNL_COPY_PACKET)
开发者ID:job,项目名称:ipv6-traceroute-faker,代码行数:8,代码来源:ipv6-traceroute-faker.py


示例13: __init__

 def __init__(self, args):
     self.q = nfqueue.queue()
     self.q.set_callback(Parser(args).start)
     self.q.fast_open(0, socket.AF_INET)
     self.q.set_queue_maxlen(5000)
     reactor.addReader(self)
     self.q.set_mode(nfqueue.NFQNL_COPY_PACKET)
     print '[*] Flushed 防火墙 和转发流量 到队列 ; 等待数据 '
开发者ID:AbbySec,项目名称:WifiAttack,代码行数:8,代码来源:WifiAttack.py


示例14: __init__

 def __init__(self):
     self.q = nfqueue.queue()
     self.q.set_callback(cb)
     self.q.fast_open(0, socket.AF_INET)
     self.q.set_queue_maxlen(5000)
     reactor.addReader(self)
     self.q.set_mode(nfqueue.NFQNL_COPY_PACKET)
     print '[info] spoofing dns packets'
开发者ID:zarat,项目名称:scripts,代码行数:8,代码来源:dnspion.py


示例15: setup_nfqueue

def setup_nfqueue(fct, num):
    q = nfqueue.queue()
    q.open()
    q.unbind(socket.AF_INET)
    q.bind(socket.AF_INET)
    
    q.set_callback(fct)
    q.create_queue(num)
    return q
开发者ID:pgmplus,项目名称:workload-kit,代码行数:9,代码来源:trigger.py


示例16: __init__

	def __init__(self, cb, nqueue=1, family=AF_INET, maxlen=5000, map=None):
		self._q = nfqueue.queue()
		self._q.set_callback(cb)
		self._q.fast_open(nqueue, family)
		self._q.set_queue_maxlen(maxlen)
		self.fd = self._q.get_fd()
		asyncore.file_dispatcher.__init__(self, self.fd, map)
		self._q.set_mode(nfqueue.NFQNL_COPY_PACKET)
		print ' [*] Waiting for packets. To exit press CTRL+C'
开发者ID:bassosimone,项目名称:tweet_over_ping,代码行数:9,代码来源:tweet_over_ping_server.py


示例17: __init__

	def __init__(self):
		print '[*] in queue started.. waiting for data'
		self._q = nfqueue.queue()
		self._q.set_callback(Own().handler)
		self._q.fast_open(0, socket.AF_INET)
		self._q.set_queue_maxlen(5000)
		self.fd = self._q.get_fd()
		asyncore.file_dispatcher.__init__(self, self.fd, None)
		self._q.set_mode(nfqueue.NFQNL_COPY_PACKET)
开发者ID:CyberScions,项目名称:g0tBeEF,代码行数:9,代码来源:g0tbeef.py


示例18: __init__

    def __init__(self, queue, callback):
        self.queue = nfqueue.queue()
        self.queue.set_callback(callback)
        self.queue.fast_open(queue, AF_INET)
        self.queue.set_queue_maxlen(1024)

        self.fd = self.queue.get_fd()
        asyncore.file_dispatcher.__init__(self, self.fd, None)

        self.queue.set_mode(NFQNL_COPY_PACKET)
开发者ID:hulkamania,项目名称:lockdown,代码行数:10,代码来源:conntables.py


示例19: __init__

 def __init__(self, callback, num):
     threading.Thread.__init__(self)
     self._q = nfqueue.queue()
     self._q.set_callback(callback)
     self._q.fast_open(num, AF_INET)
     self.fd = self._q.get_fd()
     asyncore.file_dispatcher.__init__(self, self.fd, None)
     self._q.set_mode(nfqueue.NFQNL_COPY_PACKET)
     
     self._stopevent = threading.Event()
开发者ID:RobinDavid,项目名称:pystack,代码行数:10,代码来源:nfqueue_utils.py


示例20: run_queue_blocking

 def run_queue_blocking(self, callback, num):
     q = nfqueue.queue()
     q.set_callback(callback)
     q.fast_open(num,AF_INET) #Instead of : q.open() and q.bind(socket.AF_INET) and q.create_queue(12)
     try:
         time.sleep(1)
         q.try_run()
     except:
         q.unbind(AF_INET)
         q.close()
开发者ID:RobinDavid,项目名称:pystack,代码行数:10,代码来源:nfqueue_utils.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python nfs4lib.test_equal函数代码示例发布时间:2022-05-27
下一篇:
Python nfp_log.log函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap