libinjection

package module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2024 License: BSD-3-Clause Imports: 2 Imported by: 6

README

libinjection

License codecov CodeQL

libinjection is a Go porting of the libinjection(http://www.client9.com/projects/libinjection/) and it's thread safe.

How to use

SQLi Example
package main

import (
    "fmt"
    "github.com/corazawaf/libinjection-go"
)

func main() {
    result, fingerprint := libinjection.IsSQLi("-1' and 1=1 union/* foo */select load_file('/etc/passwd')--")
    fmt.Println("=========result==========: ", result)
    fmt.Println("=======fingerprint=======: ", string(fingerprint))
}
XSS Example
package main

import (
	"fmt"
	"github.com/corazawaf/libinjection-go"
)

func main() {
	fmt.Println("result: ", libinjection.IsXSS("<script>alert('1')</script>"))
}

License

libinjection-go is distributed under the same license as the libinjection.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSQLi

func IsSQLi(input string) (bool, string)

IsSQLi returns true if the input is SQLi It also returns the fingerprint of the SQL Injection as []byte

func IsXSS

func IsXSS(input string) bool

IsXSS returns true if the input string contains XSS

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL