Skip to content

Commit

Permalink
added unix /usr/share/ wordlist path
Browse files Browse the repository at this point in the history
  • Loading branch information
x90skysn3k committed Feb 23, 2024
1 parent 65104a4 commit 4968db8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BruteSpray

![Version](https://img.shields.io/badge/Version-2.1.5-red)[![goreleaser](https://github.com/x90skysn3k/brutespray/actions/workflows/release.yml/badge.svg)](https://github.com/x90skysn3k/brutespray/actions/workflows/release.yml)
![Version](https://img.shields.io/badge/Version-2.1.6-red)[![goreleaser](https://github.com/x90skysn3k/brutespray/actions/workflows/release.yml/badge.svg)](https://github.com/x90skysn3k/brutespray/actions/workflows/release.yml)

Created by: Shane Young/@t1d3nio && Jacob Robles/@shellfail

Expand Down
13 changes: 13 additions & 0 deletions modules/wordlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ func ReadPasswordsFromFile(filename string) ([]string, error) {
func GetUsersFromDefaultWordlist(version string, serviceType string) []string {
wordlistPath := filepath.Join("wordlist", serviceType, "user")
url := fmt.Sprintf("https://raw.githubusercontent.com/x90skysn3k/brutespray/%s/wordlist/%s/user", version, serviceType)

globalWordlistPath := filepath.Join("/usr/share/brutespray/wordlist", serviceType, "user")

if _, err := os.Stat(globalWordlistPath); !os.IsNotExist(err) {
wordlistPath = globalWordlistPath
}

wordlistDir := filepath.Dir(wordlistPath)
if _, err := os.Stat(wordlistDir); os.IsNotExist(err) {
err := os.MkdirAll(wordlistDir, 0755)
Expand Down Expand Up @@ -132,6 +139,12 @@ func GetPasswordsFromDefaultWordlist(version string, serviceType string) []strin
wordlistPath := filepath.Join("wordlist", serviceType, "password")
url := fmt.Sprintf("https://raw.githubusercontent.com/x90skysn3k/brutespray/%s/wordlist/%s/password", version, serviceType)

globalWordlistPath := filepath.Join("/usr/share/brutespray/wordlist", serviceType, "password")

if _, err := os.Stat(globalWordlistPath); !os.IsNotExist(err) {
wordlistPath = globalWordlistPath
}

wordlistDir := filepath.Dir(wordlistPath)
if _, err := os.Stat(wordlistDir); os.IsNotExist(err) {
err := os.MkdirAll(wordlistDir, 0755)
Expand Down

0 comments on commit 4968db8

Please sign in to comment.