gopasscheck

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 92ae8a867e727fd688c55fa4dd4c02a07a6501b2
parent 2717ec0c02d323dfd247918346d42254e46f097b
Author: Michael Constantine Dimopoulos <mk@mcdim.xyz>
Date:   Thu, 23 Jun 2022 23:44:32 +0000

Updated words and charset

Diffstat:
Msrc/charset.go | 19++++++++++++++++++-
Msrc/words.go | 13+++++++++++--
2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/src/charset.go b/src/charset.go @@ -5,6 +5,23 @@ import ( "unicode" ) +func IsSymbol(r rune) bool { + + if (r == '!' || r == '@' || r == '#' || + r == '$' || r == '%' || r == '^' || + r == '&' || r == '*' || r == '(' || + r == ')' || r == '-' || r == '{' || + r == '}' || r == '[' || r == ']' || + r == ':' || r == ';' || r == '"' || + r == '\''|| r == '<' || r == '>' || + r == '.' || r == '/' || r == '?' || + r == '~' || r == '`' || r == ' ') { + return true + } + + return false +} + func charset_test(pass string) { let := false @@ -29,7 +46,7 @@ func charset_test(pass string) { } } - if (unicode.IsSymbol(rune(r))) { + if (IsSymbol(rune(r))) { sym = true } } diff --git a/src/words.go b/src/words.go @@ -40,8 +40,17 @@ func words_test(pass string, file string) { for fScanner.Scan() { line := fScanner.Text() if (len(line) >= 3 && strings.Contains(pass1, line)) { - fmt.Printf(YEL + "[-] Password contains dictionary words - "+RESET) - fmt.Printf("%s : %s\n", file, line) + var perc float64 = float64(len(line))/float64(len(pass1))*100.0 + if (perc == 100.0) { + fmt.Printf(RED + "[!] Password is dictionary word - %.1f - ", perc) + } else if (perc >= 70.0) { + fmt.Printf(RED + "[!] Password contains dictionary words - %.1f - ", perc) + } else if (perc >= 35.0) { + fmt.Printf(YEL + "[-] Password contains dictionary words - %.1f - ", perc) + } else { + fmt.Printf(BLUE + "[~] Password contains dictionary words - %.1f - ", perc) + } + fmt.Printf(RESET + "%s : %s\n", file, line) found = true } }