Skip to content

Commit 3bb2300

Browse files
firefartalexmozzhakovnlykkeimadnealn30nx
authored
Dev (#379)
* update to go 1.17 * more go 1.17 updates * update sponsors * update makefile * gitignore * remove todo * Fixed errors mixing with progress in stderr by removing progress string with \r * Added --retry option for dir, fuzz, s3 and vhost modes * first dev version * wording * fix retries * update help text * first work for #298 allow for a totalrequests change from within a plugin * use defer * ignore invalid control character urls * add goreleaser * gitignore * output color, better status printing * more color output * fix nil panics * Added support for Google Cloud Storage (GCS) bucket scanning. The scanning finds all public buckets listable by anonymous users * fix gcs module * update readme * go 1.18 * go mod tidy * makefile * readme * readme * better error message * use generics for set * use the new netip type * update version * colors * cspell * improve readability of GobusterVhost (#334) * improve readability of GobusterVhost * fix for the merge side effect * lint * update * update * more work * remove unused method * retries * colored output * Closes issue #349 (#356) * fix version * Closes issue #349 Co-authored-by: firefart <[email protected]> * Closes issue #315 (#359) * Closes issue #315 * Syntax fix * support mtls * readme * check for fuzz keyword * allow for http header fuzzing * better description * new option to not canonicalize header names * basic auth fuzzing * fix typo in vhost command (#361) * update * check error * error handling * dev * enable tls1.0 and 1.1 support * Bump golang.org/x/term from 0.1.0 to 0.2.0 (#369) Bumps [golang.org/x/term](https://github.com/golang/term) from 0.1.0 to 0.2.0. - [Release notes](https://github.com/golang/term/releases) - [Commits](golang/term@v0.1.0...v0.2.0) --- updated-dependencies: - dependency-name: golang.org/x/term dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump golang.org/x/crypto from 0.1.0 to 0.2.0 (#368) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.1.0 to 0.2.0. - [Release notes](https://github.com/golang/crypto/releases) - [Commits](golang/crypto@v0.1.0...v0.2.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Adds LF after the work end (#373) * typo * Reformat: Add `\n` after the end Co-authored-by: firefart <[email protected]> * Bump golang.org/x/crypto from 0.2.0 to 0.3.0 (#374) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.2.0 to 0.3.0. - [Release notes](https://github.com/golang/crypto/releases) - [Commits](golang/crypto@v0.2.0...v0.3.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump golang.org/x/crypto from 0.3.0 to 0.4.0 (#376) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.3.0 to 0.4.0. - [Release notes](https://github.com/golang/crypto/releases) - [Commits](golang/crypto@v0.3.0...v0.4.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions/checkout from 3.1.0 to 3.2.0 (#377) Bumps [actions/checkout](https://github.com/actions/checkout) from 3.1.0 to 3.2.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v3.1.0...v3.2.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * add tftp mode * better output on tftp mode * Bump goreleaser/goreleaser-action from 3 to 4 (#378) Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 3 to 4. - [Release notes](https://github.com/goreleaser/goreleaser-action/releases) - [Commits](goreleaser/goreleaser-action@v3...v4) --- updated-dependencies: - dependency-name: goreleaser/goreleaser-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * readme Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: alexmozzhakov <[email protected]> Co-authored-by: Nicolas Lykke Iversen <[email protected]> Co-authored-by: Neal Caffery <[email protected]> Co-authored-by: n30nx <[email protected]> Co-authored-by: IPv4v6 <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: _Magenta_ <[email protected]>
1 parent af6af44 commit 3bb2300

File tree

13 files changed

+318
-17
lines changed

13 files changed

+318
-17
lines changed

.github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
go-version: ${{ matrix.go }}
1515

1616
- name: Check out code
17-
uses: actions/checkout@v3.1.0
17+
uses: actions/checkout@v3.2.0
1818

1919
- name: build cache
2020
uses: actions/cache@v3

.github/workflows/golangci-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
name: lint
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v3.1.0
8+
- uses: actions/checkout@v3.2.0
99

1010
- uses: actions/setup-go@v3
1111
with:

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v3.1.0
16+
uses: actions/checkout@v3.2.0
1717
with:
1818
fetch-depth: 0
1919
- name: Fetch all tags
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
go-version: 1.19
2525
- name: Run GoReleaser
26-
uses: goreleaser/goreleaser-action@v3
26+
uses: goreleaser/goreleaser-action@v4
2727
with:
2828
distribution: goreleaser
2929
version: latest

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Gobuster v3.2.0
1+
# Gobuster
22

33
Gobuster is a tool used to brute-force:
44

@@ -22,6 +22,11 @@ All funds that are donated to this project will be donated to charity. A full lo
2222

2323
# Changes
2424

25+
## 3.4
26+
27+
- Enable TLS1.0 and TLS1.1 support
28+
- Add TFTP mode to search for files on tftp servers
29+
2530
## 3.3
2631

2732
- Support TLS client certificates / mtls

cli/cmd/tftp.go

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
package cmd
2+
3+
import (
4+
"fmt"
5+
"log"
6+
"strings"
7+
"time"
8+
9+
"github.com/OJ/gobuster/v3/cli"
10+
"github.com/OJ/gobuster/v3/gobustertftp"
11+
"github.com/OJ/gobuster/v3/libgobuster"
12+
"github.com/spf13/cobra"
13+
)
14+
15+
// nolint:gochecknoglobals
16+
var cmdTFTP *cobra.Command
17+
18+
func runTFTP(cmd *cobra.Command, args []string) error {
19+
globalopts, pluginopts, err := parseTFTPOptions()
20+
if err != nil {
21+
return fmt.Errorf("error on parsing arguments: %w", err)
22+
}
23+
24+
plugin, err := gobustertftp.NewGobusterTFTP(globalopts, pluginopts)
25+
if err != nil {
26+
return fmt.Errorf("error on creating gobustertftp: %w", err)
27+
}
28+
29+
if err := cli.Gobuster(mainContext, globalopts, plugin); err != nil {
30+
return fmt.Errorf("error on running gobuster: %w", err)
31+
}
32+
return nil
33+
}
34+
35+
func parseTFTPOptions() (*libgobuster.Options, *gobustertftp.OptionsTFTP, error) {
36+
globalopts, err := parseGlobalOptions()
37+
if err != nil {
38+
return nil, nil, err
39+
}
40+
pluginOpts := gobustertftp.NewOptionsTFTP()
41+
42+
pluginOpts.Server, err = cmdTFTP.Flags().GetString("server")
43+
if err != nil {
44+
return nil, nil, fmt.Errorf("invalid value for domain: %w", err)
45+
}
46+
47+
if !strings.Contains(pluginOpts.Server, ":") {
48+
pluginOpts.Server = fmt.Sprintf("%s:69", pluginOpts.Server)
49+
}
50+
51+
pluginOpts.Timeout, err = cmdTFTP.Flags().GetDuration("timeout")
52+
if err != nil {
53+
return nil, nil, fmt.Errorf("invalid value for timeout: %w", err)
54+
}
55+
56+
return globalopts, pluginOpts, nil
57+
}
58+
59+
// nolint:gochecknoinits
60+
func init() {
61+
cmdTFTP = &cobra.Command{
62+
Use: "tftp",
63+
Short: "Uses TFTP enumeration mode",
64+
RunE: runTFTP,
65+
}
66+
67+
cmdTFTP.Flags().StringP("server", "s", "", "The target TFTP server")
68+
cmdTFTP.Flags().DurationP("timeout", "", time.Second, "TFTP timeout")
69+
if err := cmdTFTP.MarkFlagRequired("server"); err != nil {
70+
log.Fatalf("error on marking flag as required: %v", err)
71+
}
72+
73+
cmdTFTP.PersistentPreRun = func(cmd *cobra.Command, args []string) {
74+
configureGlobalOptions()
75+
}
76+
77+
rootCmd.AddCommand(cmdTFTP)
78+
}

cli/gobuster.go

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ func progressWorker(ctx context.Context, g *libgobuster.Gobuster, wg *sync.WaitG
8787
}
8888
}
8989
case <-ctx.Done():
90+
fmt.Println()
9091
return
9192
}
9293
}

