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
b2884fde
Commit
b2884fde
authored
8 years ago
by
Pierre Lalet
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #497 from guedou/codecov_7
[coverage] Dot11 tests
parents
67ee2f3b
a6589c9f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scapy/layers/dot11.py
+0
-29
0 additions, 29 deletions
scapy/layers/dot11.py
test/regression.uts
+39
-0
39 additions, 0 deletions
test/regression.uts
with
39 additions
and
29 deletions
scapy/layers/dot11.py
+
0
−
29
View file @
b2884fde
...
...
@@ -325,8 +325,6 @@ class Dot11WEP(Packet):
IntField
(
"
icv
"
,
None
)
]
def
post_dissect
(
self
,
s
):
# self.icv, = struct.unpack("!I",self.wepdata[-4:])
# self.wepdata = self.wepdata[:-4]
self
.
decrypt
()
def
build_payload
(
self
):
...
...
@@ -471,28 +469,6 @@ iwconfig wlan0 mode managed
sniff
(
iface
=
self
.
iffrom
,
**
self
.
optsniff
)
plst
=
[]
def
get_toDS
():
global
plst
while
1
:
p
,
=
sniff
(
iface
=
"
eth1
"
,
count
=
1
)
if
not
isinstance
(
p
,
Dot11
):
continue
if
p
.
FCfield
&
1
:
plst
.
append
(
p
)
print
"
.
"
# if not ifto.endswith("ap"):
# print "iwpriv %s hostapd 1" % ifto
# os.system("iwpriv %s hostapd 1" % ifto)
# ifto += "ap"
#
# os.system("iwconfig %s mode monitor" % iffrom)
#
@conf.commands.register
def
airpwn
(
iffrom
,
ifto
,
replace
,
pattern
=
""
,
ignorepattern
=
""
):
"""
Before using this, initialize
"
iffrom
"
and
"
ifto
"
interfaces:
iwconfig iffrom mode monitor
...
...
@@ -523,13 +499,10 @@ iwconfig wlan0 mode managed
ip
=
p
.
getlayer
(
IP
)
tcp
=
p
.
getlayer
(
TCP
)
pay
=
str
(
tcp
.
payload
)
# print "got tcp"
if
not
ptrn
.
match
(
pay
):
return
# print "match 1"
if
iptrn
.
match
(
pay
):
return
# print "match 2"
del
(
p
.
payload
.
payload
.
payload
)
p
.
FCfield
=
"
from-DS
"
p
.
addr1
,
p
.
addr2
=
p
.
addr2
,
p
.
addr1
...
...
@@ -545,8 +518,6 @@ iwconfig wlan0 mode managed
q
.
getlayer
(
TCP
).
seq
+=
len
(
replace
)
sendp
([
p
,
q
],
iface
=
ifto
,
verbose
=
0
)
# print "send",repr(p)
# print "send",repr(q)
print
p
.
sprintf
(
"
Sent %IP.src%:%IP.sport% > %IP.dst%:%TCP.dport%
"
)
sniff
(
iface
=
iffrom
,
prn
=
do_airpwn
)
...
...
This diff is collapsed.
Click to expand it.
test/regression.uts
+
39
−
0
View file @
b2884fde
...
...
@@ -7744,6 +7744,7 @@ SCTPChunkSACK in p and p[SCTP].chksum == 0x3b01d404 and p[SCTPChunkSACK].gap_ack
= SCTP - answers
(IP()/SCTP()).answers(IP()/SCTP()) == True
############
############
+ DHCP
...
...
@@ -7768,3 +7769,41 @@ s == 'E\x00\x01\x10\x00\x01\x00\x00@\x11{\xda\x7f\x00\x00\x01\x7f\x00\x00\x01\x0
= DHCP - dissection
p = IP(s)
DHCP in p and p[DHCP].options[0] == ('message-type', 1)
############
############
+ 802.11
= 802.11 - misc
PrismHeader().answers(PrismHeader()) == True
dpl = Dot11PacketList([Dot11()/LLC()/SNAP()/IP()/UDP()])
len(dpl) == 1
dpl_ether = dpl.toEthernet()
len(dpl_ether) == 1 and Ether in dpl_ether[0]
= Dot11 - build
s = str(Dot11())
s == '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
= Dot11 - dissection
p = Dot11(s)
Dot11 in p and p.addr3 == "00:00:00:00:00:00"
p.mysummary() == '802.11 Management 0L 00:00:00:00:00:00 > 00:00:00:00:00:00'
= Dot11QoS - build
s = str(Dot11(type=2, subtype=8)/Dot11QoS())
s == '\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
= Dot11QoS - dissection
p = Dot11(s)
Dot11QoS in p
= Dot11 - answers
query = Dot11(type=0, subtype=0)
Dot11(type=0, subtype=1).answers(query) == True
= Dot11 - misc
Dot11Elt(info="scapy").summary() == "SSID='scapy'"
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