Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.1'
go-version: '1.24.1'

- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.3
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.7

- name: Build
run: go build -v ./...
Expand Down
15 changes: 12 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ linters:
# https://golangci-lint.run/usage/linters/

enable:

- errcheck
- gosimple
- govet
Expand Down Expand Up @@ -53,6 +52,9 @@ linters:
- goimports
- gomoddirectives
- gomodguard
#- goprintffuncname
#- gosec
- gosmopolitan
- grouper
- importas
- interfacebloat
Expand All @@ -62,17 +64,24 @@ linters:
- makezero
- mirror
- misspell
#- mnd
- musttag
- nakedret
#- nestif
- nilerr
- nilnesserr
- nilnil
- nlreturn
#- noctx
- nolintlint
- nonamedreturns
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- recvcheck
- revive
- rowserrcheck
- sloglint
Expand All @@ -82,15 +91,15 @@ linters:
- stylecheck
- tagalign
- tagliatelle
- tenv
- testifylint
- unconvert
- unparam
- usestdlibvars
#- varnamelen
- wastedassign
- whitespace
- wrapcheck

- zerologlint

linters-settings:
cyclop:
Expand Down
8 changes: 4 additions & 4 deletions cli/commandline.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,28 +488,28 @@ func printDetails(conf *config.Config) {
customFlags = append(customFlags, CustomFlag{
Name: key,
Type: fmt.Sprintf("%T", *value),
Default: fmt.Sprintf("%v", *value),
Default: *value,
})
}
for key, value := range conf.UintFlagsMap {
customFlags = append(customFlags, CustomFlag{
Name: key,
Type: fmt.Sprintf("%T", *value),
Default: fmt.Sprintf("%v", *value),
Default: strconv.FormatUint(uint64(*value), 10),
})
}
for key, value := range conf.IntFlagsMap {
customFlags = append(customFlags, CustomFlag{
Name: key,
Type: fmt.Sprintf("%T", *value),
Default: fmt.Sprintf("%v", *value),
Default: strconv.Itoa(*value),
})
}
for key, value := range conf.BoolFlagsMap {
customFlags = append(customFlags, CustomFlag{
Name: key,
Type: fmt.Sprintf("%T", *value),
Default: fmt.Sprintf("%v", *value),
Default: strconv.FormatBool(*value),
})
}

Expand Down
4 changes: 2 additions & 2 deletions framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func doVerify(sploit Exploit, conf *config.Config) bool {
if result {
output.PrintFrameworkSuccess("Target verification succeeded!", "host", conf.Rhost, "port", conf.Rport, "verified", true)
} else {
output.PrintFrameworkStatus(fmt.Sprintf("The target isn't recognized as %s", conf.Product), "host", conf.Rhost, "port", conf.Rport, "verified", false)
output.PrintFrameworkStatus("The target isn't recognized as "+conf.Product, "host", conf.Rhost, "port", conf.Rport, "verified", false)
}

return result
Expand Down Expand Up @@ -381,7 +381,7 @@ func doScan(sploit Exploit, conf *config.Config) bool {
// Prints the version to the log file using status VERSION and a parsable version string (version=).
// Additionally, updates the database if it's in use. Typically should be called from the exploit.
func StoreVersion(conf *config.Config, version string) {
output.PrintVersion(fmt.Sprintf("The reported version is %s", version), conf.Rhost, conf.Rport, version)
output.PrintVersion("The reported version is "+version, conf.Rhost, conf.Rport, version)
db.UpdateVerified(conf.Product, true, version, conf.Rhost, conf.Rport)
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/vulncheck-oss/go-exploit

go 1.23.1
go 1.24.1

require (
github.com/lor00x/goldap v0.0.0-20240304151906-8d785c64d1c8
Expand Down
2 changes: 1 addition & 1 deletion java/javagadget.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func Commons6ModifiedBashCommandBytecode(commandStr string) (string, error) {
return payloadBytes, nil
}

// Generated using ysoserial with CommonsCollections10
// Generated using ysoserial with CommonsCollections10.
func Commons10CommandBytecode(commandStr string) (string, error) {
if len(commandStr) > 255 || len(commandStr) < 1 {
return "", ErrorInvalidCommandLength("command must be between 1 and 255 characters")
Expand Down
2 changes: 0 additions & 2 deletions protocol/afp/afp.go
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,6 @@ func GetAppl(conn net.Conn, volID uint16, creator [4]byte, aIndex uint16, bitmap
return response, ok
}


// Sends the setfileparams command to the AFP server.
func SetFilParams(conn net.Conn, volID uint16, dirID uint32, bitmap uint16, path string, buffer []byte) bool {
data := []byte{}
Expand Down Expand Up @@ -830,7 +829,6 @@ func SetFilParams(conn net.Conn, volID uint16, dirID uint32, bitmap uint16, path
return ok
}


// Sends the Delete command to the AFP server.
func Delete(conn net.Conn, volumeID uint16, dirID uint32, path string) bool {
// requires protocol 3.2 and specific support configured at build time.
Expand Down
2 changes: 1 addition & 1 deletion protocol/httphelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func BuildURI(paths ...string) string {

// BasicAuth takes a username and password and returns a string suitable for an Authorization header.
func BasicAuth(username, password string) string {
return fmt.Sprintf("Basic %s", transform.EncodeBase64(username+":"+password))
return "Basic " + transform.EncodeBase64(username+":"+password)
}

func parseCookies(headers []string) string {
Expand Down
2 changes: 1 addition & 1 deletion protocol/tcpsocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func TCPReadAmount(conn net.Conn, amount int) ([]byte, bool) {
return reply, true
}

// Read an amount and dont log errors if we fail to read from the socket
// Read an amount and dont log errors if we fail to read from the socket.
func TCPReadAmountBlind(conn net.Conn, amount int) ([]byte, bool) {
reply := make([]byte, amount)
totalRead := 0
Expand Down