本文整理汇总了Python中scapy.automaton.Automaton.parse_args方法的典型用法代码示例。如果您正苦于以下问题:Python Automaton.parse_args方法的具体用法?Python Automaton.parse_args怎么用?Python Automaton.parse_args使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scapy.automaton.Automaton
的用法示例。
在下文中一共展示了Automaton.parse_args方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_args
# 需要导入模块: from scapy.automaton import Automaton [as 别名]
# 或者: from scapy.automaton.Automaton import parse_args [as 别名]
def parse_args(self, ip, port, *args, **kargs):
self.dst = iter(Net(ip)).next()
self.dport = port
self.sport = random.randrange(0,2**16)
self.l4 = IP(dst=ip)/TCP(sport=self.sport, dport=self.dport, flags=0,
seq=random.randrange(0,2**32))
self.src = self.l4.src
self.swin=self.l4[TCP].window
self.dwin=1
self.rcvbuf=""
bpf = "host %s and host %s and port %i and port %i" % (self.src,
self.dst,
self.sport,
self.dport)
# bpf=None
Automaton.parse_args(self, filter=bpf, **kargs)
示例2: parse_args
# 需要导入模块: from scapy.automaton import Automaton [as 别名]
# 或者: from scapy.automaton.Automaton import parse_args [as 别名]
def parse_args(self, ip, port, *args, **kargs):
self.dst = ip
self.dport = port
self.sport = random.randrange(0,2**16)
self.l4 = IP(dst=ip)/TCP(sport=self.sport, dport=self.dport, flags=0,
seq=random.randrange(0,2**32))
self.src = self.l4.src
self.swin=self.l4[TCP].window
self.dwin=1
self.rcvbuf=""
bpf = "host %s and host %s and port %i and port %i" % (self.src,
self.dst,
self.sport,
self.dport)
# bpf=None
Automaton.parse_args(self, filter=bpf, **kargs)
示例3: parse_args
# 需要导入模块: from scapy.automaton import Automaton [as 别名]
# 或者: from scapy.automaton.Automaton import parse_args [as 别名]
def parse_args(self, ip, port, *args, **kargs):
from scapy.sessions import TCPSession
self.dst = str(Net(ip))
self.dport = port
self.sport = random.randrange(0, 2**16)
self.l4 = IP(dst=ip) / TCP(sport=self.sport, dport=self.dport, flags=0,
seq=random.randrange(0, 2**32))
self.src = self.l4.src
self.sack = self.l4[TCP].ack
self.rel_seq = None
self.rcvbuf = TCPSession(prn=self._transmit_packet, store=False)
bpf = "host %s and host %s and port %i and port %i" % (self.src,
self.dst,
self.sport,
self.dport)
Automaton.parse_args(self, filter=bpf, **kargs)
示例4: parse_args
# 需要导入模块: from scapy.automaton import Automaton [as 别名]
# 或者: from scapy.automaton.Automaton import parse_args [as 别名]
def parse_args(self, ip, port, *args, **kargs):
self.dst = next(iter(Net(ip)))
self.dport = port
self.sport = random.randrange(0,2**16)
self.l4 = IP(dst=ip)/TCP(sport=self.sport, dport=self.dport, flags=0,
seq=random.randrange(0,2**32))
self.src = self.l4.src
self.swin=self.l4[TCP].window
self.dwin=1
self.rcvbuf=""
bpf = "host %s and host %s and port %i and port %i" % (self.src,
self.dst,
self.sport,
self.dport)
# bpf=None
Automaton.parse_args(self, filter=bpf, **kargs)
示例5: parse_args
# 需要导入模块: from scapy.automaton import Automaton [as 别名]
# 或者: from scapy.automaton.Automaton import parse_args [as 别名]
def parse_args(self,
target,
tls_version='TLS_1_1',
request="GET / HTTP/1.1\r\nHOST: localhost\r\n\r\n",
cipher_suites=[TLSCipherSuite.RSA_WITH_AES_128_CBC_SHA],
timeout=4.0,
**kwargs):
Automaton.parse_args(self, **kwargs)
self.target = target
self.tls_version = tls_version
self.request = request
self.cipher_suites = cipher_suites
self.timeout = timeout
self.tlssock = None
示例6: parse_args
# 需要导入模块: from scapy.automaton import Automaton [as 别名]
# 或者: from scapy.automaton.Automaton import parse_args [as 别名]
def parse_args(self, filename, server, sport=None, port=69, **kargs):
Automaton.parse_args(self, **kargs)
self.filename = filename
self.server = server
self.port = port
self.sport = sport
示例7: parse_args
# 需要导入模块: from scapy.automaton import Automaton [as 别名]
# 或者: from scapy.automaton.Automaton import parse_args [as 别名]
def parse_args(self, debug=0, store=0, **kwargs):
self.comm = kwargs.pop('comm', None)
self.target = kwargs.pop('target', None)
self.device = kwargs.pop('device', None)
Automaton.parse_args(self, debug=debug, store=store, **kwargs)
self.verbose = kwargs.get('verbose', _verbose)
self.iface = kwargs.get('iface', "eth0")
if self.comm is None or self.target is None:
raise ValueError("Missing comm or target")