Skip to content
/ fofacel Public

一个Fofa语法的表达式解析库,用于检测关键字是否满足满足Fofa表达式

Notifications You must be signed in to change notification settings

lcvvvv/fofacel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fofacel

一个Fofa语法的表达式解析库,用于检测关键字是否满足满足Fofa表达式

示例

package main

import (
	"fmt"
	"github.com/lcvvvv/fofacel"
)

func main() {
	engine := fofacel.New("body","title")
	
	
	rule, err := engine.NewRule(`body="aaaaa" && title="aaaaaa"`)
	if err != nil {
		panic(err)
	}

	fmt.Println(rule.Match(engine.NewKeywords(map[string]string{
		"body":  "aaaaaaaaaaaaaaaa",
		"title": "aaaaaaaaaaaaaa",
	})))
	//true

	fmt.Println(rule.Match(engine.NewKeywords(map[string]string{
		"body":  "bbbbbbbbbbbbb",
		"title": "aaaaaaaaaaaaaa",
	})))
	//false
}

About

一个Fofa语法的表达式解析库,用于检测关键字是否满足满足Fofa表达式

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages