我正在尝试模仿 SIEMENS S7 PLC,以便 Nmap、Zgrab 和 NESSUS 等扫描仪将我的 Raspberry 检测为 PLC。当查看 NSE 脚本 voor Nmap(基于 lua)时,很明显可以使用以下结构解码响应:
DATA DATA TYPE Location in response
Protocol ID C 8
SZL-ID C 31
Module information z 44
Basic Hardware z 72
Version Number CCC 123
Plant ID z 108 + offset
Copyright z 142 + offset
Serial Number z 176 + offset
System name z 40 + offset
Module Type z 74 + offset
Where: z is a zero-terminated string
C is an unsgined char
offset = 4
通过套接字连接建立与 PLC 的连接。现在我正在寻找一种方法来重新创建这个包并做出相应的响应。