Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
wrfly committed Apr 1, 2017
1 parent 2e1ae6a commit dbf9073
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 29 deletions.
Binary file removed hydra.restore
Binary file not shown.
61 changes: 32 additions & 29 deletions src/ssh-goburp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ func main() {
passwords = readFile(*password)
}

log.Infof("Load [%v] passwords", len(passwords))
log.Infof("Load [%v] Usernames", len(usernames))
log.Infof("Load [%v] Passwords", len(passwords))
stime := time.Now()
log.Infof("Starting at %v", stime)
log.Infof("Starting at %v", time.Now())

tries := make(chan int, 1)
tries <- 1
Expand All @@ -87,7 +88,31 @@ func main() {
break
}
success <- 0
go burp(auth, success, tries, passwd)
go func(auth handler.Auth, success chan int,
tries chan int, passwd chan string) {
if <-success == 1 {
success <- 1
return
}
success <- 0
if target.Try(auth) {
log.Info(time.Now())
log.Infof("Auth [%v] Connected!", auth)
<-success
success <- 1
passwd <- auth.Pass
return
}
t := <-tries
if t == total {
log.Error("Password not found.")
<-success
success <- 1
passwd <- "Password not found."
return
}
tries <- t + 1
}(auth, success, tries, passwd)
time.Sleep(25000 * time.Microsecond)
}
}
Expand Down Expand Up @@ -120,33 +145,11 @@ func readFile(filename string) []string {
if err == io.EOF {
break
}
appendTo = append(appendTo, string(line))
l := string(line)
if l != "" {
appendTo = append(appendTo, l)
}
}
f.Close()
return appendTo
}

func burp(auth handler.Auth, success chan int, tries chan int, passwd chan string) {
if <-success == 1 {
success <- 1
return
}
success <- 0
if target.Try(auth) {
log.Info(time.Now())
log.Infof("Auth [%v] Connected!", auth)
<-success
success <- 1
passwd <- auth.Pass
return
}
t := <-tries
if t == total {
log.Error("Password not found.")
<-success
success <- 1
passwd <- "Password not found."
return
}
tries <- t + 1
}
Binary file removed ssh-goburp
Binary file not shown.

0 comments on commit dbf9073

Please sign in to comment.