diff --git a/README.md b/README.md index 616a9d3..14e8296 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ What does it do? # Usage ``` Usage of /tmp/go-build2863756334/b001/exe/main: + -address string IP address to bind the web ui server to. (default "127.0.0.1") -dictionary string diff --git a/cmd/bruter/main.go b/cmd/bruter/main.go index 7bfa683..bee2bf9 100644 --- a/cmd/bruter/main.go +++ b/cmd/bruter/main.go @@ -3,6 +3,7 @@ package main import ( "flag" "fmt" + "math" "net/http" "os" "strings" @@ -116,12 +117,13 @@ func main() { }) for index, payload := range list { - index += shift + modifiedIndex := index + shift // Replace %EXT% with extensions payload = strings.ReplaceAll(payload, "%EXT%", "js") - progress := 100 * float32(index) / float32(total) + progress := 100 * float32(modifiedIndex) / float32(total) + progress = float32(math.Round(float64(progress))) // Round the progress to the nearest integer queue.Add(async.Job(&workerContext{ Mu: &app.Mu, Domain: *Domain, diff --git a/cmd/bruter/routes.go b/cmd/bruter/routes.go index 8cfa38e..a0534ac 100644 --- a/cmd/bruter/routes.go +++ b/cmd/bruter/routes.go @@ -8,6 +8,7 @@ import ( "github.com/CyberRoute/bruter/pkg/models" "github.com/CyberRoute/bruter/pkg/network" "github.com/CyberRoute/bruter/pkg/shodan" + "github.com/CyberRoute/bruter/pkg/ssl" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" "github.com/rs/zerolog/log" @@ -53,6 +54,8 @@ func routes(app *config.AppConfig) http.Handler { checkError(err) irc, err := grabber.GrabIRCBanner(app.Domain, hostinfo.Ports) checkError(err) + sslinfo, err := ssl.FetchCrtData(app.Domain) + checkError(err) homeargs := models.HomeArgs{ Ipv4: ipv4, Ipv6: ipv6, @@ -66,7 +69,11 @@ func routes(app *config.AppConfig) http.Handler { Pop: pop, Irc: irc, } + sslargs := models.HomeArgs{ + SSLInfo: sslinfo, + } mux.Get("/", handlers.Repo.Home(homeargs)) + mux.Get("/ssl", handlers.Repo.SSLInfo(sslargs)) mux.Get("/consumer", handlers.Repo.Consumer) fileServer := http.FileServer(http.Dir("./static/")) mux.Handle("/static/*", http.StripPrefix("/static", fileServer)) diff --git a/db/dict_short.txt b/db/dict_short.txt index 49b8c27..54216d9 100644 --- a/db/dict_short.txt +++ b/db/dict_short.txt @@ -113,4 +113,9 @@ /.cask /.catalog /.cc-ban.txt -/.cc-ban.txt.bak \ No newline at end of file +/.cc-ban.txt.bak +/%EXT%.7z +/%EXT%.backup +/%EXT%.bak +/%EXT%.cgi +/%EXT%.conf \ No newline at end of file diff --git a/pkg/fuzzer/fuzzer.go b/pkg/fuzzer/fuzzer.go index de7c603..6832e62 100644 --- a/pkg/fuzzer/fuzzer.go +++ b/pkg/fuzzer/fuzzer.go @@ -9,6 +9,7 @@ import ( "net/http" "net/url" "os" + "sort" "sync" "github.com/CyberRoute/bruter/pkg/models" @@ -107,6 +108,12 @@ func readUrlsFromFile(filename string) (models.AllUrls, error) { } func writeUrlsToFile(filename string, allUrls models.AllUrls) error { + // Sort the URLs based on the Progress field in ascending order + sort.Slice(allUrls.Urls, func(i, j int) bool { + return allUrls.Urls[i].Progress < allUrls.Urls[j].Progress + }) + + // Marshal and write the sorted URLs to the file newUserBytes, err := json.MarshalIndent(allUrls.Urls, "", " ") if err != nil { return err diff --git a/pkg/handlers/handlers.go b/pkg/handlers/handlers.go index c3f80a6..5d079ad 100644 --- a/pkg/handlers/handlers.go +++ b/pkg/handlers/handlers.go @@ -11,6 +11,7 @@ import ( "github.com/CyberRoute/bruter/pkg/config" "github.com/CyberRoute/bruter/pkg/models" "github.com/CyberRoute/bruter/pkg/render" + "github.com/CyberRoute/bruter/pkg/ssl" "github.com/rs/zerolog" "github.com/rs/zerolog/log" ) @@ -67,6 +68,16 @@ func (m *Repository) Home(args models.HomeArgs) http.HandlerFunc { } } +func (m *Repository) SSLInfo(args models.HomeArgs) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + sslinfo, err := ssl.FetchCrtData(m.App.Domain) + checkError(err) + render.RenderTemplate(w, "ssl.page.html", &models.TemplateData{ + SSLInfo: sslinfo, + }) + } +} + func (m *Repository) Consumer(w http.ResponseWriter, r *http.Request) { // acquire lock m.App.Mu.Lock() diff --git a/pkg/models/home.go b/pkg/models/home.go index 6f86337..d5a0aab 100644 --- a/pkg/models/home.go +++ b/pkg/models/home.go @@ -1,6 +1,8 @@ package models -import "github.com/CyberRoute/bruter/pkg/shodan" +import ( + "github.com/CyberRoute/bruter/pkg/shodan" +) type HomeArgs struct { Ipv4 string @@ -8,6 +10,7 @@ type HomeArgs struct { Host shodan.Response Headers map[string]interface{} Mx map[string]uint16 + SSLInfo []map[string]interface{} Ftp string Ssh string Mysql string diff --git a/pkg/models/templatedata.go b/pkg/models/templatedata.go index 2b2cb77..6108f40 100644 --- a/pkg/models/templatedata.go +++ b/pkg/models/templatedata.go @@ -8,6 +8,7 @@ type TemplateData struct { Data map[string]interface{} HeadersMap map[string]interface{} FtpBannerGrabberMap map[string]interface{} + SSLInfo []map[string]interface{} CSRFToken string Flash string Warning string diff --git a/pkg/ssl/crt.go b/pkg/ssl/crt.go index e0f8392..ea6ebbe 100644 --- a/pkg/ssl/crt.go +++ b/pkg/ssl/crt.go @@ -20,6 +20,5 @@ func FetchCrtData(domain string) ([]map[string]interface{}, error) { if err != nil { return nil, err } - return data, nil } diff --git a/templates/base.layout.html b/templates/base.layout.html index 2eb9b53..0c566e9 100644 --- a/templates/base.layout.html +++ b/templates/base.layout.html @@ -27,13 +27,16 @@