Skip to content

Commit c703875

Browse files
committed
Installer fixes
1 parent 1d236c1 commit c703875

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

install.sh

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ fi
292292
# Declare Go tools: name -> module path (always installed @latest)
293293
declare -A gotools=(
294294
["gf"]="github.com/tomnomnom/gf"
295-
["brutespray"]="github.com/x90skysn3k/brutespray"
295+
["brutespray"]="github.com/x90skysn3k/brutespray/v2"
296296
["qsreplace"]="github.com/tomnomnom/qsreplace"
297297
["ffuf"]="github.com/ffuf/ffuf/v2"
298298
["github-subdomains"]="github.com/gwen001/github-subdomains"
@@ -327,7 +327,7 @@ declare -A gotools=(
327327
["Web-Cache-Vulnerability-Scanner"]="github.com/Hackmanit/Web-Cache-Vulnerability-Scanner"
328328
["subfinder"]="github.com/projectdiscovery/subfinder/v2/cmd/subfinder"
329329
["hakip2host"]="github.com/hakluke/hakip2host"
330-
["mantra"]="github.com/Brosck/mantra"
330+
["mantra"]="github.com/brosck/mantra"
331331
["crt"]="github.com/cemulus/crt"
332332
["s3scanner"]="github.com/sa7mon/s3scanner"
333333
["nmapurls"]="github.com/sdcampbell/nmapurls"
@@ -338,7 +338,7 @@ declare -A gotools=(
338338
["jsluice"]="github.com/BishopFox/jsluice/cmd/jsluice"
339339
["sj"]="github.com/BishopFox/sj"
340340
["urlfinder"]="github.com/projectdiscovery/urlfinder/cmd/urlfinder"
341-
["cent"]="github.com/xm1k3/cent"
341+
["cent"]="github.com/xm1k3/cent/v2"
342342
["csprecon"]="github.com/edoardottt/csprecon/cmd/csprecon"
343343
["exifray"]="github.com/mmarting/exifray"
344344
["VhostFinder"]="github.com/wdahlenburg/VhostFinder"
@@ -383,7 +383,7 @@ declare -A repos=(
383383
["sus_params"]="g0ldencybersec/sus_params"
384384
["CMSeeK"]="Tuhinshubhra/CMSeeK"
385385
["massdns"]="blechschmidt/massdns"
386-
["testssl.sh"]="drwetter/testssl.sh"
386+
["testssl.sh"]="testssl/testssl.sh"
387387
["JSA"]="w9w/JSA"
388388
["cloud_enum"]="initstring/cloud_enum"
389389
["ultimate-nmap-parser"]="shifty0g/ultimate-nmap-parser"
@@ -489,6 +489,11 @@ function ensure_interlace_colorclass_healthy() {
489489
function install_tools() {
490490
header "Installing Golang tools (${#gotools[@]})"
491491

492+
# Force module-mode resolution so vendored or GOPATH-mode environments
493+
# don't break go install for tools whose modules use SIV (e.g. /v2, /v3).
494+
export GOFLAGS="-mod=mod"
495+
export GO111MODULE="on"
496+
492497
local go_step=0
493498
local failed_tools=()
494499
local total_go=${#gotools[@]}
@@ -624,6 +629,14 @@ function install_tools() {
624629
continue
625630
}
626631

632+
# Update origin URL if the entry in the repos array has changed (e.g. org rename)
633+
local _expected_url="https://github.com/${repos[$repo]}"
634+
local _current_url
635+
_current_url=$(git remote get-url origin 2>/dev/null || echo "")
636+
if [[ -n "$_current_url" && "${_current_url%.git}" != "${_expected_url%.git}" ]]; then
637+
git remote set-url origin "$_expected_url" &>/dev/null || true
638+
fi
639+
627640
# Return to default branch if stuck in detached HEAD (e.g. from a previous tag checkout)
628641
if ! git symbolic-ref -q HEAD &>/dev/null; then
629642
local _default_branch
@@ -671,7 +684,6 @@ function install_tools() {
671684
fi
672685
;;
673686
"nomore403")
674-
go get &>/dev/null || true
675687
if ! go build &>/dev/null; then
676688
msg_warn "[$repos_step/$total_repo] $repo: go build failed"
677689
else
@@ -688,7 +700,7 @@ function install_tools() {
688700
fi
689701
;;
690702
"trufflehog")
691-
go install &>/dev/null || msg_warn "[$repos_step/$total_repo] $repo: go install failed"
703+
go install github.com/trufflesecurity/trufflehog/v3@latest &>/dev/null || msg_warn "[$repos_step/$total_repo] $repo: go install failed"
692704
;;
693705
"gato")
694706
if [[ ! -d "venv" ]]; then
@@ -759,6 +771,7 @@ function install_tools() {
759771
function reset_git_proxies() {
760772
git config --global --unset http.proxy || true
761773
git config --global --unset https.proxy || true
774+
export GIT_TERMINAL_PROMPT=0
762775
}
763776

764777
# Function to check for updates

0 commit comments

Comments
 (0)