Skip to content

Commit

Permalink
style: apply python formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
developStorm committed May 22, 2024
1 parent d566825 commit 03c0a80
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 24 deletions.
2 changes: 1 addition & 1 deletion zgrab2_schemas/zgrab2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
from . import telnet
from . import ipp
from . import banner
from . import amqp091
from . import amqp091
57 changes: 34 additions & 23 deletions zgrab2_schemas/zgrab2/amqp091.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,44 @@
from . import zgrab2

# Schema for connectionTune struct
connection_tune = SubRecord({
"channel_max": Unsigned32BitInteger(),
"frame_max": Unsigned32BitInteger(),
"heartbeat": Unsigned32BitInteger(),
})
connection_tune = SubRecord(
{
"channel_max": Unsigned32BitInteger(),
"frame_max": Unsigned32BitInteger(),
"heartbeat": Unsigned32BitInteger(),
}
)

# Schema for knownServerProperties struct
known_server_properties = SubRecord({
"product": String(),
"version": String(),
"platform": String(),
"copyright": String(),
"information": String(),
"unknown_props": String(),
})
known_server_properties = SubRecord(
{
"product": String(),
"version": String(),
"platform": String(),
"copyright": String(),
"information": String(),
"unknown_props": String(),
}
)

# Schema for Result struct
result_schema = SubRecord({
"result": SubRecord ({ "failure": String(),
"version_major": Unsigned32BitInteger(),
"version_minor": Unsigned32BitInteger(),
"server_properties": known_server_properties,
"locales": ListOf(String()),
"auth_success": Boolean(),
"tune": connection_tune,
"tls": zgrab2.tls_log,
})}, extends=zgrab2.base_scan_response)
result_schema = SubRecord(
{
"result": SubRecord(
{
"failure": String(),
"version_major": Unsigned32BitInteger(),
"version_minor": Unsigned32BitInteger(),
"server_properties": known_server_properties,
"locales": ListOf(String()),
"auth_success": Boolean(),
"tune": connection_tune,
"tls": zgrab2.tls_log,
}
)
},
extends=zgrab2.base_scan_response,
)

zschema.registry.register_schema("zgrab2-amqp091", result_schema)
zgrab2.register_scan_response_type("amqp091", result_schema)

0 comments on commit 03c0a80

Please sign in to comment.