tillson / git-hound

Reconnaissance tool for GitHub code search. Scans for exposed API keys across all of GitHub, not just known repos and orgs.
MIT License
1.19k stars 184 forks source link

Panic Error / Report Issue #57

Open shaikhyaser opened 1 year ago

shaikhyaser commented 1 year ago

Describe the bug Getting Panic error while running / analyzing more than 100 pages

To Reproduce Steps to reproduce the behavior: echo "\"xxxxxxxxx.com\"" | ./git-hound --dig-files --dig-commits --threads 100

Error

panic: runtime error: index out of range [1] with length 0

goroutine 1 [running]:
github.com/tillson/git-hound/internal/app.SearchGitHub({0xc000160d38, 0x13}, {0x64, {0x0, 0x0}, {{0x0, 0x0}, {0x0, 0x0}, 0x0, ...}}, ...)
        /Users/tillson/git-hound/internal/app/search.go:210 +0x1138
github.com/tillson/git-hound/internal/app.Search({0xc000160d38, 0x13}, 0x2?)
        /Users/tillson/git-hound/internal/app/search.go:66 +0x1c5
github.com/tillson/git-hound/cmd.glob..func1(0xf0fa40?, {0xc000138480, 0x0, 0x6?})
        /Users/tillson/git-hound/cmd/root.go:96 +0x6ee
github.com/spf13/cobra.(*Command).execute(0xf0fa40, {0xc00013c010, 0x6, 0x6})
        /Users/tillson/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0xf0fa40)
        /Users/tillson/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/tillson/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
github.com/tillson/git-hound/cmd.Execute()
        /Users/tillson/git-hound/cmd/root.go:124 +0x25
main.main()
        /Users/tillson/git-hound/main.go:10 +0x17
tillson commented 1 year ago

Is this on 1.6.2 (latest commit)? I tried to fix this yesterday in the new version

shaikhyaser commented 1 year ago

I didn't notice the bug fixed in the latest commit. It's fixed.

In new commit 1.6.2, Is the report getting generated for searches over 80 pages? I tried couple of domains and it hangs.

tillson commented 1 year ago

Let me look into that... the code has gotten very messy recently due to GitHub having two different search UIs that are presented to different users.

shaikhyaser commented 1 year ago

Thanks @tillson