Created
January 13, 2018 15:01
-
-
Save wrfly/791644407cf8b7be6ba7befd3de4ee59 to your computer and use it in GitHub Desktop.
A fake ssh server to record passwords.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"github.com/gliderlabs/ssh" | |
) | |
func main() { | |
log.Println("starting ssh server on port 2222...") | |
opts := ssh.PasswordAuth(func(ctx ssh.Context, password string) bool { | |
log.Printf("Auth from: [%s], user: [%s], passwd: [%s]", | |
ctx.RemoteAddr().String(), ctx.User(), password) | |
return false | |
}) | |
log.Fatal(ssh.ListenAndServe(":2222", nil, opts)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment