Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Asset_Discovery
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yogesh.m
Asset_Discovery
Commits
59f2239d
You need to sign in or sign up before continuing.
Commit
59f2239d
authored
Aug 21, 2023
by
Dipti mishra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created codesys protocol
parent
179a2e62
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
3 deletions
+15
-3
assets.json
assets.json
+1
-1
db.sqlite3
db.sqlite3
+0
-0
helpers/Packet_Analyzer.py
helpers/Packet_Analyzer.py
+2
-2
protocol_actions.py
protocol_actions.py
+12
-0
No files found.
assets.json
View file @
59f2239d
This diff is collapsed.
Click to expand it.
db.sqlite3
View file @
59f2239d
No preview for this file type
helpers/Packet_Analyzer.py
View file @
59f2239d
import
binascii
import
json
from
protocol_discover_helpers
import
modbus_discover
,
enip_discover
,
s7_discover
,
omron_discover
,
bacnet_discover
from
protocol_discover_helpers
import
modbus_discover
,
enip_discover
,
s7_discover
,
omron_discover
,
bacnet_discover
,
codesys_discover
class
Packet_Analyzer
():
def
__init__
(
self
):
self
.
data
=
None
self
.
protocol_list
=
{
502
:
modbus_discover
,
44818
:
enip_discover
,
102
:
s7_discover
,
9600
:
omron_discover
,
47808
:
bacnet_discover
}
self
.
protocol_list
=
{
502
:
modbus_discover
,
44818
:
enip_discover
,
102
:
s7_discover
,
9600
:
omron_discover
,
47808
:
bacnet_discover
,
2455
:
codesys_discover
}
def
identify_protocol
(
self
,
hex_pkt
):
protocols
=
""
...
...
protocol_actions.py
View file @
59f2239d
...
...
@@ -2,6 +2,7 @@ from protocol_enumerators import ethernetip_enum as eip
from
protocol_enumerators
import
s7_enum
as
s7
from
protocol_enumerators
import
bacnet
as
bac
from
protocol_enumerators
import
modbus
from
protocol_enumerators
import
codesys
from
helpers.port_service_helper
import
psdata
from
protocol_enumerators
import
omron
import
binascii
...
...
@@ -42,6 +43,12 @@ def analyse_protocol(protocols,pkt):
vendor
=
res
[
'vendorid'
]
firmware
=
res
[
'firmware'
]
model
=
res
[
'model'
]
elif
(
"codesys"
in
protocols
):
res
=
codesys
.
get_info
(
eip
.
get_info
(
pa
.
get_ip
(
inhex
),
int
(
pa
.
get_tcp_port
(
inhex
))
if
"tcp"
in
protocols
else
int
(
pa
.
get_udp_port
(
inhex
))))
if
(
res
):
dev_type
=
res
[
'OS Name'
]
vendor
=
res
[
'Product Type'
]
elif
(
"modbus"
in
protocols
):
res
=
modbus
.
get_info
(
eip
.
get_info
(
pa
.
get_ip
(
inhex
),
int
(
pa
.
get_tcp_port
(
inhex
))
if
"tcp"
in
protocols
else
int
(
pa
.
get_udp_port
(
inhex
))),
False
)
...
...
@@ -99,6 +106,11 @@ def update_protocol(protocols,pkt):
vendor
=
res
[
'vendorid'
]
firmware
=
res
[
'firmware'
]
model
=
res
[
'model'
]
elif
(
"codesys"
in
protocols
):
res
=
codesys
.
get_info
(
pa
.
get_ip
(
inhex
)
,
int
(
pa
.
get_tcp_port
(
inhex
))
if
"tcp"
in
protocols
else
int
(
pa
.
get_udp_port
(
inhex
)))
if
(
res
):
dev_type
=
res
[
'OS Name'
]
vendor
=
res
[
'Product Type'
]
elif
(
"modbus"
in
protocols
):
res
=
modbus
.
get_info
(
pa
.
get_ip
(
inhex
)
,
int
(
pa
.
get_tcp_port
(
inhex
))
if
"tcp"
in
protocols
else
int
(
pa
.
get_udp_port
(
inhex
)),
False
)
if
(
res
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment