本文整理匯總了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")