From 7854ce96c4ca381d23a5d8e432f52f07aaa5855c Mon Sep 17 00:00:00 2001 From: zanbin168 Date: Fri, 9 Aug 2024 20:29:20 +0800 Subject: [PATCH] add version 3.1.1 --- pkg/config/banner.go | 2 +- pkg/web/template/Login.html | 14 ++++++++++++++ pkg/web/web.go | 24 ++++++++++++++++++++++++ pocs/v/afrog.version | 2 +- 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 pkg/web/template/Login.html diff --git a/pkg/config/banner.go b/pkg/config/banner.go index 5016f6c3..bba505a7 100644 --- a/pkg/config/banner.go +++ b/pkg/config/banner.go @@ -9,7 +9,7 @@ import ( "github.com/zan8in/gologger" ) -const Version = "3.1.0" +const Version = "3.1.1" func InitBanner() { fmt.Printf("\r\n|\tA F 🐸 O G\t|") diff --git a/pkg/web/template/Login.html b/pkg/web/template/Login.html new file mode 100644 index 00000000..ab6f155d --- /dev/null +++ b/pkg/web/template/Login.html @@ -0,0 +1,14 @@ + + + + + + + Login - Afrog A Security Tool for Bug Bounty, Pentest and Red Teaming. + + + + + + + \ No newline at end of file diff --git a/pkg/web/web.go b/pkg/web/web.go index 5c73e953..bb766279 100644 --- a/pkg/web/web.go +++ b/pkg/web/web.go @@ -20,6 +20,7 @@ func StartServer(addr string) error { return err } + http.HandleFunc("/login", loginHandler) http.HandleFunc("/", listHandler) http.Handle("/static/", http.FileServer(http.FS(temp))) @@ -30,6 +31,29 @@ func StartServer(addr string) error { } +type User struct { + Password string +} + +func loginHandler(w http.ResponseWriter, r *http.Request) { + password := r.PostFormValue("password") + if len(password) == 0 { + http.Error(w, "login failed", http.StatusBadRequest) + return + } + + tmpl, err := template.ParseFiles("template/Login.html") + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + err = tmpl.Execute(w, nil) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } +} + func listHandler(w http.ResponseWriter, r *http.Request) { // 获取查询参数 keyword := r.URL.Query().Get("keyword") diff --git a/pocs/v/afrog.version b/pocs/v/afrog.version index a0cd9f0c..50e47c89 100644 --- a/pocs/v/afrog.version +++ b/pocs/v/afrog.version @@ -1 +1 @@ -3.1.0 \ No newline at end of file +3.1.1 \ No newline at end of file