从 github 安装 Go 工具并遇到安装错误

Pul*_*pat 3 go websecurity

我想从 github 安装这个工具:https ://github.com/ethicalhackingplayground/ssrf-tool

我正在使用cmd: go install github.com/ethicalhackingplayground/ssrf-tool@latest

输出 :

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\ssrf-tool@v0.0.0-20200901082948-7f3cffc3c7bb\ssrftool.go:34:2: undefined: gologger.Printf
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\ssrf-tool@v0.0.0-20200901082948-7f3cffc3c7bb\ssrftool.go:35:2: undefined: gologger.Infof
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\ssrf-tool@v0.0.0-20200901082948-7f3cffc3c7bb\ssrftool.go:36:2: undefined: gologger.Infof
Run Code Online (Sandbox Code Playgroud)

我对 golang 非常陌生,go 在我的系统中安装得很好,因为 github 上的其他工具运行良好。如果需要对该工具的代码进行一些更改,请提出建议。

Зел*_*ный 5

此源在没有 go 模块支持和旧版本的情况下创建gologger,这是一个解决方法:

  1. 克隆存储库git clone git@github.com:ethicalhackingplayground/ssrf-tool.git
  2. cd ssrf-tool创建go.mod包含内容的文件:
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
)

Run Code Online (Sandbox Code Playgroud)
  1. 下载依赖go mod download
  2. 构建可执行文件go build .
  3. ./ssrf-tool --help

利润。