Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scapy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
a6e2c2f3
Commit
a6e2c2f3
authored
8 years ago
by
Pierre LALET
Browse files
Options
Downloads
Patches
Plain Diff
Prevent sr() tests crashes
parent
037c992d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
scapy/contrib/HomePlugAV.uts
+9
-0
9 additions, 0 deletions
scapy/contrib/HomePlugAV.uts
test/edns0.uts
+6
-0
6 additions, 0 deletions
test/edns0.uts
test/regression.uts
+10
-1
10 additions, 1 deletion
test/regression.uts
with
25 additions
and
1 deletion
scapy/contrib/HomePlugAV.uts
+
9
−
0
View file @
a6e2c2f3
...
...
@@ -85,18 +85,27 @@ _ == (True, True)
#= Discovery packet tests in local
#~ netaccess HomePlugAV NetworkInfoConfirmationV10 NetworkInfoConfirmationV11
#pkt = Ether()/HomePlugAV()
#old_debug_dissector = conf.debug_dissector
#conf.debug_dissector = False
#a = srp1(pkt, iface="eth0")
#conf.debug_dissector = old_debug_dissector
#a
#pkt.version = a.version
#pkt /= NetworkInformationRequest()
#old_debug_dissector = conf.debug_dissector
#conf.debug_dissector = False
#a = srp1(pkt, iface="eth0")
#conf.debug_dissector = old_debug_dissector
#NetworkInfoConfirmationV10 in a or NetworkInfoConfirmationV11 in a
#_ == True
#= Reading local 0x400st octets of Software Image in Module Data blocks
#~ netaccess HomePlugAV ReadModuleDataRequest
#pkt = Ether()/HomePlugAV()/ReadModuleDataRequest(ModuleID=0x1)
#old_debug_dissector = conf.debug_dissector
#conf.debug_dissector = False
#a = srp1(pkt, iface="eth0")
#conf.debug_dissector = old_debug_dissector
#a
#len(a.ModuleData) == pkt.Length
#_ == True
...
...
This diff is collapsed.
Click to expand it.
test/edns0.uts
+
6
−
0
View file @
a6e2c2f3
...
...
@@ -48,7 +48,10 @@ str(tlv) == b'\x00\x05\x00\x04\x00\x11"3'
#= EDNS-PING - Live test
#~ netaccess
#* NB: 85.17.219.217 and www.edns-ping.org seem down
#old_debug_dissector = conf.debug_dissector
#conf.debug_dissector = False
#r = sr1(IP(dst="85.17.219.217")/UDP()/DNS(qd=[DNSQR(qtype="A", qname="www.edns-ping.org.")], ar=[DNSRROPT(z=0, rdata=[EDNS0TLV(optcode="PING", optdata=b"\x00\x11\x22\x33")])]), timeout=1)
#conf.debug_dissector = old_debug_dissector
#len(r.ar) and r.ar.rdata[0].optcode == 4 # XXX: should be 5
+ Test DNS Name Server Identifier (NSID) Option
...
...
@@ -59,5 +62,8 @@ str(tlv) == b'\x00\x02\x00\x00'
= NSID - Live test
~ netaccess
old_debug_dissector = conf.debug_dissector
conf.debug_dissector = False
r = sr1(IP(dst="l.root-servers.net")/UDP()/DNS(qd=[DNSQR(qtype="SOA", qname=".")], ar=[DNSRROPT(z=0, rdata=[EDNS0TLV(optcode="NSID")])]), timeout=1)
conf.debug_dissector = old_debug_dissector
len(r.ar) and DNSRROPT in r.ar and len(r.ar[DNSRROPT].rdata) and len([x for x in r.ar[DNSRROPT].rdata if x.optcode == 3])
This diff is collapsed.
Click to expand it.
test/regression.uts
+
10
−
1
View file @
a6e2c2f3
...
...
@@ -491,7 +491,10 @@ assert(x.PDU.varbindlist[2].value == 1)
= Sending and receiving an ICMP
~ netaccess IP ICMP
x=sr1(IP(dst="www.google.com")/ICMP(),timeout=3)
old_debug_dissector = conf.debug_dissector
conf.debug_dissector = False
x = sr1(IP(dst="www.google.com")/ICMP(),timeout=3)
conf.debug_dissector = old_debug_dissector
x
assert x[IP].ottl() in [32, 64, 128, 255]
assert 0 <= x[IP].hops() <= 126
...
...
@@ -501,7 +504,10 @@ x is not None and ICMP in x and x[ICMP].type == 0
~ netaccess IP UDP DNS
* A possible cause of failure could be that the open DNS (resolver1.opendns.com)
* is not reachable or down.
old_debug_dissector = conf.debug_dissector
conf.debug_dissector = False
dns_ans = sr1(IP(dst="resolver1.opendns.com")/UDP()/DNS(rd=1,qd=DNSQR(qname="www.slashdot.com")),timeout=5)
conf.debug_dissector = old_debug_dissector
DNS in dns_ans
= Whois request
...
...
@@ -579,7 +585,10 @@ len(_) == 12
= Port scan
~ netaccess IP TCP
old_debug_dissector = conf.debug_dissector
conf.debug_dissector = False
ans,unans=sr(IP(dst="www.google.com/30")/TCP(dport=[80,443]),timeout=2)
conf.debug_dissector = old_debug_dissector
ans.make_table(lambda (s,r): (s.dst, s.dport, r.sprintf("{TCP:%TCP.flags%}{ICMP:%ICMP.code%}")))
= Traceroute function
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment