An open API service indexing awesome lists of open source software.

https://github.com/corazawaf/libinjection-go

libinjection is a Golang port of the libinjection(https://github.com/client9/libinjection)
https://github.com/corazawaf/libinjection-go

coraza-waf go golang libinjection owasp sql-injection waf xss

Last synced: about 1 year ago
JSON representation

libinjection is a Golang port of the libinjection(https://github.com/client9/libinjection)

Awesome Lists containing this project

README

          

# libinjection
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![codecov](https://codecov.io/gh/corazawaf/libinjection-go/branch/master/graph/badge.svg?token=RTCQXUDZQQ)](https://codecov.io/gh/corazawaf/libinjection-go)
[![CodeQL](https://github.com/corazawaf/libinjection-go/actions/workflows/codeql.yml/badge.svg)](https://github.com/corazawaf/libinjection-go/actions/workflows/codeql.yml)

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

## How to use
### SQLi Example
```go
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
```go
package main

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

func main() {
fmt.Println("result: ", libinjection.IsXSS("alert('1')"))
}
```

## License
libinjection-go is distributed under the same license as the [libinjection](http://www.client9.com/projects/libinjection/).