Skip to content
This repository was archived by the owner on Aug 18, 2023. It is now read-only.

Commit bee8aa4

Browse files
authored
Merge pull request #5 from ZerkerEOD/master
Bug fix with using passfile and added ask on n consecutive locked accounts.
2 parents f85e1e6 + b634911 commit bee8aa4

1 file changed

Lines changed: 41 additions & 17 deletions

File tree

Talon.go

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type KERB struct {
4646
Enum bool
4747
}
4848

49-
//FlagOptions set at startup
49+
// FlagOptions set at startup
5050
type FlagOptions struct {
5151
host string
5252
hostfile string
@@ -63,6 +63,7 @@ type FlagOptions struct {
6363
enum bool
6464
kerb bool
6565
ldap bool
66+
lockerr float64
6667
}
6768

6869
func printDebug(format string, v ...interface{}) {
@@ -89,10 +90,11 @@ func options() *FlagOptions {
8990
enum := flag.Bool("E", false, "Enumerates which users are valid")
9091
kerb := flag.Bool("K", false, "Test against Kerberos only")
9192
ldap := flag.Bool("L", false, "Test against LDAP only")
93+
lockerr := flag.Float64("LockErr", 1, "Repetative lockout errors")
9294
flag.Parse()
9395
debugging = *debug
9496
debugWriter = os.Stdout
95-
return &FlagOptions{host: *host, domain: *domain, user: *user, userfile: *userfile, hostfile: *hostfile, pass: *pass, outFile: *outFile, sleep: *sleep, enum: *enum, ldap: *ldap, kerb: *kerb, passfile: *passfile, lockout: *lockout, attempts: *attempts}
97+
return &FlagOptions{host: *host, domain: *domain, user: *user, userfile: *userfile, hostfile: *hostfile, pass: *pass, outFile: *outFile, sleep: *sleep, enum: *enum, ldap: *ldap, kerb: *kerb, passfile: *passfile, lockout: *lockout, attempts: *attempts, lockerr: *lockerr}
9698
}
9799

98100
func readfile(inputFile string) []string {
@@ -135,7 +137,7 @@ func main() {
135137
\|__| \|__|\|__|\|_______|\|_______|\|__| \|__|
136138
(@Tyl0us)
137139
138-
`)
140+
Version: 3.2 `)
139141

140142
if opt.enum {
141143
services = []string{"KERB"}
@@ -238,6 +240,7 @@ func main() {
238240
domain := strings.ToUpper(opt.domain)
239241
printDebug("Domain %v\tUsernames %v\tPasswords %v\tHosts %v\tServices %v\n", domain, usernames, password, hosts, services)
240242
x := 0
243+
err := 0
241244
rand.Seed(time.Now().Unix())
242245
lenServices := len(services) - 1
243246
for _, username := range usernames {
@@ -253,13 +256,17 @@ func main() {
253256
result, forfile, _ := auth.Login()
254257
fmt.Println(result)
255258
if strings.Contains(result, "User's Account Locked") && opt.enum != true {
256-
reader := bufio.NewReader(os.Stdin)
257-
fmt.Print("[*] Account lock out detected - Do you want to continue.[y/n]: ")
258-
text, _ := reader.ReadString('\n')
259-
if strings.Contains(text, "y") {
260-
continue
259+
err++
260+
if err == int(opt.lockerr) {
261+
reader := bufio.NewReader(os.Stdin)
262+
fmt.Printf("[*] %d Consecutive account lock out(s) detected - Do you want to continue.[y/n]: ", err)
263+
text, _ := reader.ReadString('\n')
264+
if strings.Contains(text, "y") {
265+
err = 0
266+
continue
267+
}
268+
log.Fatal("Shutting down")
261269
}
262-
log.Fatal("Shutting down")
263270
}
264271
if opt.outFile != "" {
265272
forfile = forfile + "\n"
@@ -269,25 +276,33 @@ func main() {
269276
x = 0
270277
} else {
271278
x++
279+
err = 0
272280
}
273281
}
274282
}
275283

276284
if opt.pass == "" && opt.passfile != "" {
277285
var counter float64
278286
counter = 0
287+
var username string
288+
var pwd string
279289
// Use previous main function but iterate through passwords and automate stuff
280-
for _, pwd := range passwords {
290+
// for _, pwd := range passwords {
291+
for p := 0; p < len(passwords); p++ {
281292
printDebug("This is the current value of counter: %f\n", counter)
282293
if counter < opt.attempts {
294+
pwd = passwords[p]
283295
fmt.Print(time.Now().Format("01-02-2006 15:04:05: "))
284296
fmt.Printf("Using password: %s\n", pwd)
285297
domain := strings.ToUpper(opt.domain)
286298
printDebug("Domain %v\tUsernames %v\tPasswords %v\tHosts %v\tServices %v\n", domain, usernames, pwd, hosts, services)
287299
x := 0
300+
err := 0
288301
rand.Seed(time.Now().Unix())
289302
lenServices := len(services) - 1
290-
for _, username := range usernames {
303+
// for _, username := range usernames {
304+
for i := 0; i < len(usernames); i++ {
305+
username = usernames[i]
291306
n := 0
292307
if opt.hostfile != "" {
293308
n = rand.Int() % (len(hosts) - 1)
@@ -301,13 +316,20 @@ func main() {
301316
result, forfile, _ := auth.Login()
302317
fmt.Println(result)
303318
if strings.Contains(result, "User's Account Locked") && opt.enum != true {
304-
reader := bufio.NewReader(os.Stdin)
305-
fmt.Print("[*] Account lock out detected - Do you want to continue.[y/n]: ")
306-
text, _ := reader.ReadString('\n')
307-
if strings.Contains(text, "y") {
308-
continue
319+
err++
320+
usernames[i] = usernames[len(usernames)-1]
321+
usernames = usernames[:len(usernames)-1]
322+
i--
323+
if err == int(opt.lockerr) {
324+
reader := bufio.NewReader(os.Stdin)
325+
fmt.Printf("[*] %d Consecutive account lock out(s) detected - Do you want to continue.[y/n]: ", err)
326+
text, _ := reader.ReadString('\n')
327+
if strings.Contains(text, "y") {
328+
err = 0
329+
continue
330+
}
331+
log.Fatal("Shutting down")
309332
}
310-
log.Fatal("Shutting down")
311333
}
312334
if opt.outFile != "" {
313335
forfile = forfile + "\n"
@@ -317,6 +339,7 @@ func main() {
317339
x = 0
318340
} else {
319341
x++
342+
err = 0
320343
}
321344
}
322345
counter++
@@ -328,6 +351,7 @@ func main() {
328351
time.Sleep(time.Duration(opt.lockout) * time.Minute)
329352
color.Unset()
330353
counter = 0
354+
p--
331355
}
332356
}
333357
}

0 commit comments

Comments
 (0)