Skip to content

Error with filter by Ip range #17

Description

@idan1109

First of all thank you for this beautiful package! I think i've found a problem when trying to set an ip range

	// Get the absolute path of the current program
	execPath := ""C:\\Windows\\system32\\cmd.exe""
	// Ask windows for the corresponding application ID
	appID, err := wf.AppID(execPath)
	if err != nil {
		println("Error Getting AppID:", err)
	}
	ruleGuid, _ := windows.GenerateGUID()
	iprange, err := netaddr.ParseIPRange("192.168.1.10-192.168.1.25")
	if err != nil {
		println("Error parsing IP:", err)
	}
	err = session.AddRule(&wf.Rule{
		ID:       wf.RuleID(ruleGuid),
		Name:     "My Rule",
		Layer:    wf.LayerALEAuthConnectV4,
		Sublayer: sublayerID,
		Weight:   900,
		Conditions: []*wf.Match{
			{
				Field: wf.FieldALEAppID,
				Op:    wf.MatchTypeEqual,
				Value: appID,
			},
			{
				Field: wf.FieldIPRemoteAddress,
				Op:    wf.MatchTypeRange,
				Value: iprange, // IP Range
			},
		},
		Action: wf.ActionBlock,
	})

Cannot add rule: (0x1bada0,0xc00032b120)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions