From 6db2f85c0800932a13ee1b59432a1942378d5e5b Mon Sep 17 00:00:00 2001 From: CyberRoute Date: Sun, 19 Nov 2023 20:50:47 +0100 Subject: [PATCH] removing stuff that is not used and models.go --- cmd/bruter/routes.go | 4 ++-- pkg/handlers/handlers.go | 4 ++-- pkg/models/home.go | 23 ----------------------- pkg/models/templatedata.go | 21 --------------------- pkg/models/urldata.go | 13 ------------- 5 files changed, 4 insertions(+), 61 deletions(-) delete mode 100644 pkg/models/home.go delete mode 100644 pkg/models/templatedata.go delete mode 100644 pkg/models/urldata.go diff --git a/cmd/bruter/routes.go b/cmd/bruter/routes.go index f500dd8..4ab7318 100644 --- a/cmd/bruter/routes.go +++ b/cmd/bruter/routes.go @@ -111,11 +111,11 @@ func routes(app *config.AppConfig) http.Handler { Irc: irc, } - sslargs := models.HomeArgs{ + sslargs := models.TemplateData{ SSLInfo: sslinfo, } - whoisargs := models.HomeArgs{ + whoisargs := models.TemplateData{ WhoisInfo: whoisinfo, } diff --git a/pkg/handlers/handlers.go b/pkg/handlers/handlers.go index bb09fd4..d3388e2 100644 --- a/pkg/handlers/handlers.go +++ b/pkg/handlers/handlers.go @@ -66,7 +66,7 @@ func (m *Repository) Home(args models.HomeArgs) http.HandlerFunc { } } -func (m *Repository) SSLInfo(args models.HomeArgs) http.HandlerFunc { +func (m *Repository) SSLInfo(args models.TemplateData) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var templateData models.TemplateData sslInfo, err := ssl.FetchCrtData(m.App.Domain) @@ -76,7 +76,7 @@ func (m *Repository) SSLInfo(args models.HomeArgs) http.HandlerFunc { } } -func (m *Repository) WhoisInfo(args models.HomeArgs) http.HandlerFunc { +func (m *Repository) WhoisInfo(args models.TemplateData) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var templateData models.TemplateData whoisInfo, err := network.WhoisLookup(m.App.Domain) diff --git a/pkg/models/home.go b/pkg/models/home.go deleted file mode 100644 index d984722..0000000 --- a/pkg/models/home.go +++ /dev/null @@ -1,23 +0,0 @@ -package models - -import ( - "html/template" - - "github.com/CyberRoute/bruter/pkg/shodan" -) - -type HomeArgs struct { - Ipv4 string - Ipv6 string - Host shodan.Response - Headers map[string]interface{} - Mx map[string]uint16 - SSLInfo []map[string]interface{} - WhoisInfo template.HTML - Ftp string - Ssh string - Mysql string - Smtp string - Pop string - Irc string -} diff --git a/pkg/models/templatedata.go b/pkg/models/templatedata.go deleted file mode 100644 index 95dd350..0000000 --- a/pkg/models/templatedata.go +++ /dev/null @@ -1,21 +0,0 @@ -package models - -import ( - "html/template" -) - -// Template data holds data sent from handlers to templates -type TemplateData struct { - StringMap map[string]string - IntMap map[string]int - FloatMap map[string]float32 - Data map[string]interface{} - HeadersMap map[string]interface{} - FtpBannerGrabberMap map[string]interface{} - SSLInfo []map[string]interface{} - WhoisInfo template.HTML - CSRFToken string - Flash string - Warning string - Error string -} diff --git a/pkg/models/urldata.go b/pkg/models/urldata.go deleted file mode 100644 index ffe2441..0000000 --- a/pkg/models/urldata.go +++ /dev/null @@ -1,13 +0,0 @@ -package models - -type Url struct { - Id int `json:"id"` - Path string `json:"path"` - Status float64 `json:"status"` - Progress float32 `json:"progress"` - Data string `json:"data"` -} - -type AllUrls struct { - Urls []*Url -}