网站/小程序/APP个性化定制开发,二开,改版等服务,加扣:8582-36016

GoKart是一款针对Go代码安全的静态分析工具,该工具能够从Go源代码中查找使用了SSA(单一静态分配)形式的代码漏洞

关于GoKart

GoKart是一款针对Go代码安全的静态分析工具,该工具能够从Go源代码中查找使用了SSA(单一静态分配)形式的代码漏洞。GoKart能够跟踪变量和函数参数的来源,以确定输入源是否安全,与其他Go安全扫描程序相比,GoKart能够有效减少误报的数量。例如,与变量连接的SQL查询传统上可能标记为SQL注入,然而,GoKart可以确定变量实际上是常量还是类似常量的参数,在这种情况下GoKart不会报出漏洞。

工具安装

我们可以使用下列方式之一来安装GoKart。

(1) go install安装

广大研究人员可以使用下列命令安装GoKart:

$ go install github.com/praetorian-inc/gokart@latest

    (2) Release安装

    首先,我们需要访问该项目的【Releases页面】,并下载GoKart源码至本地系统。

    接下来,我们可以下载checksums.txt文件来验证下载包的完整性:

    # Check the checksum of the downloaded archive 
    
    $ shasum -a 256 gokart_${VERSION}_${ARCH}.tar.gz 
    
    b05c4d7895be260aa16336f29249c50b84897dab90e1221c9e96af9233751f22  gokart_${VERSION}_${ARCH}.tar.gz 
    
    $ cat gokart_${VERSION}_${ARCH}_checksums.txt | grep gokart_${VERSION}_${ARCH}.tar.gz 
    
    b05c4d7895be260aa16336f29249c50b84897dab90e1221c9e96af9233751f22  gokart_${VERSION}_${ARCH}.tar.gz

      然后,提取已下载好的文档:

      $ tar -xvf gokart_${VERSION}_${ARCH}.tar.gz

        最后,将GoKart代码移动至我们的运行路径中:

        $ mv ./gokart /usr/local/bin/

          (3) 源码安装

          首先,我们需要使用下列命令将该项目源码克隆至本地:

          git clone https://github.com/praetorian-inc/gokart.git

            然后切换至项目根目录,并构建源码:

            $ cd gokart 
            
            $ go build

              最后,将GoKart代码移动至我们的运行路径中:

              $ mv ./gokart /usr/local/bin

                Docker支持

                构建Docker镜像:

                docker build -t gokart .

                  运行容器,并执行本地扫描(本地扫描目录需要加载至容器镜像中):

                  docker run -v /path/to/scan-dir:/scan-dir gokart scan /scan-dir

                    运行容器,并执行远程扫描(指定私钥以作认证,并加载至容器中):

                    docker run gokart scan -r https://github.com/praetorian-inc/gokart 
                      
                    # specifying a private key for private repository ssh authentication 
                    
                    docker run -v /path/to/key-dir/:/key-dir gokart scan -r git@github.com:praetorian-inc/gokart.git -k /key-dir/ssh_key

                      工具使用

                      针对当前目录中的Go模块运行GoKart:

                      # running without a directory specified defaults to '.' 
                      
                      gokart scan <flags>

                        扫描不同目录中的Go模块:

                        gokart scan <directory> <flags>

                          查看帮助信息:

                          gokart help

                            项目地址

                            GoKart:【GitHub传送门


                            评论 0

                            暂无评论
                            0
                            0
                            0
                            立即
                            投稿
                            发表
                            评论
                            返回
                            顶部