mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-24 12:11:52 +08:00
Add native protocol service plugins
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
//go:build plugin_bacnet || !plugin_selective
|
||||
|
||||
package services
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestParseBACnetResponse(t *testing.T) {
|
||||
banner, ok := parseBACnetResponse([]byte{0x81, 0x0a, 0x00, 0x08, 0x01, 0x20, 0x10, 0x00})
|
||||
if !ok || banner != "BACnet I-Am response" {
|
||||
t.Fatalf("unexpected bacnet banner: %q ok=%v", banner, ok)
|
||||
}
|
||||
|
||||
if _, ok := parseBACnetResponse([]byte{0x81, 0x0a, 0x00, 0x05, 0x00}); ok {
|
||||
t.Fatal("unexpected match for malformed bacnet packet")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user