Home > OS >  Installing a Go tool from github and facing installation errors
Installing a Go tool from github and facing installation errors

Time:03-05

I want to install this tool from github : https://github.com/ethicalhackingplayground/ssrf-tool

I am using the cmd : go install github.com/ethicalhackingplayground/ssrf-tool@latest

Output :

go: finding module for package github.com/projectdiscovery/gologger
go: finding module for package github.com/briandowns/spinner
go: finding module for package github.com/logrusorgru/aurora
go: found github.com/briandowns/spinner in github.com/briandowns/spinner v1.18.1
go: found github.com/logrusorgru/aurora in github.com/logrusorgru/aurora v2.0.3 incompatible
go: found github.com/projectdiscovery/gologger in github.com/projectdiscovery/gologger v1.1.4
# github.com/ethicalhackingplayground/ssrf-tool
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\[email protected]\ssrftool.go:34:2: undefined: gologger.Printf
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\[email protected]\ssrftool.go:35:2: undefined: gologger.Infof
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\[email protected]\ssrftool.go:36:2: undefined: gologger.Infof

I am super new to golang, go installation is fine in my system because other tools from github are working fine. If some chances are required in the code of this tool, please suggest so.

CodePudding user response:

This sources created without go module support and an old version of gologger, here is a workaround:

  1. Clone repository git clone [email protected]:ethicalhackingplayground/ssrf-tool.git
  2. cd ssrf-tool create go.mod file with content:
module github.com/ethicalhackingplayground/ssrf-tool

go 1.17

require (
    github.com/briandowns/spinner v1.18.1
    github.com/logrusorgru/aurora v2.0.3 incompatible
    github.com/projectdiscovery/gologger v1.0.1
)

require (
    github.com/davecgh/go-spew v1.1.1 // indirect
    github.com/fatih/color v1.7.0 // indirect
    github.com/mattn/go-colorable v0.1.2 // indirect
    github.com/mattn/go-isatty v0.0.8 // indirect
    golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 // indirect
)

  1. download deps go mod download
  2. Build executable go build .
  3. ./ssrf-tool --help

Profit.

CodePudding user response:

Here is the repo with the problem fixed.

go install github.com/R0X4R/ssrf-tool@latest

or

git clone https://github.com/R0X4R/ssrf-tool.git
cd ssrf-tool
go build ssrftool.go && mv ssrftool /usr/bin/
  • Related