go.mod

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ go 1.19
55
require (
66
github.com/fatih/color v1.13.0
77
github.com/google/uuid v1.3.0
8+
github.com/pin/tftp/v3 v3.0.0
89
github.com/spf13/cobra v1.6.1
9-
golang.org/x/crypto v0.1.0
10-
golang.org/x/term v0.1.0
10+
golang.org/x/crypto v0.4.0
11+
golang.org/x/term v0.3.0
1112
)
1213

1314
require (
14-
github.com/inconshreveable/mousetrap v1.0.1 // indirect
15+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
1516
github.com/mattn/go-colorable v0.1.13 // indirect
1617
github.com/mattn/go-isatty v0.0.16 // indirect
1718
github.com/spf13/pflag v1.0.5 // indirect
18-
golang.org/x/sys v0.1.0 // indirect
19+
golang.org/x/net v0.4.0 // indirect
20+
golang.org/x/sys v0.3.0 // indirect
1921
)

go.sum

+16-7
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,38 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
33
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
44
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
55
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
6-
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
76
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
7+
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
8+
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
89
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
910
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
1011
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
1112
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
1213
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
1314
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
1415
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
16+
github.com/pin/tftp/v3 v3.0.0 h1:o9cQpmWBSbgiaYXuN+qJAB12XBIv4dT7OuOONucn2l0=
17+
github.com/pin/tftp/v3 v3.0.0/go.mod h1:xwQaN4viYL019tM4i8iecm++5cGxSqen6AJEOEyEI0w=
1518
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
1619
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
1720
github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
1821
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
1922
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
20-
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
21-
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
23+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
24+
golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8=
25+
golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80=
26+
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
27+
golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU=
28+
golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
29+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
2230
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
2331
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
2432
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
2533
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
26-
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
27-
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
28-
golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw=
29-
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
34+
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
35+
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
36+
golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
37+
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
38+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
3039
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3140
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

