"permit_port_forwarding": String(), "permit_pty": String(), "permit_user_rc": String(), }), "unknown": ListOf(String()), }), "critical_options": SubRecord({ "known": SubRecord({ "force_command": String(), "source_address": String(), }), "unknown": ListOf(String()), }) }), }), }), "userauth": ListOf(String()), "crypto": zgrab2_ssh_kex_result }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-ssh", ssh_scan_response) zgrab2.register_scan_response_type('ssh', ssh_scan_response)
"parsed": SubRecord({ "capability_flags": SubRecord(mysql_capability_flags, required=True), "max_packet_size": DebugOnly(Unsigned32BitInteger()), "character_set": DebugOnly(Unsigned8BitInteger()), "reserved": DebugOnly(Binary()) }) }, extends=mysql_packet) # zgrab2/modules/mysql.go: MySQLScanResults mysql_scan_response = SubRecord( { "result": SubRecord({ "tls": zgrab2.tls_log, "handshake": mysql_handshake, "error": mysql_error, "ssl_request": mysql_ssl_request }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-mysql", mysql_scan_response) zgrab2.register_scan_response_type('mysql', mysql_scan_response)
# zschema sub-schema for zgrab2's bacnet module # Registers zgrab2-bacnet globally, and bacnet with the main zgrab2 schema. from zschema.leaves import * from zschema.compounds import * import zschema.registry import schemas.zcrypto as zcrypto import schemas.zgrab2 as zgrab2 bacnet_scan_response = SubRecord( { "result": SubRecord({ "is_bacnet": Boolean(), "instance_number": Unsigned32BitInteger(), "vendor_id": Unsigned16BitInteger(), "vendor_name": String(), "firmware_revision": String(), "application_software_revision": String(), "object_name": String(), "model_name": String(), "description": String(), "location": String(), }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-bacnet", bacnet_scan_response) zgrab2.register_scan_response_type("bacnet", bacnet_scan_response)
# zschema sub-schema for zgrab2's ftp module # Registers zgrab2-ftp globally, and ftp with the main zgrab2 schema. from zschema.leaves import * from zschema.compounds import * import zschema.registry import schemas.zcrypto as zcrypto import schemas.zgrab2 as zgrab2 # modules/ftp.go - FTPScanResults ftp_scan_response = SubRecord({ "result": SubRecord({ "tls": zgrab2.tls_log, "banner": String(), "auth_tls": String(), "auth_ssl": String(), }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-ftp", ftp_scan_response) zgrab2.register_scan_response_type("ftp", ftp_scan_response)
'server_guid': Binary(), 'capabilities': Unsigned32BitInteger(), 'system_time': Unsigned32BitInteger(), 'server_start_time': Unsigned32BitInteger(), 'authentication_types': ListOf(String()), })) session_setup_log = SubRecord( extended( header_log, { 'setup_flags': Unsigned16BitInteger(), 'target_name': String(), 'negotiate_flags': Unsigned32BitInteger(), })) smb_scan_response = SubRecord( { 'result': SubRecord({ 'smbv1_support': Boolean(), 'negotiation_log': negotiate_log, 'has_ntlm': Boolean(), 'session_setup_log': session_setup_log, }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema('zgrab2-smb', smb_scan_response) zgrab2.register_scan_response_type('smb', smb_scan_response)
}) # modules/postgres/scanner.go: BackendKeyData postgres_key_data = SubRecord({ "process_id": Unsigned32BitInteger(), "secret_key": Unsigned32BitInteger(), }) # modules/postgres/scanner.go: PostgresResults postgres_scan_response = SubRecord( { "result": SubRecord({ "tls": zgrab2.tls_log, "supported_versions": String(), "protocol_error": postgres_error, "startup_error": postgres_error, "is_ssl": Boolean(required=True), "authentication_mode": postgres_auth_mode, # TODO FIXME: This is currendly an unconstrained map[string]string "server_parameters": String(), "backend_key_data": postgres_key_data, "transaction_status": String(), }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-postgres", postgres_scan_response) zgrab2.register_scan_response_type("postgres", postgres_scan_response)
String(), "thread_id": Unsigned32BitInteger(), "mars": Unsigned8BitInteger(), "trace_id": Binary(), "fed_auth_required": Unsigned8BitInteger(), "nonce": Binary(), "unknown": ListOf(unknown_prelogin_option), }) mssql_scan_response = SubRecord( { "result": SubRecord({ "version": String(), "instance_name": String(), "prelogin_options": prelogin_options, "tls": zgrab2.tls_log, }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-mssql", mssql_scan_response) zgrab2.register_scan_response_type("mssql", mssql_scan_response)
# zschema sub-schema for zgrab2's smtp module # Registers zgrab2-smtp globally, and smtp with the main zgrab2 schema. from zschema.leaves import * from zschema.compounds import * import zschema.registry import schemas.zcrypto as zcrypto import schemas.zgrab2 as zgrab2 smtp_scan_response = SubRecord( { "result": SubRecord({ "banner": String(), "ehlo": String(), "helo": String(), "help": String(), "starttls": String(), "quit": String(), "tls": zgrab2.tls_log, }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-smtp", smtp_scan_response) zgrab2.register_scan_response_type("smtp", smtp_scan_response)
import schemas.zcrypto as zcrypto import schemas.zgrab2 as zgrab2 fox_scan_response = SubRecord({ 'result': SubRecord({ 'is_fox': Boolean(), 'version': String(), 'id': Unsigned32BitInteger(), 'hostname': String(), 'host_address': String(), 'app_name': String(), 'app_version': String(), 'vm_name': String(), 'vm_version': String(), 'os_name': String(), 'os_version': String(), 'station_name': String(), 'language': String(), 'time_zone': String(), 'host_id': String(), 'vm_uuid': String(), 'brand_id': String(), 'sys_info': String(), 'agent_auth_type': String(), }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema('zgrab2-fox', fox_scan_response) zgrab2.register_scan_response_type('fox', fox_scan_response)
'conformity_level': Unsigned8BitInteger(), 'more_follows': Boolean(), 'next_object_id': Unsigned8BitInteger(), 'object_count': Unsigned8BitInteger(), 'objects': mei_object_set, }) exception_response = SubRecord({ 'exception_function': Unsigned8BitInteger(), 'exception_type': Unsigned8BitInteger(), }) modbus_scan_response = SubRecord( { 'result': SubRecord({ 'length': Unsigned16BitInteger(), 'unit_id': Unsigned8BitInteger(), 'function_code': Unsigned8BitInteger(), 'raw_response': Binary(), 'mei_response': mei_response, 'exception_response': exception_response, 'raw': Binary(), }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema('zgrab2-modbus', modbus_scan_response) zgrab2.register_scan_response_type('modbus', modbus_scan_response)
# zschema sub-schema for zgrab2's dnp3 module # Registers zgrab2-dnp3 globally, and dnp3 with the main zgrab2 schema. from zschema.leaves import * from zschema.compounds import * import zschema.registry import schemas.zcrypto as zcrypto import schemas.zgrab2 as zgrab2 dnp3_scan_response = SubRecord( {"result": SubRecord({ "is_dnp3": Boolean(), "raw_response": Binary(), })}, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-dnp3", dnp3_scan_response) zgrab2.register_scan_response_type("dnp3", dnp3_scan_response)
Boolean(), "redirect_target_raw": String(), "redirect_target": parsed_descriptor, "refuse_error_raw": String(), "refuse_error": parsed_descriptor, "refuse_version": String(), "refuse_reason_app": String(), "refuse_reason_sys": String(), "nsn_version": String(), "nsn_service_versions": SubRecord({service: String() for service in nsn_services}), }), "tls": zgrab2.tls_log, }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-oracle", oracle_scan_response) zgrab2.register_scan_response_type("oracle", oracle_scan_response)
# zschema sub-schema for zgrab2's telnet module # Registers zgrab2-telnet globally, and telnet with the main zgrab2 schema. from zschema.leaves import * from zschema.compounds import * import zschema.registry import schemas.zcrypto as zcrypto import schemas.zgrab2 as zgrab2 telnet_option = SubRecord({ "name": String(), "value": Unsigned16BitInteger(), }) telnet_scan_response = SubRecord( { "result": SubRecord({ "banner": String(), "will": ListOf(telnet_option), "do": ListOf(telnet_option), "wont": ListOf(telnet_option), "dont": ListOf(telnet_option), }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-telnet", telnet_scan_response) zgrab2.register_scan_response_type("telnet", telnet_scan_response)
from zschema.leaves import * from zschema.compounds import * import zschema.registry import schemas.zcrypto as zcrypto import schemas.zgrab2 as zgrab2 siemens_scan_response = SubRecord({ 'result': SubRecord({ 'is_s7': Boolean(), 'system': String(), 'module': String(), 'plant_id': String(), 'copyright': String(), 'serial_number': String(), 'module_type': String(), 'reserved_for_os': String(), 'memory_serial_number': String(), 'cpu_profile': String(), 'oem_id': String(), 'location': String(), 'module_id': String(), 'hardware': String(), 'firmware': String(), }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema('zgrab2-siemens', siemens_scan_response) zgrab2.register_scan_response_type('siemens', siemens_scan_response)
# zschema sub-schema for zgrab2's pop3 module # Registers zgrab2-pop3 globally, and pop3 with the main zgrab2 schema. from zschema.leaves import * from zschema.compounds import * import zschema.registry import schemas.zcrypto as zcrypto import schemas.zgrab2 as zgrab2 pop3_scan_response = SubRecord( { "result": SubRecord({ "banner": String(), "noop": String(), "help": String(), "starttls": String(), "quit": String(), "tls": zgrab2.tls_log, }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-pop3", pop3_scan_response) zgrab2.register_scan_response_type("pop3", pop3_scan_response)
"body": String(), "body_sha256": Binary(), "content_length": Signed64BitInteger(), "transfer_encoding": ListOf(String()), "trailers": http_headers, "request": http_request_full }) # modules/http.go: HTTPResults http_scan_response = SubRecord( { "result": SubRecord({ "connect_request": http_request, "connect_response": http_response, "response": http_response_full, "redirect_response_chain": ListOf(http_response_full), }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-http", http_scan_response) zgrab2.register_scan_response_type("http", http_scan_response)
# zschema sub-schema for zgrab2's redis module # Registers zgrab2-redis globally, and redis with the main zgrab2 schema. from zschema.leaves import * from zschema.compounds import * import zschema.registry import schemas.zcrypto as zcrypto import schemas.zgrab2 as zgrab2 redis_scan_response = SubRecord( { "result": SubRecord({ "commands": ListOf(String()), "raw_command_output": ListOf(Binary()), "ping_response": String(), "info_response": String(), "auth_response": String(), "nonexistent_response": String(), "quit_response": String(), "version": String(), }) }, extends=zgrab2.base_scan_response) zschema.registry.register_schema("zgrab2-redis", redis_scan_response) zgrab2.register_scan_response_type("redis", redis_scan_response)