forked from 0c34/govwa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.go
84 lines (67 loc) · 2.5 KB
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package main
import (
"fmt"
"net/http"
"github.com/julienschmidt/httprouter"
"github.com/govwa/setting"
"github.com/govwa/setup"
"github.com/govwa/user"
"github.com/govwa/util"
"github.com/govwa/util/config"
"github.com/govwa/util/middleware"
"github.com/govwa/vulnerability/csa"
"github.com/govwa/vulnerability/idor"
"github.com/govwa/vulnerability/sqli"
"github.com/govwa/vulnerability/xss"
)
const (
banner = `
ÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛÛÛÛÛ
ÛÛÛ°°°°°ÛÛÛ °°ÛÛÛ °°ÛÛÛ °°ÛÛÛ °ÛÛÛ °°ÛÛÛ ÛÛÛ°°°°°ÛÛÛ
ÛÛÛ °°° ÛÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
°ÛÛÛ ÛÛÛ°°ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛÛÛÛÛÛÛÛÛ
°ÛÛÛ ÛÛÛÛÛ°ÛÛÛ °ÛÛÛ °°ÛÛÛ ÛÛÛ °°ÛÛÛ ÛÛÛÛÛ ÛÛÛ °ÛÛÛ°°°°°ÛÛÛ
°°ÛÛÛ °°ÛÛÛ °ÛÛÛ °ÛÛÛ °°°ÛÛÛÛÛ° °°°ÛÛÛÛÛ°ÛÛÛÛÛ° °ÛÛÛ °ÛÛÛ
°°ÛÛÛÛÛÛÛÛÛ °°ÛÛÛÛÛÛ °°ÛÛÛ °°ÛÛÛ °°ÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ
°°°°°°°°° °°°°°° °°° °°° °°° °°°°° °°°°° `
)
//index and set cookie
func indexHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
util.SetCookieLevel(w, r, "low") //set cookie Level default to low
data := make(map[string]interface{})
data["title"] = "Index"
util.SafeRender(w, r, "template.index", data)
}
func main() {
fmt.Println(banner)
mw := middleware.New()
router := httprouter.New()
user := user.New()
sqlI := sqli.New()
xss := xss.New()
idor := idor.New()
csa := csa.New()
setup := setup.New()
setting := setting.New()
router.ServeFiles("/public/*filepath", http.Dir("public/"))
router.GET("/", mw.LoggingMiddleware(mw.AuthCheck(indexHandler)))
router.GET("/index", mw.LoggingMiddleware(mw.DetectSQLMap(mw.AuthCheck(indexHandler))))
user.SetRouter(router)
sqlI.SetRouter(router)
xss.SetRouter(router)
idor.SetRouter(router)
csa.SetRouter(router)
setup.SetRouter(router)
setting.SetRouter(router)
s := http.Server{
Addr: ":8888",
Handler: router,
}
fmt.Printf("Server running at port %s\n", s.Addr)
fmt.Printf("Open this url %s on your browser to access GoVWA", config.Fullurl)
fmt.Println("")
err := s.ListenAndServe()
if err != nil {
panic(err)
}
}