gobustertftp/gobustertftp.go

+142
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
package gobustertftp
2+
3+
import (
4+
"bufio"
5+
"bytes"
6+
"context"
7+
"fmt"
8+
"strings"
9+
"text/tabwriter"
10+
11+
"github.com/OJ/gobuster/v3/libgobuster"
12+
13+
"github.com/pin/tftp/v3"
14+
)
15+
16+
// GobusterTFTP is the main type to implement the interface
17+
type GobusterTFTP struct {
18+
globalopts *libgobuster.Options
19+
options *OptionsTFTP
20+
}
21+
22+
// NewGobusterTFTP creates a new initialized NewGobusterTFTP
23+
func NewGobusterTFTP(globalopts *libgobuster.Options, opts *OptionsTFTP) (*GobusterTFTP, error) {
24+
if globalopts == nil {
25+
return nil, fmt.Errorf("please provide valid global options")
26+
}
27+
28+
if opts == nil {
29+
return nil, fmt.Errorf("please provide valid plugin options")
30+
}
31+
32+
g := GobusterTFTP{
33+
options: opts,
34+
globalopts: globalopts,
35+
}
36+
return &g, nil
37+
}
38+
39+
// Name should return the name of the plugin
40+
func (d *GobusterTFTP) Name() string {
41+
return "TFTP enumeration"
42+
}
43+
44+
// PreRun is the pre run implementation of gobustertftp
45+
func (d *GobusterTFTP) PreRun(ctx context.Context) error {
46+
_, err := tftp.NewClient(d.options.Server)
47+
if err != nil {
48+
return err
49+
}
50+
return nil
51+
}
52+
53+
// ProcessWord is the process implementation of gobustertftp
54+
func (d *GobusterTFTP) ProcessWord(ctx context.Context, word string, progress *libgobuster.Progress) error {
55+
c, err := tftp.NewClient(d.options.Server)
56+
if err != nil {
57+
return err
58+
}
59+
c.SetTimeout(d.options.Timeout)
60+
wt, err := c.Receive(word, "octet")
61+
if err != nil {
62+
// file not found
63+
if d.globalopts.Verbose {
64+
progress.ResultChan <- Result{
65+
Filename: word,
66+
Found: false,
67+
ErrorMessage: err.Error(),
68+
}
69+
}
70+
71+
return nil
72+
}
73+
result := Result{
74+
Filename: word,
75+
Found: true,
76+
}
77+
if n, ok := wt.(tftp.IncomingTransfer).Size(); ok {
78+
result.Size = n
79+
}
80+
progress.ResultChan <- result
81+
return nil
82+
}
83+
84+
func (d *GobusterTFTP) AdditionalWords(word string) []string {
85+
return []string{}
86+
}
87+
88+
// GetConfigString returns the string representation of the current config
89+
func (d *GobusterTFTP) GetConfigString() (string, error) {
90+
var buffer bytes.Buffer
91+
bw := bufio.NewWriter(&buffer)
92+
tw := tabwriter.NewWriter(bw, 0, 5, 3, ' ', 0)
93+
o := d.options
94+
95+
if _, err := fmt.Fprintf(tw, "[+] Server:\t%s\n", o.Server); err != nil {
96+
return "", err
97+
}
98+
99+
if _, err := fmt.Fprintf(tw, "[+] Threads:\t%d\n", d.globalopts.Threads); err != nil {
100+
return "", err
101+
}
102+
103+
if d.globalopts.Delay > 0 {
104+
if _, err := fmt.Fprintf(tw, "[+] Delay:\t%s\n", d.globalopts.Delay); err != nil {
105+
return "", err
106+
}
107+
}
108+
109+
if _, err := fmt.Fprintf(tw, "[+] Timeout:\t%s\n", o.Timeout.String()); err != nil {
110+
return "", err
111+
}
112+
113+
wordlist := "stdin (pipe)"
114+
if d.globalopts.Wordlist != "-" {
115+
wordlist = d.globalopts.Wordlist
116+
}
117+
if _, err := fmt.Fprintf(tw, "[+] Wordlist:\t%s\n", wordlist); err != nil {
118+
return "", err
119+
}
120+
121+
if d.globalopts.PatternFile != "" {
122+
if _, err := fmt.Fprintf(tw, "[+] Patterns:\t%s (%d entries)\n", d.globalopts.PatternFile, len(d.globalopts.Patterns)); err != nil {
123+
return "", err
124+
}
125+
}
126+
127+
if d.globalopts.Verbose {
128+
if _, err := fmt.Fprintf(tw, "[+] Verbose:\ttrue\n"); err != nil {
129+
return "", err
130+
}
131+
}
132+
133+
if err := tw.Flush(); err != nil {
134+
return "", fmt.Errorf("error on tostring: %w", err)
135+
}
136+
137+
if err := bw.Flush(); err != nil {
138+
return "", fmt.Errorf("error on tostring: %w", err)
139+
}
140+
141+
return strings.TrimSpace(buffer.String()), nil
142+
}

gobustertftp/options.go

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package gobustertftp
2+
3+
import (
4+
"time"
5+
)
6+
7+
// OptionsTFTP holds all options for the tftp plugin
8+
type OptionsTFTP struct {
9+
Server string
10+
Timeout time.Duration
11+
}
12+
13+
// NewOptionsTFTP returns a new initialized OptionsTFTP
14+
func NewOptionsTFTP() *OptionsTFTP {
15+
return &OptionsTFTP{}
16+
}

0 commit comments

Comments
 (0)