Skip to content

Commit d98a071

Browse files
Merge branch 'dotnetremoting' into httpshellserver
2 parents 7d0c230 + 316aeeb commit d98a071

File tree

3 files changed

+6
-31
lines changed

3 files changed

+6
-31
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/mattn/go-isatty v0.0.20 // indirect
1818
github.com/ncruces/go-strftime v0.1.9 // indirect
1919
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
20-
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
20+
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
2121
golang.org/x/sys v0.32.0 // indirect
2222
modernc.org/libc v1.62.1 // indirect
2323
modernc.org/mathutil v1.7.1 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ github.com/vjeantet/ldapserver v1.0.2-0.20240305064909-a417792e2906 h1:qHFp1iRg6
1717
github.com/vjeantet/ldapserver v1.0.2-0.20240305064909-a417792e2906/go.mod h1:YvUqhu5vYhmbcLReMLrm/Tq3S7Yj43kSVFvvol6Lh6k=
1818
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
1919
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
20-
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw=
21-
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM=
20+
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5ZsaDtB+a39EqjV0JSUM=
21+
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8=
2222
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
2323
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
2424
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
@@ -30,8 +30,8 @@ golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
3030
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
3131
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
3232
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
33-
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
34-
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
33+
golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU=
34+
golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s=
3535
modernc.org/cc/v4 v4.25.2 h1:T2oH7sZdGvTaie0BRNFbIYsabzCxUQg8nLqCdQ2i0ic=
3636
modernc.org/cc/v4 v4.25.2/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=
3737
modernc.org/ccgo/v4 v4.25.1 h1:TFSzPrAGmDsdnhT9X2UrcPMI3N/mJ9/X9ykKXwLhDsU=

protocol/dotnetremoting/dotnetremoting.go

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
// This is effectively a library for .NET remoting functionality
22
// The exploit remoting service tool by tyranid was the primary
3-
// resource for this and this is basically a port of that project with the ntlmssp
43
// Note: Everything is in little endian
54

65
// Usage Example:
76
// data = "\x00\x00blahblah"
87
// uri = "tcp://192.168.113.231:9999/SomeEndpoint"
9-
// conn,err := dotnetremoting.GetNTLMSSPTCPConnection("user", "asdf", "192.168.113.231:9999")
10-
// if err != nil {
11-
// fmt.Println(fmt.Sprintf("Error connecting: %s", err))
12-
// return
13-
// }
8+
// // conn = get a net.Conn somehow...
149
// newmessage := dotnetremoting.Message{}
1510
// newmessage.WriteDefaultPreamble(dotnetremoting.OperationRequest, len(data), uri)
1611
// _,err = conn.Write([]byte(newmessage.GetMessage(data))) // NOTE THE GetMessage call here, this finalizes the message
@@ -30,13 +25,9 @@ package dotnetremoting
3025

3126
import (
3227
"encoding/binary"
33-
"fmt"
3428
"net"
3529
"net/url"
36-
"time"
3730

38-
"github.com/LeakIX/nns"
39-
"github.com/LeakIX/ntlmssp"
4031
"github.com/vulncheck-oss/go-exploit/output"
4132
"github.com/vulncheck-oss/go-exploit/transform"
4233
)
@@ -445,19 +436,3 @@ func addCountedString(msg *string, encodingType StringEncoding, stringValue stri
445436
*msg += transform.PackLittleInt32(len(stringValue))
446437
*msg += stringValue
447438
}
448-
449-
// Some connection helper functions, exists mostly to wrap around ntlmssp.
450-
// For anonymous connections, just pass "" to user and password.
451-
func GetNTLMSSPTCPConnection(user string, password string, socketAddr string) (net.Conn, error) {
452-
ntlmsspClient, err := ntlmssp.NewClient(ntlmssp.SetCompatibilityLevel(1), ntlmssp.SetUserInfo(user, password))
453-
if err != nil {
454-
return nil, fmt.Errorf("error creating NTLMSSPClient, err=%w", err)
455-
}
456-
nnsConn, err := nns.DialNTLMSSP(socketAddr, ntlmsspClient, 10*time.Second)
457-
if err != nil {
458-
return nil, fmt.Errorf("error connecting with NTLMSSP to %s, err=%w", socketAddr, err)
459-
}
460-
output.PrintfFrameworkStatus("NTLMSSP connection to %s was successful", socketAddr)
461-
462-
return nnsConn, nil
463-
}

0 commit comments

Comments
 (0)