Skip to content

Commit

Permalink
addressing issue #28
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberRoute committed Nov 23, 2023
1 parent a0da165 commit eee232a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
19 changes: 13 additions & 6 deletions cmd/bruter/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package main

import (
"crypto/tls"
"fmt"
"html/template"
"net/http"

"github.com/CyberRoute/bruter/pkg/config"
"github.com/CyberRoute/bruter/pkg/grabber"
"github.com/CyberRoute/bruter/pkg/handlers"
Expand All @@ -11,8 +15,6 @@ import (
"github.com/CyberRoute/bruter/pkg/ssl"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"html/template"
"net/http"
)

func checkError(err error) {
Expand Down Expand Up @@ -51,6 +53,7 @@ func routes(app *config.AppConfig) http.Handler {
sslinfo []map[string]interface{}
)

// Step 1: Execute functions that don't depend on hostinfo.Ports
RunConcurrently(
func() {
hostinfo, err = sh.HostInfo(app)
Expand All @@ -68,6 +71,14 @@ func routes(app *config.AppConfig) http.Handler {
whoisinfo, err = network.WhoisLookup(app.Domain)
checkError(err)
},
func() {
sslinfo, err = ssl.FetchCrtData(app.Domain)
checkError(err)
},
)

// Step 2: Execute functions that depend on hostinfo.Ports
RunConcurrently(
func() {
mysql, err = grabber.GrabMysqlBanner(app.Domain, hostinfo.Ports)
checkError(err)
Expand All @@ -92,10 +103,6 @@ func routes(app *config.AppConfig) http.Handler {
irc, err = grabber.GrabIRCBanner(app.Domain, hostinfo.Ports)
checkError(err)
},
func() {
sslinfo, err = ssl.FetchCrtData(app.Domain)
checkError(err)
},
)
homeargs := models.HomeArgs{
Ipv4: ipv4,
Expand Down
1 change: 0 additions & 1 deletion pkg/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func Get(Mu *sync.Mutex, app *config.AppConfig, domain, path string, progress fl
if resp != nil && resp.StatusCode == http.StatusMovedPermanently || resp.StatusCode == http.StatusFound { //status codes 301 302
// Add the RedirectPath field to the payload
redirectPath := resp.Header.Get("Location")
fmt.Println(redirectPath)
payload := &models.Url{Path: urjoin, Progress: progress, Status: float64(resp.StatusCode), RedirectPath: redirectPath}
payloadBuf := new(bytes.Buffer)
err = json.NewEncoder(payloadBuf).Encode(payload)
Expand Down

0 comments on commit eee232a

Please sign in to comment.