Skip to content

Commit

Permalink
removed all calls to hiding the cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
Athanasios Kostopoulos committed Oct 28, 2015
1 parent 043a097 commit 47f0501
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions delaporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func fatal(e error) {

func printNDie(pass []byte) {
fmt.Println(string(pass))
os.Stdout.Write([]byte("\033[?25h"))
os.Exit(0)
}

Expand Down Expand Up @@ -65,7 +64,6 @@ func checkKey(jobs <-chan string, wg *sync.WaitGroup, block *pem.Block) {

func crack(block *pem.Block, wordlist string) string {
jobs := make(chan string)
//results := make(chan string, 1)
file, err := os.Open(wordlist)
if err != nil {
fatal(err)
Expand All @@ -81,8 +79,7 @@ func crack(block *pem.Block, wordlist string) string {
}
close(jobs)
}()
// start up some workers that will block and wait?
for w := 0; w < workers; w++ {
for w := 0; w < 512*workers; w++ {
wg.Add(1)
go checkKey(jobs, wg, block)
}
Expand All @@ -92,20 +89,17 @@ func crack(block *pem.Block, wordlist string) string {

func usage() {
fmt.Println("delaporter -keyfile <SSH PRIVATE KEY> -wordlist <YOUR WORDLIST>")
os.Stdout.Write([]byte("\033[?25h"))
os.Exit(1)
}

func main() {
os.Stdout.Write([]byte("\033[?25l"))
// let us set a ^C handler ...
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
signal.Notify(c, syscall.SIGTERM)
go func() {
<-c
os.Stdout.Write([]byte("\r"))
os.Stdout.Write([]byte("\033[?25h"))
fmt.Println("^C caught - Exiting")
os.Exit(255)
}()
runtime.GOMAXPROCS(workers)
Expand All @@ -131,5 +125,4 @@ func main() {
os.Exit(0)
}
fmt.Println(crack(block, *wordPtr))
os.Stdout.Write([]byte("\033[?25h"))
}

0 comments on commit 47f0501

Please sign in to comment.