yellow~ opinionated web scanning pipeline for pentesters in a hurry |
| git clone https://github.com/djnnvx/yellow.git |
| log | files | refs | archive | README | LICENSE |
katana_test.go (800B)
1 package scan 2 3 import ( 4 "testing" 5 6 "github.com/projectdiscovery/katana/pkg/utils/scope" 7 ) 8 9 func TestInScope(t *testing.T) { 10 scoper, err := scope.NewManager(nil, nil, katanaFieldScope, false) 11 if err != nil { 12 t.Fatal(err) 13 } 14 15 cases := map[string]bool{ 16 "https://djnn.sh/": true, 17 "https://evil.djnn.sh/a/b": true, 18 "https://services.djnn.sh/x": true, 19 "https://github.com/djnnvx": false, 20 "https://cdnjs.cloudflare.com/ajax/libs/x.js": false, 21 "https://www.youtube.com/watch?v=1": false, 22 "::::not a url": false, 23 } 24 25 for raw, want := range cases { 26 if got := inScope(scoper, raw, "djnn.sh"); got != want { 27 t.Errorf("%s: got %v, want %v", raw, got, want) 28 } 29 } 30 }