understanding vps security via ssh · 2020. 4. 10. · security what to do about all these...

24
Understanding VPS Security via SSH Pat Pannuto / Marcus Darden / Cameron Gagnon (for today!)

Upload: others

Post on 19-Jan-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

UnderstandingVPSSecurityviaSSH

PatPannuto/MarcusDarden/CameronGagnon(fortoday!)

Page 2: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

Today'sDefinitions-VPS

Page 3: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

Today'sDefinitions-VPS

-PAM

Page 4: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

Today'sDefinitions-VPS

-PAM

-SPAM

Page 5: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

Today'sDefinitions-VPS

-PAM

-SSH

Page 6: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

ReallyToday'sDefinitions-VirtualPrivateServers(VPS)

-PluggableAuthenticationModules(PAM)

-SecureSHell(SSH)

Page 7: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

ReallyToday'sDefinitions-VirtualPrivateServers(VPS)

Homework1!

-PluggableAuthenticationModules(PAM)

-SecureSHell(SSH)

Page 8: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

ReallyToday'sDefinitions-VirtualPrivateServers(VPS)

Homework1!

-PluggableAuthenticationModules(PAM)

-SecureSHell(SSH)Matt'spostonPiazza!

Page 9: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

NowYouKnow

Page 10: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

Project'sGoal-Showusthepasswordsofpeople(orprograms)tryingtoauthenticatetotheVirtualPrivateServer

Page 11: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

Project'sGoal-Showusthepasswordsofpeople(orprograms)tryingtoauthenticatetotheVirtualPrivateServer

Lecture'sGoal-Showhowknowledgefromthisclasscanbeapplied

Page 12: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

SettingupaVirtualPrivateServer-Whatdoyoudowhenyoufirstsetupanewcomputer,phone,orpersonaldevice?

Page 13: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

SettingupaVirtualPrivateServer-Whatdoyoudowhenyoufirstsetupanewcomputer,phone,orpersonaldevice?

DotfilesHomework12!

Page 14: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

SettingupaVirtualPrivateServer-Whatdoyoudowhenyoufirstsetupanewcomputer,phone,orpersonaldevice?

DotfilesHomework12!

~/.ssh/config

Hostc4cs-lecture

Hostname138.236.11.81

Userroot

IdentityFile~/.ssh/id_rsa_do_pnu

RegularandAdvancedHomework12

Page 15: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

Let'sdiveinhttps://github.com/cameron-gagnon/ssh_pass_logging

Page 17: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

InstallingthePAMmoduleWheredidwelearnhowprogramsgetconfigurationinformation?

Page 18: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

InstallingthePAMmoduleWheredidwelearnhowprogramsgetconfigurationinformation?

Lecture3!

Page 19: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

InstallingthePAMmoduleWheredidwelearnhowprogramsgetconfigurationinformation?

Lecture3!

AlternativestoaPAMmoduleInstallandcompileOpenSSHfromsourcewhileaddingthispatch.Wouldgettotieinpackagemanagers(Week12!)

Page 20: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

Scripting#fromcreate_initial_users.sh

#listofsomedefaultusernamestoadd

whileIFS=''read-ruser||[[-n"$user"]];

do

./honeypot_user.sh"$user"

done<"usernames.txt"

RegularandAdvancedHomework3AdvancedHomework6

Page 21: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

PipingcommandsFromLecture6

ifconfigenp0s3|grep'inet'|tr-s"[:space:]"":"|cut-d":"-f4

Fromthe Makefile

cat/var/log/passwords|cut-d';'-f3|grep-vE

'^[[:cntrl:]]|^[[:space:]]*$$'|cut-d=-f2|tr-d''|sort|uniq|

tee-ausernames.txt

Page 22: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

SecurityWhattodoaboutalltheseattempts?

Configuresettingsin /etc/ssh/sshd_config topreventpasswordbasedauthenticationfail2ban

Page 23: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

Attendance

Page 24: Understanding VPS Security via SSH · 2020. 4. 10. · Security What to do about all these attempts? Configure settings in /etc/ssh/sshd_config to prevent password based authentication

Questions?