mirror of
https://gitee.com/samwaf/SamWaf.git
synced 2026-11-03 11:41:55 +08:00
26 lines
551 B
Go
26 lines
551 B
Go
package wafhttpcore
|
|
|
|
import (
|
|
"SamWaf/libinjection-go"
|
|
"net/url"
|
|
"testing"
|
|
)
|
|
|
|
func TestWafHttpCoreUrlEncode(t *testing.T) {
|
|
srcUrl := "1=1sion%28%29%2523"
|
|
t.Log(srcUrl)
|
|
en := WafHttpCoreUrlEncode(srcUrl, 100)
|
|
t.Log(en)
|
|
en2, ok := url.QueryUnescape(srcUrl)
|
|
if ok != nil {
|
|
t.Error(ok)
|
|
}
|
|
t.Log(en2)
|
|
srcCheckResult := libinjection.IsSQLiNotReturnPrint(srcUrl)
|
|
t.Log(srcCheckResult)
|
|
targetCheckResult := libinjection.IsSQLiNotReturnPrint(en)
|
|
t.Log(targetCheckResult)
|
|
targetCheckResult = libinjection.IsXSS(en)
|
|
t.Log(targetCheckResult)
|
|
}
|