-2

Hello guys decided to download one tool - https://github.com/Charlie-belmer/nosqli (wrote on GO) for my pentest practice (it's made the nosqli directory in my /home/user). And found out that it's doesn't work. So I've started to fix this problem and stucked:

when I did "go install" it did nothing I mean literally without error msg etc. Now it gaves me that:

go install main.go:19:8: cannot find package "github.com/Charlie-belmer/nosqli/cmd" in any of: /usr/lib/go-1.17/src/github.com/Charlie-belmer/nosqli/cmd (from $GOROOT) /root/go/src/github.com/Charlie-belmer/nosqli/cmd (from $GOPATH)

And same situation with go build.

**# go version
go version go1.17.6 linux/amd64**

**go env** (output):

GO111MODULE="off"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.17"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.17/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17.6"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3159993699=/tmp/go-build -gno-record-gcc-switches"

I've never used Go before and absolutely stucked, tried to read so guids but resultless.

blami
  • 6,588
  • 2
  • 23
  • 31
Dscarve
  • 11
  • 1
  • 4
  • 1
    *"doesnt work"* is not an explanation of a problem. You should provide the *exact* error message that you encountered. – mkopriva Jan 26 '22 at 09:06
  • Yes sorry, forgot add the error message: when I did "go install" it did nothing I mean literally without error msg etc. Now it gaves me that: go install main.go:19:8: cannot find package "github.com/Charlie-belmer/nosqli/cmd" in any of: /usr/lib/go-1.17/src/github.com/Charlie-belmer/nosqli/cmd (from $GOROOT) /root/go/src/github.com/Charlie-belmer/nosqli/cmd (from $GOPATH) – Dscarve Jan 26 '22 at 09:18
  • and same situation with go build – Dscarve Jan 26 '22 at 09:18
  • And the most funny moment: yesterday the tool worked well... – Dscarve Jan 26 '22 at 09:20
  • In your question you should provide the exact commands that you are trying to run and exact output that they give you. – blami Jan 26 '22 at 09:20
  • @blami yes, added the output of commands to question. – Dscarve Jan 26 '22 at 09:27

2 Answers2

1

How did you download the tool? Did you clone the repo from Github and trying to build it? If you just want to use the tool why not grab binary release for your OS here: https://github.com/Charlie-belmer/nosqli/releases/tag/v0.5.4 ?

If you really want to build it, you will need to clone the repository:

git clone https://github.com/Charlie-belmer/nosqli.git /some/dir

and run

cd /some/dir
go build -o nosqli .

go tool will fetch all dependencies as part of process and build the binary (named as whatever comes after -o - in this case nosqli), no need to run go install at all. nosqli binary should then be in /some/dir after downloading dependencies and build finishes.

blami
  • 6,588
  • 2
  • 23
  • 31
  • I followed the instructions: $ git clone https://github.com/Charlie-belmer/nosqli.git $ cd nosqli $ go get -u -d ./... $ go install $ nosqli -h But dude, you are genious.... I downloaded this binary and its working now... WHAT A DUMB AM I? – Dscarve Jan 26 '22 at 09:55
0

Normally you would install a package that you want to use in the software you're making. Let's assume you want to use some package. Then the command will be
go install the_complete_package
example:
go install github.com/marcelloh/gotest@latest

Marcelloh
  • 82
  • 1
  • 5