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
54e2bc03
Commit
54e2bc03
authored
7 years ago
by
gpotter2
Browse files
Options
Downloads
Patches
Plain Diff
Add analyse data test to pnio_rtc
parent
ea91ebad
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scapy/contrib/pnio_rtc.uts
+19
-0
19 additions, 0 deletions
scapy/contrib/pnio_rtc.uts
with
19 additions
and
0 deletions
scapy/contrib/pnio_rtc.uts
+
19
−
0
View file @
54e2bc03
...
...
@@ -104,3 +104,22 @@ p == Ether(dst='00:01:02:03:04:05', src='06:07:08:09:0a:0b') / ProfinetIO(frameI
]
)
= PNIORealTime - Analyse data
# Possible thanks to https://github.com/ITI/ICS-Security-Tools/blob/master/pcaps/profinet/profinet.pcap
bind_layers(UDP, ProfinetIO, dport=0x8894)
bind_layers(UDP, ProfinetIO, sport=0x8894)
packets = [Ether('0090274ee3fc000991442017080045000128000c00004011648f0a0a00810a0a00968894061e011444c604022800100000000000a0de976cd111827100010003015a0100a0de976cd111827100a02442df7ddbabbaec1d005443b2500b01630abafd0100000001000000000000000500ffffffffbc000000000000000000a80000004080000000000000a80000008009003c0100000a0000000000000000000000000000000000000000000000010000f840000000680000000000000000000000000000000000000000000000000030002c0100000100000000000200000000000100020001000000010003ffff010a0001ffff814000010001ffff814000310018010000010000000000010001ffff814000010001ffff814000320018010000010000000000010000000000010001000100000001'.decode("hex")),
Ether('0009914420170090274ee3fc0800450000c0b28800008011727a0a0a00960a0a0081061e889400ac689504000800100000000000a0de976cd111827100010003015a0100a0de976cd111827100a02442df7ddbabbaec1d005443b2500b01630abafd0000000001000000000000000500ffffffff54000000000040800000400000004080000000000000400000000009003c0100000a0000000000000000000000000000000000000000000000010000f84000008000000000000000000000000000000000000000000000000000'.decode("hex"))]
analysed_data = PNIORealTime.analyse_data(packets)
assert len(analysed_data) == 2
x = analysed_data[('00:09:91:44:20:17', '00:90:27:4e:e3:fc')]
assert len(x) == 2
assert x[0][1] == PNIORealTimeRawData
assert x[0][0] == -262
assert x[0][2]["length"] == 87
ProfinetIO._overload_fields[UDP].pop("sport")
ProfinetIO._overload_fields[UDP]["dport"] = 0x8892
\ No newline at end of file
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