Skip to content

Commit

Permalink
Merge pull request #119 from x90skysn3k/revert-114-revert-112-dev
Browse files Browse the repository at this point in the history
Revert "Revert "upgrade to v2.2.3""
  • Loading branch information
x90skysn3k authored Jun 10, 2024
2 parents 61df36f + 92213ba commit 4efb5f3
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
go-version: "stable"

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: latest

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
go-version: "stable"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5.0.0
uses: goreleaser/goreleaser-action@v6.0.0
with:
distribution: goreleaser
version: latest
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BruteSpray

![Version](https://img.shields.io/badge/Version-2.2.2-red)[![goreleaser](https://github.com/x90skysn3k/brutespray/actions/workflows/release.yml/badge.svg)](https://github.com/x90skysn3k/brutespray/actions/workflows/release.yml)[![Go Report Card](https://goreportcard.com/badge/github.com/x90skysn3k/brutespray)](https://goreportcard.com/report/github.com/x90skysn3k/brutespray)
![Version](https://img.shields.io/badge/Version-2.2.3-red)[![goreleaser](https://github.com/x90skysn3k/brutespray/actions/workflows/release.yml/badge.svg)](https://github.com/x90skysn3k/brutespray/actions/workflows/release.yml)[![Go Report Card](https://goreportcard.com/badge/github.com/x90skysn3k/brutespray)](https://goreportcard.com/report/github.com/x90skysn3k/brutespray)

Created by: Shane Young/@t1d3nio && Jacob Robles/@shellfail

Expand Down Expand Up @@ -91,12 +91,14 @@ Command: ```brutespray -H ssh://127.0.0.1 -C root:root```
* teamspeak
* oracle
* xmpp
* rdp

# Services in Beta
* asterisk
* nntp
* oracle
* xmpp
* rdp (currently local domain is supported)

Feel free to open an issue if these work, or if you have any issues

Expand Down
150 changes: 44 additions & 106 deletions brute/rdp.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,9 @@ package brute

import (
"fmt"
"time"
)

func BruteRDP(host string, port int, user, password string, timeout time.Duration) (bool, bool) {
fmt.Println("not needed")
return false, false
}

/*
package brute
import (
"context"
"fmt"
"io"
"log"
"net"
"os"
"time"

"github.com/tomatome/grdp/core"
Expand All @@ -32,105 +18,57 @@ import (
)

func BruteRDP(host string, port int, user, password string, timeout time.Duration) (bool, bool) {
domain := ".\\"
width := 600
height := 600
target := fmt.Sprintf("%s:%d", host, port)
glog.SetLevel(glog.INFO)
logger := log.New(os.Stdout, "", 0)
glog.SetLevel(pdu.STREAM_LOW)
logger := log.New(io.Discard, "", 0)
glog.SetLogger(logger)
client := NewRdpClient(target, width, height, glog.INFO, user, password, domain)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
type result struct {
success bool
err error
}
done := make(chan result)
go func() {
err := client.Login()
success := err == nil
done <- result{success, err}
client.Close()
}()
select {
case <-ctx.Done():
return false, false
case res := <-done:
if res.err != nil {
return false, true
}
return true, true
}
}
type RdpClient struct {
Host string // ip:port
Width int
Height int
user string
password string
domain string
tpkt *tpkt.TPKT
x224 *x224.X224
mcs *t125.MCSClient
sec *sec.Client
pdu *pdu.Client
}
func NewRdpClient(host string, width, height int, logLevel glog.LEVEL, user, password, domain string) *RdpClient {
return &RdpClient{
Host: host,
Width: width,
Height: height,
user: user,
password: password,
domain: domain,
}
}
func (g *RdpClient) Login() error {
conn, err := net.DialTimeout("tcp", g.Host, 3*time.Second)
conn, err := net.DialTimeout("tcp", fmt.Sprintf("%s:%d", host, port), timeout)
if err != nil {
return fmt.Errorf("[dial err] %v", err)
glog.Errorf("[dial err] %v", err)
return false, false
}
defer conn.Close()
glog.Info(conn.LocalAddr().String())

g.tpkt = tpkt.New(core.NewSocketLayer(conn), nla.NewNTLMv2(g.domain, g.user, g.password))
g.x224 = x224.New(g.tpkt)
g.mcs = t125.NewMCSClient(g.x224)
g.sec = sec.NewClient(g.mcs)
g.pdu = pdu.NewClient(g.sec)
tpkt := tpkt.New(core.NewSocketLayer(conn), nla.NewNTLMv2("", user, password))
x224 := x224.New(tpkt)
mcs := t125.NewMCSClient(x224)
sec := sec.NewClient(mcs)
pdu := pdu.NewClient(sec)

//g.mcs.SetClientDesktop(uint16(g.Width), uint16(g.Height))
g.sec.SetUser(g.user)
g.sec.SetPwd(g.password)
g.sec.SetDomain(g.domain)
sec.SetUser(user)
sec.SetPwd(password)

g.tpkt.SetFastPathListener(g.sec)
g.sec.SetFastPathListener(g.pdu)
g.sec.SetChannelSender(g.mcs)
tpkt.SetFastPathListener(sec)
sec.SetFastPathListener(pdu)
pdu.SetFastPathSender(tpkt)

g.x224.SetRequestedProtocol(x224.PROTOCOL_SSL)
success := make(chan bool, 1)

err = g.x224.Connect()
if err != nil {
return fmt.Errorf("[x224 connect err] %v", err)
}
return nil
}
go func() {
err := x224.Connect()
if err != nil {
glog.Errorf("[x224 connect err] %v", err)
success <- false
}
}()

func (g *RdpClient) Close() {
if g != nil && g.tpkt != nil {
g.tpkt.Close()
}
pdu.On("error", func(e error) {
glog.Error("error", e)
success <- false
})
pdu.On("close", func() {
glog.Info("on close")
success <- false
})
pdu.On("ready", func() {
glog.Info("on ready")
success <- true
})
pdu.On("success", func() {
glog.Info("on success")
success <- true
})

result := <-success
return result, true
}
*/
4 changes: 2 additions & 2 deletions brute/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func RunBrute(h modules.Host, u string, p string, progressCh chan<- int, timeout
result, con_result = BruteTeamSpeak(h.Host, h.Port, u, p, timeout)
case "xmpp":
result, con_result = BruteXMPP(h.Host, h.Port, u, p, timeout)
//case "rdp":
// result, con_result = BruteRDP(h.Host, h.Port, u, p, timeout)
case "rdp":
result, con_result = BruteRDP(h.Host, h.Port, u, p, timeout)
default:
//fmt.Printf("Unsupported service: %s\n", h.Service)
return con_result
Expand Down
6 changes: 3 additions & 3 deletions brutespray/brutespray.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
"github.com/x90skysn3k/brutespray/modules"
)

var masterServiceList = []string{"ssh", "ftp", "smtp", "mssql", "telnet", "smbnt", "postgres", "imap", "pop3", "snmp", "mysql", "vmauthd", "asterisk", "vnc", "mongodb", "nntp", "oracle", "teamspeak", "xmpp"}
var masterServiceList = []string{"ssh", "ftp", "smtp", "mssql", "telnet", "smbnt", "postgres", "imap", "pop3", "snmp", "mysql", "vmauthd", "asterisk", "vnc", "mongodb", "nntp", "oracle", "teamspeak", "xmpp", "rdp"}

var BetaServiceList = []string{"asterisk", "nntp", "oracle", "xmpp"}
var BetaServiceList = []string{"asterisk", "nntp", "oracle", "xmpp", "rdp"}

var version = "v2.2.2"
var version = "v2.2.3"

func Execute() {
user := flag.String("u", "", "Username or user list to bruteforce")
Expand Down
19 changes: 11 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.4

require (
github.com/emersion/go-imap v1.2.1
github.com/go-sql-driver/mysql v1.7.1
github.com/go-sql-driver/mysql v1.8.1
github.com/gosnmp/gosnmp v1.37.0
github.com/hirochachacha/go-smb2 v1.1.0
github.com/jlaffaye/ftp v0.2.0
Expand All @@ -13,23 +13,25 @@ require (
github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed
github.com/multiplay/go-ts3 v1.2.0
github.com/pterm/pterm v0.12.79
github.com/sijms/go-ora/v2 v2.8.9
github.com/sijms/go-ora/v2 v2.8.19
github.com/tomatome/grdp v0.1.0
github.com/wenerme/astgo v0.0.0-20230926205800-1b5bc38663fa
go.mongodb.org/mongo-driver v1.14.0
golang.org/x/crypto v0.19.0
go.mongodb.org/mongo-driver v1.15.0
golang.org/x/crypto v0.24.0
gosrc.io/xmpp v0.5.1
)

require (
atomicgo.dev/cursor v0.2.0 // indirect
atomicgo.dev/keyboard v0.2.9 // indirect
atomicgo.dev/schedule v0.1.0 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/emersion/go-message v0.15.0 // indirect
github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21 // indirect
github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 // indirect
github.com/geoffgarside/ber v1.1.0 // indirect
github.com/golang/protobuf v1.5.0 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/gookit/color v1.5.4 // indirect
Expand All @@ -53,11 +55,12 @@ require (
go.uber.org/atomic v1.6.0 // indirect
go.uber.org/multierr v1.5.0 // indirect
go.uber.org/zap v1.16.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
nhooyr.io/websocket v1.6.5 // indirect
)

Expand Down
Loading

0 comments on commit 4efb5f3

Please sign in to comment.