Opens a ssh server and listens for authentication data (login and password). Input is logged.
This code is created to collect most popular passwords via AWS based experiment: collect passwords blog post.
Generate SSH key (optional)
ssh-keygen -t rsa -b 4096 -C "email@example.com"
Leave passphrase empty.
go run sshlistener.go -private=id_rsa -output=log.out -port=2022
- private: path to a private key
- output: path to a log file to be created or appended
- port: to listen at
Connect to the listener
ssh firstname.lastname@example.org -p2022
Listener always replies with invalid password, but data is logged into configured log file.