Skip to content

Commit 3f530ec

Browse files
authored
Merge pull request #336 from vulncheck-oss/bump-to-1.24.1
Bumped to go 1.24.1, golangci-lint 1.64.7, documented more linters, ran autofix
2 parents 37a4e17 + 21a5bc1 commit 3f530ec

File tree

9 files changed

+24
-17
lines changed

9 files changed

+24
-17
lines changed

.github/workflows/go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v4
2121
with:
22-
go-version: '1.23.1'
22+
go-version: '1.24.1'
2323

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

2727
- name: Build
2828
run: go build -v ./...

.golangci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ linters:
66
# https://golangci-lint.run/usage/linters/
77

88
enable:
9-
109
- errcheck
1110
- gosimple
1211
- govet
@@ -53,6 +52,9 @@ linters:
5352
- goimports
5453
- gomoddirectives
5554
- gomodguard
55+
#- goprintffuncname
56+
#- gosec
57+
- gosmopolitan
5658
- grouper
5759
- importas
5860
- interfacebloat
@@ -62,17 +64,24 @@ linters:
6264
- makezero
6365
- mirror
6466
- misspell
67+
#- mnd
68+
- musttag
6569
- nakedret
6670
#- nestif
6771
- nilerr
72+
- nilnesserr
6873
- nilnil
6974
- nlreturn
75+
#- noctx
7076
- nolintlint
7177
- nonamedreturns
78+
- perfsprint
7279
- prealloc
7380
- predeclared
7481
- promlinter
82+
- protogetter
7583
- reassign
84+
- recvcheck
7685
- revive
7786
- rowserrcheck
7887
- sloglint
@@ -82,15 +91,15 @@ linters:
8291
- stylecheck
8392
- tagalign
8493
- tagliatelle
85-
- tenv
94+
- testifylint
8695
- unconvert
8796
- unparam
8897
- usestdlibvars
8998
#- varnamelen
9099
- wastedassign
91100
- whitespace
92101
- wrapcheck
93-
102+
- zerologlint
94103

95104
linters-settings:
96105
cyclop:

cli/commandline.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,28 +488,28 @@ func printDetails(conf *config.Config) {
488488
customFlags = append(customFlags, CustomFlag{
489489
Name: key,
490490
Type: fmt.Sprintf("%T", *value),
491-
Default: fmt.Sprintf("%v", *value),
491+
Default: *value,
492492
})
493493
}
494494
for key, value := range conf.UintFlagsMap {
495495
customFlags = append(customFlags, CustomFlag{
496496
Name: key,
497497
Type: fmt.Sprintf("%T", *value),
498-
Default: fmt.Sprintf("%v", *value),
498+
Default: strconv.FormatUint(uint64(*value), 10),
499499
})
500500
}
501501
for key, value := range conf.IntFlagsMap {
502502
customFlags = append(customFlags, CustomFlag{
503503
Name: key,
504504
Type: fmt.Sprintf("%T", *value),
505-
Default: fmt.Sprintf("%v", *value),
505+
Default: strconv.Itoa(*value),
506506
})
507507
}
508508
for key, value := range conf.BoolFlagsMap {
509509
customFlags = append(customFlags, CustomFlag{
510510
Name: key,
511511
Type: fmt.Sprintf("%T", *value),
512-
Default: fmt.Sprintf("%v", *value),
512+
Default: strconv.FormatBool(*value),
513513
})
514514
}
515515

framework.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func doVerify(sploit Exploit, conf *config.Config) bool {
210210
if result {
211211
output.PrintFrameworkSuccess("Target verification succeeded!", "host", conf.Rhost, "port", conf.Rport, "verified", true)
212212
} else {
213-
output.PrintFrameworkStatus(fmt.Sprintf("The target isn't recognized as %s", conf.Product), "host", conf.Rhost, "port", conf.Rport, "verified", false)
213+
output.PrintFrameworkStatus("The target isn't recognized as "+conf.Product, "host", conf.Rhost, "port", conf.Rport, "verified", false)
214214
}
215215

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

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/vulncheck-oss/go-exploit
22

3-
go 1.23.1
3+
go 1.24.1
44

55
require (
66
github.com/lor00x/goldap v0.0.0-20240304151906-8d785c64d1c8

java/javagadget.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func Commons6ModifiedBashCommandBytecode(commandStr string) (string, error) {
144144
return payloadBytes, nil
145145
}
146146

147-
// Generated using ysoserial with CommonsCollections10
147+
// Generated using ysoserial with CommonsCollections10.
148148
func Commons10CommandBytecode(commandStr string) (string, error) {
149149
if len(commandStr) > 255 || len(commandStr) < 1 {
150150
return "", ErrorInvalidCommandLength("command must be between 1 and 255 characters")

protocol/afp/afp.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,6 @@ func GetAppl(conn net.Conn, volID uint16, creator [4]byte, aIndex uint16, bitmap
796796
return response, ok
797797
}
798798

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

833-
834832
// Sends the Delete command to the AFP server.
835833
func Delete(conn net.Conn, volumeID uint16, dirID uint32, path string) bool {
836834
// requires protocol 3.2 and specific support configured at build time.

protocol/httphelper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func BuildURI(paths ...string) string {
6767

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

7373
func parseCookies(headers []string) string {

protocol/tcpsocket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func TCPReadAmount(conn net.Conn, amount int) ([]byte, bool) {
110110
return reply, true
111111
}
112112

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

0 commit comments

Comments
 (0)